

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.io.BufferedReader;
import java.io.FileReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.StringTokenizer;

public class PointAndVectors {

	static class Vector implements Comparable<Vector> {
		double x,y;
		int ind;
		public Vector(double x,double y) {
			this.x = x;
			this.y = y;
		}
		double dot(Vector v) {
			return 1L*this.x*v.x + 1L*this.y * v.y;
		}
		double cross(Vector v) {
			return 1L*this.x*v.y - 1L*this.y * v.x;
		}
		double sqr(double x) {
			return 1.0*x * x;
		}
		double len() {
			return Math.sqrt((sqr(this.x)) + sqr(this.y));
		}
		static public double getAngleBetween(Vector v1, Vector v2) {
			double pi = Math.acos(-1.0);
			double ang = 1.0 *(v1.dot(v2) / (1.0*v1.len() * v2.len()));
			ang = Math.acos(ang);
			return ang;
		}
		public boolean orthogonal(Vector v2) {
			return this.dot(v2) == 0;
		}
		// HANDLE case == 0 
		public boolean pointToSameDir(Vector v2) {
			return this.dot(v2) > 0;
		}
		public int ccw(Vector v2) {
			double sign = this.cross(v2) ;
			int ret = 0;
			if(sign == 0) {
				ret = 0;
			}
			if(sign > 0) {
				ret = 1;
			}
			if(sign < 0) {
				ret = -1;
			}
			return ret;
		}
		@Override
		public int compareTo(Vector o) {
			// TODO Auto-generated method stub
			return this.ccw(o);
		}
	}
	public static void main(String[]args) throws Throwable {
		Scanner sc = new Scanner(System.in);
		PrintWriter out = new PrintWriter(System.out);
		int n = sc.nextInt();
		if(n % 2 == 0) out.println(0);
		else out.println(1);
	
		
		out.flush();
		out.close();
	}
	static class Scanner
	{
		StringTokenizer st;
		BufferedReader br;

		public Scanner(InputStream s){	br = new BufferedReader(new InputStreamReader(s));}

		public Scanner(FileReader s){	br = new BufferedReader(s);}

		public String next() throws IOException
		{
			while (st == null || !st.hasMoreTokens())
				st = new StringTokenizer(br.readLine());
			return st.nextToken();
		}

		public int nextInt() throws IOException {return Integer.parseInt(next());}

		public long nextLong() throws IOException {return Long.parseLong(next());}

		public String nextLine() throws IOException {return br.readLine();}

		public double nextDouble() throws IOException { return Double.parseDouble(next()); }

		public boolean ready() throws IOException {return br.ready();}
	}
}
