#include<bits/stdc++.h> using namespace std; int main() { int a,b; cin>>b; do { a = b % 10; b /= 10; }while(b); cout<<a; }