#include <stdio.h>
#include<math.h>
int main() {
    int a,b,c;
    scanf("%d",&a);
    b=fabs(a);  c=b%10;
    printf("%d",c);
    return 0;
}