#include <iostream>
#include <string>
using namespace std;

int main() {
	string x;
	bool cvrst = false;
	cin >> x;
	for (int i = 1; i < x.size(); i++) {
		if (x[i] == x[i - 1] && x[i] != '0') {
			cout << "0";
			cvrst = true;
			break;
		}
	}
	if (cvrst == false)cout << "1";
	return 0;
}