#include <iostream>
#include<cmath>
using namespace std;

int main() {
  int a;
  cin>>a;
  a=abs(a);
  cout<<a%10;
}
// 64 位输出请用 printf("%lld")