
#include <vector>
#include <iostream>
#include <sstream>
using namespace std;

bool any(const vector<bool>& v);

int main() {
  string linia;
  while (getline(cin, linia)) {
    istringstream S(linia);
    vector<bool> v;
    bool b;
    while (S >> b) {
      v.push_back(b);
    }
    cout << any(v) << endl;
  }
}
