#include using namespace std; int main(){ int N, i, tmp; vector x; cin >> N; for(i = 0; i < N; i++){ cin >> tmp; x.push_back(tmp); } if(N%2 == 0){ cout << 0 << endl; }else{ cout << 1 << endl; } return 0; }