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