Chouti was doing a competitive programming competition. However, after having all the problems accepted, he got bored and decided to invent some small games.

He came up with the following game. The player has a positive integer n. Initially the value of n equals to v and the player is able to do the following operation as many times as the player want (possibly zero): choose a positive integer x that x<n and x is not a divisor of n, then subtract x from n. The goal of the player is to minimize the value of n in the end.

Soon, Chouti found the game trivial. Can you also beat the game?

Input

The input contains only one integer in the first line: v (1 ≤ v ≤ 10^9), the initial value of n.

Output

Output a single integer, the minimum value of n the player can get.

Examples

Input


8


Output


1


Input


1


Output


1

Note

In the first example, the player can choose x=3 in the first turn, then n becomes 5. He can then choose x=4 in the second turn to get n=1 as the result. There are other ways to get this minimum. However, for example, he cannot choose x=2 in the first turn because 2 is a divisor of 8.

In the second example, since n=1 initially, the player can do nothing.
//package com.company;

import java.io.*;
import java.lang.reflect.Array;
import java.math.BigDecimal;
import java.math.BigInteger;
import java.util.*;

import static java.lang.Math.*;

public class Main {

    FastScanner in;
    PrintWriter out;
    int cnt;
    long mod = 1000000007;

    long gcd(long a, long b){
        if(b == 0){
            return a;
        }
        return  gcd(b, a%b);
    }

    class Pair implements Comparable<Pair> {
        int x;
        int y;

        Pair(int i, int j) {
            x = i;
            y = j;
        }

        @Override
        public boolean equals(Object o) {
            if (this == o)
                return true;
            if (o == null || getClass() != o.getClass())
                return false;
            Pair p = (Pair) o;
            return (x == p.x && y == p.y);
        }

        @Override
        public int compareTo(Pair that) {
            if (x == that.x) {
                return Double.compare(y, that.y);
            }
            return Double.compare(x, that.x);
        }
    }




    class quemin {
        int[] stack1;
        int[] min1;
        int sz1;
        int stack2[];
        int min2[];
        int sz2;

        quemin(int n) {
            stack1 = new int[n];
            min1 = new int[n];
            stack2 = new int[n];
            min2 = new int[n];
            sz1 = sz2 = 0;
        }

        void add(int x) {
            stack1[sz1] = x;
            min1[sz1] = sz1 > 0 ? min(x, min1[sz1 - 1]) : x;
            sz1++;
        }

        void pop() {
            if (sz2 > 0) {
                sz2--;
            } else {
                while (sz1 > 0) {
                    stack2[sz2] = stack1[sz1 - 1];
                    min2[sz2] = sz2 > 0 ? min(stack2[sz2], min2[sz2 - 1]) : stack2[sz2];
                    sz2++;
                    sz1--;
                }
                sz2--;
            }
        }

        int getmin1() {
            if (sz1 > 0) {
                return min1[sz1 - 1];
            }
            return Integer.MAX_VALUE;
        }

        int getmin2() {
            if (sz2 > 0) {
                return min2[sz2 - 1];
            }
            return Integer.MAX_VALUE;
        }

        int getmin() {
            return min(getmin1(), getmin2());
        }
    }

    long sum(long a){
        long ans = 0;
        while(a > 0) {
            ans += a % 10;
            a/=10;
        }
        return ans;
    }

    ArrayList<Integer> g[];
    void dfs1(int v) throws IOException {
        used[v] = true;
        for(int i : g[v]){
            if(!used[i]){
                dfs1(i);
            }
        }
    }
    int[] minim;
    void dfs2(int v, int cnt) throws IOException{
        minim[v] = cnt;
        used[v] = true;
        for(int i : g[v]){
            if(!used[i]){
                dfs2(i, cnt + 1);
            }
        }
    }

    private void help() throws IOException {
        int n = in.nextInt();
        if(n >= 3){
            out.print(1);
        } else {
            out.print(n);
        }

    }


    private void solve2() throws IOException {
        long a = in.nextLong(), b = in.nextInt();
        int ans = 0;
        if(b - a < 20){
            for(long i = a; i <= b; i++){
                if ((sum(i)) % 2 == 0) {
                    ans++;
                }
            }
        } else {
            long l = a % 10 == 0 ? a : a + (10 - a % 10);
            long r = b - b % 10;
            if (r >= l) {
                ans += 5 * ((r - l) / 10);
            }
            for (long i = a; i < l; i++) {
                if ((sum(i)) % 2 == 0) {
                    ans++;
                }
            }//3нч 4ч 5нч 6ч 7нч 8ч 9нч 10нч 11ч 12нч 13ч 14нч 15ч 16нч 17ч 18нч 19ч 20ч 21нч 22ч 23нч 24ч 25нч
            for (long i = r; i <= b; i++) {
                if ((sum(i)) % 2 == 0) {
                    ans++;
                }
            }
        }
        out.print(ans);

    }

    private void solveI() throws IOException {
        int x = in.nextInt(), y = in.nextInt(), z = in.nextInt();
        int sum = x + y + z;
        if(sum % 2 != 0){
            out.print("NO");
            return;
        }
        if(Math.max(Math.max(x, y), z) > sum/2){
            out.print("NO");
            return;
        }
        if(Math.min(Math.min(x, y), z) < sum/4){
            out.print("NO");
            return;
        }
        out.print("YES");
    }

    private void solveK() throws IOException{
        int k = in.nextInt();
        ArrayList<Integer> p = new ArrayList<>();
        int unprime[] = new int[2012];
        for(int i = 2; i < 2012; i++){
            if(unprime[i] == 0){
                p.add(i);
            }
            for(int j = 2; i * j < 2012; j++){
                unprime[i*j] = 1;
            }
        }
        int beg = 0, end = k - 1;
        long ans = 0;
        if(k > p.size()){
            out.print("NO SOLUTION");
            return;
        }
        for(int i = 0; i < min(k, p.size()); i++){
            ans += p.get(i);
        }
        while(end + 1 < p.size()){
            if(ans == 2011){
                for(int i = beg; i <= end; i++){
                    out.print(p.get(i) + " ");
                }
                return;
            }
            end++;
            beg++;
            ans -= p.get(beg - 1);
            ans += p.get(end);
        }
        if(ans == 2011){
            for(int i = beg; i <= end; i++){
                out.print(p.get(i) + " ");
            }
            return;
        }
        out.print("NO SOLUTION");
    }

    private void solveO() throws IOException {
        int n = in.nextInt();
        int[] ans1 = new int[n];
        int cur = 0;
        for(int i = 0; i < n; i++){
            ans1[i] = 400 - i;
            if(in.nextInt() == 1){
                cur = i;
                break;
            }
        }
        for(int i = 0; i  < n - cur - 1; i++){
            in.nextInt();
            ans1[n - i - 1] = i + 1;
        }
        int[] ans2 = new int[n];
        cur = 0;
        for(int i = 0; i < n; i++){
            ans2[i] = 400 - i;
            if(in.nextInt() == 1){
                cur = i;
                break;
            }
        }
        for(int i = 0; i < n - cur - 1; i++){
            ans2[n - i - 1] = i + 1;
        }
        for(int i = 0; i < n; i++){
            out.print(ans1[i] + " ");
        }
        out.println();
        for(int i = 0; i < n; i++){
            out.print(ans2[i] + " ");
        }

    }

    int[] from;
    int[] to;
    boolean[] used;


    private void solveL() throws IOException {
        int n = in.nextInt(), m = in.nextInt();
        int[][] tab = new int[n][m];
        boolean[][] used = new boolean[n][m];
        long[][] ans = new long[n][m];
        for(int i = 0; i < n; i++){
            for(int j = 0; j < m; j++){
                tab[i][j] = in.nextInt();
            }
        }
        ArrayDeque<Pair> bf = new ArrayDeque<>();
        bf.add(new Pair(0, 0));
        boolean f = false;
        while(!bf.isEmpty() &&!f){
            Pair cur = bf.poll();
            for(int i = cur.x + 1; i < n &&!f; i++){
                if(tab[i][cur.y] == 2){
                    out.print(ans[cur.x][cur.y] + 1);
                    f = true;
                    break;
                }
                if(i == n - 1 || tab[i + 1][cur.y] == 1){
                    if(!used[i][cur.y]){
                        ans[i][cur.y] = ans[cur.x][cur.y] + 1;
                        bf.add(new Pair(i, cur.y));
                    }
                    break;
                }
            }
            for(int i = cur.x - 1; i >= 0 && !f; i--){
                if(tab[i][cur.y] == 2){
                    out.print(ans[cur.x][cur.y] + 1);
                    f = true;
                    break;
                }
                if(i == 0 || tab[i - 1][cur.y] == 1){
                    if(!used[i][cur.y]){
                        ans[i][cur.y] = ans[cur.x][cur.y] + 1;
                        bf.add(new Pair(i, cur.y));
                    }
                    break;
                }
            }
            for(int j = cur.y + 1; j < n && !f; j++){
                if(tab[cur.x][j] == 2){
                    out.print(ans[cur.x][j] + 1);
                    f = true;
                    break;
                }
                if( j == n - 1 || tab[cur.x][j + 1] == 1){
                    if(!used[cur.x][j]){
                        ans[cur.x][j] = ans[cur.x][cur.y] + 1;
                        bf.add(new Pair(cur.x, j));
                    }
                    break;
                }
            }
            for(int j = cur.y - 1; j >= 0 && !f; j--){
                if(tab[cur.x][j] == 2){
                    out.print(ans[cur.x][j] + 1);
                    f = true;
                    break;
                }
                if( j == 0 || tab[cur.x][j - 1] == 1){
                    if(!used[cur.x][j]){
                        ans[cur.x][j] = ans[cur.x][cur.y] + 1;
                        bf.add(new Pair(cur.x, j));
                    }
                    break;
                }
            }
            used[cur.x][cur.y] = true;
        }

    }



    class FastScanner {
        StringTokenizer st;
        BufferedReader br;

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

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

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

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

        double nextDouble() throws IOException {
            return Double.parseDouble(next().replace(',', '.'));
        }

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

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

    }
    //157нч 158ч 159нч 160нч 161ч 162нч 163ч 164нч 165ч 166нч 167ч 168нч 169ч 170ч 171нч 172ч 173нч 174ч 175нч 176ч 177нч 178ч 179нч 180нч 181ч 182нч
    private void run() throws IOException {
        in = new FastScanner(System.in); //new FileInputStream(".in");
        out = new PrintWriter(System.out);
        help();
        /*for(int i = 0; i < 15; i++) {
            solve2();
            out.println();
            out.println();
        }*/
        out.flush();
        out.close();
    }






    public static void main(String[] args) throws IOException {
        new Main().run();

    }

}