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 cf.C1081;


import java.io.BufferedReader;
import java.io.ByteArrayInputStream;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.Comparator;
import java.util.LinkedList;
import java.util.Random;
import java.util.StringTokenizer;

/**
 * @author Sri Mouli
 * Copyright © 2018 Sri Mouli. All rights reserved.
 */

@SuppressWarnings("ALL")
public class A1081 {

    public static long MOD = 1000000007;
    public static long[][][] dp;
    public static String INPUT = "3 " +
            "0 2 1";

    public static void main(String[] args) {
        long time = System.currentTimeMillis();
        boolean oj = System.getProperty("ONLINE_JUDGE") != null;
        PrintWriter out = new PrintWriter(System.out);
        FastReader in = new FastReader(oj);
        long n = in.nextLong();
        if(n==2l){
            System.out.println("2");
        } else {
            System.out.println("1");
        }
    }

    static class Graph
    {
        int V;
        LinkedList<Integer> adjListArray[];

        // constructor
        Graph(int V)
        {
            this.V = V;

            // define the size of array as
            // number of vertices
            adjListArray = new LinkedList[V];

            // Create a new list for each vertex
            // such that adjacent nodes can be stored
            for(int i = 0; i < V ; i++){
                adjListArray[i] = new LinkedList<>();
            }
        }
    }

    // Adds an edge to an undirected graph
    static void addEdge(Graph graph, int src, int dest)
    {
        // Add an edge from src to dest.
        graph.adjListArray[src].add(dest);

        // Since graph is undirected, add an edge from dest
        // to src also
        graph.adjListArray[dest].add(src);
    }

    static void printGraph(Graph graph)
    {
        for(int v = 0; v < graph.V; v++)
        {
            System.out.println("Adjacency list of vertex "+ v);
            System.out.print("head");
            for(Integer pCrawl: graph.adjListArray[v]){
                System.out.print(" -> "+pCrawl);
            }
            System.out.println("\n");
        }
    }

    public static int upper_bound(int A[], int key) {
        int first = 0;
        int last = A.length;
        int mid;

        while (first < last) {
            mid = first + (last - first) / 2;

            if (A[mid] <= key)
                first = mid + 1;
            else
                last = mid;
        }
        return first;
    }

    // For finding greater than equal to
    public static int lower_bound(int A[], int key) {
        int first = 0;
        int last = A.length;
        int mid;
        while (first < last) {
            mid = first + ((last - first) >> 1);
            if (A[mid] < key)
                first = mid + 1;
            else
                last = mid;
        }

        return first;
    }

    @SuppressWarnings("rawtypes")
    public static void printPermutations(Comparable[] c) {
        System.out.println(Arrays.toString(c));
        while ((c = nextPermutation(c)) != null) {
            System.out.println(Arrays.toString(c));
        }
    }

    @SuppressWarnings({ "rawtypes", "unchecked" })
    // modifies c to next permutation or returns null if such permutation does not
    // exist
    public static Comparable[] nextPermutation(final Comparable[] c) {
        // 1. finds the largest k, that c[k] < c[k+1]
        int first = getFirst(c);
        if (first == -1)
            return null; // no greater permutation
        // 2. find last index toSwap, that c[k] < c[toSwap]
        int toSwap = c.length - 1;
        while (c[first].compareTo(c[toSwap]) >= 0)
            --toSwap;
        // 3. swap elements with indexes first and last
        swap(c, first++, toSwap);
        // 4. reverse sequence from k+1 to n (inclusive)
        toSwap = c.length - 1;
        while (first < toSwap)
            swap(c, first++, toSwap--);
        return c;
    }

    // finds the largest k, that c[k] < c[k+1]
    // if no such k exists (there is not greater permutation), return -1
    @SuppressWarnings({ "rawtypes", "unchecked" })
    public static int getFirst(final Comparable[] c) {
        for (int i = c.length - 2; i >= 0; --i)
            if (c[i].compareTo(c[i + 1]) < 0)
                return i;
        return -1;
    }

    // swaps two elements (with indexes i and j) in array
    @SuppressWarnings("rawtypes")
    public static void swap(final Comparable[] c, final int i, final int j) {
        final Comparable tmp = c[i];
        c[i] = c[j];
        c[j] = tmp;
    }

    public static long cal(int index, int last, int n, int left) {
        if (index == n) {
            return left == 0 ? 1 : 0;
        }
        if (left < 0) {
            return 0;
        }
        if (dp[last][index][left] != -1) {
            return dp[last][index][left];
        }
        long result = 0;
        for (int i = 0; i < 4; i++) {
            result += cal(index + 1, i, n, left - count(last, i));
            result %= MOD;

        }
        return dp[last][index][left] = result;
    }

    public static int count(int last, int cur) {
        if (last == cur) {
            return 0;
        }
        if (last == 0) {
            return 1;
        }
        if (last == 1) {
            if (cur == 2) {
                return 2;
            }
            return 0;
        }
        if (last == 2) {
            if (cur == 1) {
                return 2;
            }
            return 0;
        }
        return 1;
    }

    public static boolean div(int need, String v) {
        int cur = 0;
        for (int i = 0; i < v.length(); i++) {
            cur += v.charAt(i) - '0';
            if (cur == need) {
                cur = 0;
            } else if (cur > need) {
                return false;
            }
        }
        return true;
    }

    public static int[] KMP(String val) {
        int i = 0;
        int j = -1;
        int[] result = new int[val.length() + 1];
        result[0] = -1;
        while (i < val.length()) {
            while (j >= 0 && val.charAt(j) != val.charAt(i)) {
                j = result[j];
            }
            j++;
            i++;
            result[i] = j;
        }
        return result;

    }

    public static boolean nextPer(int[] data) {
        int i = data.length - 1;
        while (i > 0 && data[i] < data[i - 1]) {
            i--;
        }
        if (i == 0) {
            return false;
        }
        int j = data.length - 1;
        while (data[j] < data[i - 1]) {
            j--;
        }
        int temp = data[i - 1];
        data[i - 1] = data[j];
        data[j] = temp;
        Arrays.sort(data, i, data.length);
        return true;
    }

    public static class Point implements Comparable<Point> {

        int x, y;

        public Point(int start, int end) {
            this.x = start;
            this.y = end;
        }

        @Override
        public int hashCode() {
            int hash = 5;
            hash = 47 * hash + this.x;
            hash = 47 * hash + this.y;
            return hash;
        }

        @Override
        public boolean equals(Object obj) {
            if (obj == null) {
                return false;
            }
            if (getClass() != obj.getClass()) {
                return false;
            }
            final Point other = (Point) obj;
            if (this.x != other.x) {
                return false;
            }
            return this.y == other.y;
        }

        @Override
        public int compareTo(Point o) {
            return Integer.compare(x, o.x);
        }
    }

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

    public static long pow(long a, long b, long MOD) {
        if (b == 0) {
            return 1;
        }
        if (b == 1) {
            return a;
        }
        long val = pow(a, b / 2, MOD);
        if (b % 2 == 0) {
            return val * val % MOD;
        } else {
            return val * (val * a % MOD) % MOD;

        }
    }

    public static int digit(long n) {
        int result = 0;
        while (n > 0) {
            n /= 10;
            result++;
        }
        return result;
    }

    public static double dist(long a, long b, long x, long y) {
        double val = (b - a) * (b - a) + (x - y) * (x - y);
        val = Math.sqrt(val);
        double other = x * x + a * a;
        other = Math.sqrt(other);
        return val + other;

    }

    private static class Pair {
        long x;
        long y;

        @SuppressWarnings("unused")
        public Pair(long first, long second) {
            this.x = first;
            this.y = second;
        }

        @Override
        public String toString() {
            return "(" + x + "," + y + ")";
        }
    }

    @SuppressWarnings("rawtypes")
    public static Comparator csort = (Comparator<Pair>) (a, b) -> {
        if (a.x < b.x)
            return -1;
        else if (a.x > b.x)
            return 1;
        else
            return Long.compare(a.y, b.y);
    };

    static class FastReader {

        BufferedReader br;
        StringTokenizer st;
        InputStream is;
        byte[] inbuf = new byte[1024];
        int lenbuf = 0, ptrbuf = 0;

        FastReader(boolean onlineJudge) {
            is = onlineJudge ? System.in : new ByteArrayInputStream(INPUT.getBytes());
            br = new BufferedReader(new InputStreamReader(System.in));
        }

        boolean isSpaceChar(int c) {
            return !(c >= 33 && c <= 126);
        }

        FastReader(String file) throws FileNotFoundException {
            br = new BufferedReader(new FileReader(file));
        }

        String next() {

            while (st == null || !st.hasMoreTokens()) {
                try {
                    st = new StringTokenizer(br.readLine());
                } catch (Exception e) {
                    throw new RuntimeException();
                }
            }
            return st.nextToken();
        }

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

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

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

        char nextChar() {
            return next().charAt(0);
        }

        String nextLine() {
            st = null;
            try {
                return br.readLine();
            } catch (Exception e) {
                throw new RuntimeException();
            }
        }

        boolean endLine() {
            try {
                String next = br.readLine();
                while (next != null && next.trim().isEmpty()) {
                    next = br.readLine();
                }
                if (next == null) {
                    return true;
                }
                st = new StringTokenizer(next);
                return st.hasMoreTokens();
            } catch (Exception e) {
                throw new RuntimeException();
            }
        }

        int[] nextIntArray(int n) {
            int[] a = new int[n];
            for (int i = 0; i < n; i++)
                a[i] = nextInt();
            return a;
        }

        long[] nextLongArray(int n) {
            long[] a = new long[n];
            for (int i = 0; i < n; i++)
                a[i] = nextLong();
            return a;
        }

        int[][] next2DInt(int n, int m) {
            int[][] arr = new int[n][];
            for (int i = 0; i < n; i++) {
                arr[i] = nextIntArray(m);
            }
            return arr;
        }

        long[][] next2DLong(int n, int m) {
            long[][] arr = new long[n][];
            for (int i = 0; i < n; i++) {
                arr[i] = nextLongArray(m);
            }
            return arr;
        }

        int[] shuffle(int[] arr) {
            Random r = new Random();
            for (int i = 1, j; i < arr.length; i++) {
                j = r.nextInt(i);
                arr[i] = arr[i] ^ arr[j];
                arr[j] = arr[i] ^ arr[j];
                arr[i] = arr[i] ^ arr[j];
            }
            return arr;
        }

        int[] uniq(int[] arr) {
            Arrays.sort(arr);
            int[] rv = new int[arr.length];
            int pos = 0;
            rv[pos++] = arr[0];
            for (int i = 1; i < arr.length; i++) {
                if (arr[i] != arr[i - 1]) {
                    rv[pos++] = arr[i];
                }
            }
            return Arrays.copyOf(rv, pos);
        }

    }

}
