#include<bits/stdc++.h> using namespace std; int main() { int m; cin>>m; cout<<m%2<<endl; return 0; }