#include<stdio.h>
int main(){
    int num;
    scanf("%d",num);
    int f=num%10;
    printf("%d",f);
}