#include<iostream> using namespace std; int main() { int M; cin>>M; if(M%2==0) cout<<0; else cout<<1; return 0; }