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