int Cal(float num)
{
    int b = (int)num;
    while(b >= 10)
    {
        b %= 10;
    }
    return b;
}

int main()
{
    float f;
    scanf("%f",&f);
    printf("%d", Cal(f));
    return 0;
}