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