

Input

The input contains a single integer a (10 ≤ a ≤ 999).

Output

Output 0 or 1.

Examples

Input

13


Output

1


Input

927


Output

1


Input

48


Output

0



import java.util.*;
public class Debug {
    private static Scanner in =new Scanner(System.in);
    public static ArrayList<String> gen(int[]set){
        ArrayList<String> list=new ArrayList<String> ();
        for(int i=1;i<Math.pow(2,set.length);i++){
            StringBuilder build=new StringBuilder();
            for(int j=0;j<set.length;j++)
                if((i&(1<<j))>0)
                    build.append(set[j]+",");
            list.add(build.toString());
        }
        return list;
    }
    public static int OR(String a){
        String[]z=a.split(",");
        int or=Integer.parseInt(z[0]);
        for(int i=1;i<z.length;i++){
            int cur=Integer.parseInt(z[i]);
            int x=or|cur;
            or=x;
        }
        return or;
    }
    public static void main(String[] args){
        int n=in.nextInt();
        if(n%2==0)
            System.out.println("0");
        else
            System.out.println(1);
    }
    }

