import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.math.BigInteger;
import java.util.*;
 
public class Main {
 
    void solve() throws IOException {
        long N = nl();
        long ans = 10;
        for (long i = 1; i*i <= N; i++) {
            if(N%i==0){
                // System.out.println(i);
                // System.out.println(dc(i));
                ans = Math.min(ans,Math.max(dc(i), dc(N/i)));
            }
        }
        out.println(ans);
    }
    int dc(long d){
        int res = 0;
        for (int i = 0; i < 10; i++) {
            if(Math.pow(10,i) <= d) res = i+1;
        }
        return res;
    }
    final int mod = 1000000007;
    final BigInteger MOD = BigInteger.valueOf(mod);
    int upperBound(ArrayList<Long> list, Long target){
        int i = Collections.binarySearch(list, target, new UpperBoundComparator<Long>());
        return ~i;
    }
    class UpperBoundComparator<T extends Comparable<? super T>> implements Comparator<T>{
        public int compare(T x, T y){
            return (x.compareTo(y) > 0) ? 1 : -1;
        }
    }
    int lowerBound(ArrayList<Long> list, Long target){
        int i = Collections.binarySearch(list, target, new LowerBoundComparator<Long>());
        return ~i;
    }
    class LowerBoundComparator<T extends Comparable<? super T>> implements Comparator<T>{
        public int compare(T x, T y){
            return (x.compareTo(y) >= 0) ? 1 : -1;
        }
    }
    int mul(int x, int y){
        int val = (int)((x * 1L * y) % mod);
        return val>=0 ? val : val+mod;
    }
    int add(int x, int y) {
        x += y;
        if(x < 0) x += mod;
        if(x>=mod) x -= mod;
        return x;
    }
    int sub(int x, int y){
        x = add(x,mod-y);
        if(x < 0) x += mod;
        if(x>=mod) x -= mod;
        return x;
    }
    String ns() throws IOException {
        while (!tok.hasMoreTokens()) {
            tok = new StringTokenizer(in.readLine(), " ");
        }
        return tok.nextToken();
    }
 
    int ni() throws IOException {
        return Integer.parseInt(ns());
    }
 
    long nl() throws IOException {
        return Long.parseLong(ns());
    }
 
    double nd() throws IOException {
        return Double.parseDouble(ns());
    }
 
    String[] nsa(int n) throws IOException {
        String[] res = new String[n];
        for (int i = 0; i < n; i++) {
            res[i] = ns();
        }
        return res;
    }
 
    int[] nia(int n) throws IOException {
        int[] res = new int[n];
        for (int i = 0; i < n; i++) {
            res[i] = ni();
        }
        return res;
    }
 
    long[] nla(int n) throws IOException {
        long[] res = new long[n];
        for (int i = 0; i < n; i++) {
            res[i] = nl();
        }
        return res;
    }
 
    static BufferedReader in;
    static PrintWriter out;
    static StringTokenizer tok;
 
    public static void main(String[] args) throws IOException {
        in = new BufferedReader(new InputStreamReader(System.in));
        out = new PrintWriter(System.out);
        tok = new StringTokenizer("");
        Main main = new Main();
        main.solve();
        out.close();
    }
} import java.io.BufferedReader; BufferedReader java.io import java.io.IOException; IOException java.io import java.io.InputStreamReader; InputStreamReader java.io import java.io.PrintWriter; PrintWriter java.io import java.math.BigInteger; BigInteger java.math import java.util.*; util.* java public class Main {
 
    void solve() throws IOException {
        long N = nl();
        long ans = 10;
        for (long i = 1; i*i <= N; i++) {
            if(N%i==0){
                // System.out.println(i);
                // System.out.println(dc(i));
                ans = Math.min(ans,Math.max(dc(i), dc(N/i)));
            }
        }
        out.println(ans);
    }
    int dc(long d){
        int res = 0;
        for (int i = 0; i < 10; i++) {
            if(Math.pow(10,i) <= d) res = i+1;
        }
        return res;
    }
    final int mod = 1000000007;
    final BigInteger MOD = BigInteger.valueOf(mod);
    int upperBound(ArrayList<Long> list, Long target){
        int i = Collections.binarySearch(list, target, new UpperBoundComparator<Long>());
        return ~i;
    }
    class UpperBoundComparator<T extends Comparable<? super T>> implements Comparator<T>{
        public int compare(T x, T y){
            return (x.compareTo(y) > 0) ? 1 : -1;
        }
    }
    int lowerBound(ArrayList<Long> list, Long target){
        int i = Collections.binarySearch(list, target, new LowerBoundComparator<Long>());
        return ~i;
    }
    class LowerBoundComparator<T extends Comparable<? super T>> implements Comparator<T>{
        public int compare(T x, T y){
            return (x.compareTo(y) >= 0) ? 1 : -1;
        }
    }
    int mul(int x, int y){
        int val = (int)((x * 1L * y) % mod);
        return val>=0 ? val : val+mod;
    }
    int add(int x, int y) {
        x += y;
        if(x < 0) x += mod;
        if(x>=mod) x -= mod;
        return x;
    }
    int sub(int x, int y){
        x = add(x,mod-y);
        if(x < 0) x += mod;
        if(x>=mod) x -= mod;
        return x;
    }
    String ns() throws IOException {
        while (!tok.hasMoreTokens()) {
            tok = new StringTokenizer(in.readLine(), " ");
        }
        return tok.nextToken();
    }
 
    int ni() throws IOException {
        return Integer.parseInt(ns());
    }
 
    long nl() throws IOException {
        return Long.parseLong(ns());
    }
 
    double nd() throws IOException {
        return Double.parseDouble(ns());
    }
 
    String[] nsa(int n) throws IOException {
        String[] res = new String[n];
        for (int i = 0; i < n; i++) {
            res[i] = ns();
        }
        return res;
    }
 
    int[] nia(int n) throws IOException {
        int[] res = new int[n];
        for (int i = 0; i < n; i++) {
            res[i] = ni();
        }
        return res;
    }
 
    long[] nla(int n) throws IOException {
        long[] res = new long[n];
        for (int i = 0; i < n; i++) {
            res[i] = nl();
        }
        return res;
    }
 
    static BufferedReader in;
    static PrintWriter out;
    static StringTokenizer tok;
 
    public static void main(String[] args) throws IOException {
        in = new BufferedReader(new InputStreamReader(System.in));
        out = new PrintWriter(System.out);
        tok = new StringTokenizer("");
        Main main = new Main();
        main.solve();
        out.close();
    }
} Main final int mod = 1000000007; mod 1000000007 final BigInteger MOD = BigInteger.valueOf(mod); MOD BigInteger.valueOf(mod) BigInteger.valueOf BigInteger mod static BufferedReader in; in static PrintWriter out; out static StringTokenizer tok; tok void solve() throws IOException {
        long N = nl();
        long ans = 10;
        for (long i = 1; i*i <= N; i++) {
            if(N%i==0){
                // System.out.println(i);
                // System.out.println(dc(i));
                ans = Math.min(ans,Math.max(dc(i), dc(N/i)));
            }
        }
        out.println(ans);
    } solve {
        long N = nl();
        long ans = 10;
        for (long i = 1; i*i <= N; i++) {
            if(N%i==0){
                // System.out.println(i);
                // System.out.println(dc(i));
                ans = Math.min(ans,Math.max(dc(i), dc(N/i)));
            }
        }
        out.println(ans);
    } long N = nl(); N nl() nl long ans = 10; ans 10 for (long i = 1; i*i <= N; i++) {
            if(N%i==0){
                // System.out.println(i);
                // System.out.println(dc(i));
                ans = Math.min(ans,Math.max(dc(i), dc(N/i)));
            }
        } long i = 1; long i = 1; i 1 i*i <= N i*i i i N i++ i++ i {
            if(N%i==0){
                // System.out.println(i);
                // System.out.println(dc(i));
                ans = Math.min(ans,Math.max(dc(i), dc(N/i)));
            }
        } {
            if(N%i==0){
                // System.out.println(i);
                // System.out.println(dc(i));
                ans = Math.min(ans,Math.max(dc(i), dc(N/i)));
            }
        } if(N%i==0){
                // System.out.println(i);
                // System.out.println(dc(i));
                ans = Math.min(ans,Math.max(dc(i), dc(N/i)));
            } N%i==0 N%i N i 0 {
                // System.out.println(i);
                // System.out.println(dc(i));
                ans = Math.min(ans,Math.max(dc(i), dc(N/i)));
            } ans = Math.min(ans,Math.max(dc(i), dc(N/i))) ans Math.min(ans,Math.max(dc(i), dc(N/i))) Math.min Math ans Math.max(dc(i), dc(N/i)) Math.max Math dc(i) dc i dc(N/i) dc N/i N i out.println(ans) out.println out ans int dc(long d){
        int res = 0;
        for (int i = 0; i < 10; i++) {
            if(Math.pow(10,i) <= d) res = i+1;
        }
        return res;
    } dc {
        int res = 0;
        for (int i = 0; i < 10; i++) {
            if(Math.pow(10,i) <= d) res = i+1;
        }
        return res;
    } int res = 0; res 0 for (int i = 0; i < 10; i++) {
            if(Math.pow(10,i) <= d) res = i+1;
        } int i = 0; int i = 0; i 0 i < 10 i 10 i++ i++ i {
            if(Math.pow(10,i) <= d) res = i+1;
        } {
            if(Math.pow(10,i) <= d) res = i+1;
        } if(Math.pow(10,i) <= d) res = i+1; Math.pow(10,i) <= d Math.pow(10,i) Math.pow Math 10 i d res = i+1 res i+1 i 1 return res; res long d d int upperBound(ArrayList<Long> list, Long target){
        int i = Collections.binarySearch(list, target, new UpperBoundComparator<Long>());
        return ~i;
    } upperBound {
        int i = Collections.binarySearch(list, target, new UpperBoundComparator<Long>());
        return ~i;
    } int i = Collections.binarySearch(list, target, new UpperBoundComparator<Long>()); i Collections.binarySearch(list, target, new UpperBoundComparator<Long>()) Collections.binarySearch Collections list target new UpperBoundComparator<Long>() return ~i; ~i i ArrayList<Long> list list Long target target int lowerBound(ArrayList<Long> list, Long target){
        int i = Collections.binarySearch(list, target, new LowerBoundComparator<Long>());
        return ~i;
    } lowerBound {
        int i = Collections.binarySearch(list, target, new LowerBoundComparator<Long>());
        return ~i;
    } int i = Collections.binarySearch(list, target, new LowerBoundComparator<Long>()); i Collections.binarySearch(list, target, new LowerBoundComparator<Long>()) Collections.binarySearch Collections list target new LowerBoundComparator<Long>() return ~i; ~i i ArrayList<Long> list list Long target target int mul(int x, int y){
        int val = (int)((x * 1L * y) % mod);
        return val>=0 ? val : val+mod;
    } mul {
        int val = (int)((x * 1L * y) % mod);
        return val>=0 ? val : val+mod;
    } int val = (int)((x * 1L * y) % mod); val (int)((x * 1L * y) % mod) (x * 1L * y) x * 1L * y x 1L y mod return val>=0 ? val : val+mod; val>=0 ? val : val+mod val>=0 val 0 val val+mod val mod int x x int y y int add(int x, int y) {
        x += y;
        if(x < 0) x += mod;
        if(x>=mod) x -= mod;
        return x;
    } add {
        x += y;
        if(x < 0) x += mod;
        if(x>=mod) x -= mod;
        return x;
    } x += y x y if(x < 0) x += mod; x < 0 x 0 x += mod x mod if(x>=mod) x -= mod; x>=mod x mod x -= mod x mod return x; x int x x int y y int sub(int x, int y){
        x = add(x,mod-y);
        if(x < 0) x += mod;
        if(x>=mod) x -= mod;
        return x;
    } sub {
        x = add(x,mod-y);
        if(x < 0) x += mod;
        if(x>=mod) x -= mod;
        return x;
    } x = add(x,mod-y) x add(x,mod-y) add x mod-y mod y if(x < 0) x += mod; x < 0 x 0 x += mod x mod if(x>=mod) x -= mod; x>=mod x mod x -= mod x mod return x; x int x x int y y String ns() throws IOException {
        while (!tok.hasMoreTokens()) {
            tok = new StringTokenizer(in.readLine(), " ");
        }
        return tok.nextToken();
    } ns {
        while (!tok.hasMoreTokens()) {
            tok = new StringTokenizer(in.readLine(), " ");
        }
        return tok.nextToken();
    } while (!tok.hasMoreTokens()) {
            tok = new StringTokenizer(in.readLine(), " ");
        } !tok.hasMoreTokens() tok.hasMoreTokens() tok.hasMoreTokens tok {
            tok = new StringTokenizer(in.readLine(), " ");
        } tok = new StringTokenizer(in.readLine(), " ") tok new StringTokenizer(in.readLine(), " ") return tok.nextToken(); tok.nextToken() tok.nextToken tok int ni() throws IOException {
        return Integer.parseInt(ns());
    } ni {
        return Integer.parseInt(ns());
    } return Integer.parseInt(ns()); Integer.parseInt(ns()) Integer.parseInt Integer ns() ns long nl() throws IOException {
        return Long.parseLong(ns());
    } nl {
        return Long.parseLong(ns());
    } return Long.parseLong(ns()); Long.parseLong(ns()) Long.parseLong Long ns() ns double nd() throws IOException {
        return Double.parseDouble(ns());
    } nd {
        return Double.parseDouble(ns());
    } return Double.parseDouble(ns()); Double.parseDouble(ns()) Double.parseDouble Double ns() ns String[] nsa(int n) throws IOException {
        String[] res = new String[n];
        for (int i = 0; i < n; i++) {
            res[i] = ns();
        }
        return res;
    } nsa {
        String[] res = new String[n];
        for (int i = 0; i < n; i++) {
            res[i] = ns();
        }
        return res;
    } String[] res = new String[n]; res new String[n] n for (int i = 0; i < n; i++) {
            res[i] = ns();
        } int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
            res[i] = ns();
        } {
            res[i] = ns();
        } res[i] = ns() res[i] res i ns() ns return res; res int n n int[] nia(int n) throws IOException {
        int[] res = new int[n];
        for (int i = 0; i < n; i++) {
            res[i] = ni();
        }
        return res;
    } nia {
        int[] res = new int[n];
        for (int i = 0; i < n; i++) {
            res[i] = ni();
        }
        return res;
    } int[] res = new int[n]; res new int[n] n for (int i = 0; i < n; i++) {
            res[i] = ni();
        } int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
            res[i] = ni();
        } {
            res[i] = ni();
        } res[i] = ni() res[i] res i ni() ni return res; res int n n long[] nla(int n) throws IOException {
        long[] res = new long[n];
        for (int i = 0; i < n; i++) {
            res[i] = nl();
        }
        return res;
    } nla {
        long[] res = new long[n];
        for (int i = 0; i < n; i++) {
            res[i] = nl();
        }
        return res;
    } long[] res = new long[n]; res new long[n] n for (int i = 0; i < n; i++) {
            res[i] = nl();
        } int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
            res[i] = nl();
        } {
            res[i] = nl();
        } res[i] = nl() res[i] res i nl() nl return res; res int n n public static void main(String[] args) throws IOException {
        in = new BufferedReader(new InputStreamReader(System.in));
        out = new PrintWriter(System.out);
        tok = new StringTokenizer("");
        Main main = new Main();
        main.solve();
        out.close();
    } main {
        in = new BufferedReader(new InputStreamReader(System.in));
        out = new PrintWriter(System.out);
        tok = new StringTokenizer("");
        Main main = new Main();
        main.solve();
        out.close();
    } in = new BufferedReader(new InputStreamReader(System.in)) in new BufferedReader(new InputStreamReader(System.in)) out = new PrintWriter(System.out) out new PrintWriter(System.out) tok = new StringTokenizer("") tok new StringTokenizer("") Main main = new Main(); main new Main() main.solve() main.solve main out.close() out.close out String[] args args class UpperBoundComparator<T extends Comparable<? super T>> implements Comparator<T>{
        public int compare(T x, T y){
            return (x.compareTo(y) > 0) ? 1 : -1;
        }
    } UpperBoundComparator public int compare(T x, T y){
            return (x.compareTo(y) > 0) ? 1 : -1;
        } compare {
            return (x.compareTo(y) > 0) ? 1 : -1;
        } return (x.compareTo(y) > 0) ? 1 : -1; (x.compareTo(y) > 0) ? 1 : -1 (x.compareTo(y) > 0) x.compareTo(y) x.compareTo x y 0 1 -1 1 T x x T y y Comparator class LowerBoundComparator<T extends Comparable<? super T>> implements Comparator<T>{
        public int compare(T x, T y){
            return (x.compareTo(y) >= 0) ? 1 : -1;
        }
    } LowerBoundComparator public int compare(T x, T y){
            return (x.compareTo(y) >= 0) ? 1 : -1;
        } compare {
            return (x.compareTo(y) >= 0) ? 1 : -1;
        } return (x.compareTo(y) >= 0) ? 1 : -1; (x.compareTo(y) >= 0) ? 1 : -1 (x.compareTo(y) >= 0) x.compareTo(y) x.compareTo x y 0 1 -1 1 T x x T y y Comparator public class Main {
 
    void solve() throws IOException {
        long N = nl();
        long ans = 10;
        for (long i = 1; i*i <= N; i++) {
            if(N%i==0){
                // System.out.println(i);
                // System.out.println(dc(i));
                ans = Math.min(ans,Math.max(dc(i), dc(N/i)));
            }
        }
        out.println(ans);
    }
    int dc(long d){
        int res = 0;
        for (int i = 0; i < 10; i++) {
            if(Math.pow(10,i) <= d) res = i+1;
        }
        return res;
    }
    final int mod = 1000000007;
    final BigInteger MOD = BigInteger.valueOf(mod);
    int upperBound(ArrayList<Long> list, Long target){
        int i = Collections.binarySearch(list, target, new UpperBoundComparator<Long>());
        return ~i;
    }
    class UpperBoundComparator<T extends Comparable<? super T>> implements Comparator<T>{
        public int compare(T x, T y){
            return (x.compareTo(y) > 0) ? 1 : -1;
        }
    }
    int lowerBound(ArrayList<Long> list, Long target){
        int i = Collections.binarySearch(list, target, new LowerBoundComparator<Long>());
        return ~i;
    }
    class LowerBoundComparator<T extends Comparable<? super T>> implements Comparator<T>{
        public int compare(T x, T y){
            return (x.compareTo(y) >= 0) ? 1 : -1;
        }
    }
    int mul(int x, int y){
        int val = (int)((x * 1L * y) % mod);
        return val>=0 ? val : val+mod;
    }
    int add(int x, int y) {
        x += y;
        if(x < 0) x += mod;
        if(x>=mod) x -= mod;
        return x;
    }
    int sub(int x, int y){
        x = add(x,mod-y);
        if(x < 0) x += mod;
        if(x>=mod) x -= mod;
        return x;
    }
    String ns() throws IOException {
        while (!tok.hasMoreTokens()) {
            tok = new StringTokenizer(in.readLine(), " ");
        }
        return tok.nextToken();
    }
 
    int ni() throws IOException {
        return Integer.parseInt(ns());
    }
 
    long nl() throws IOException {
        return Long.parseLong(ns());
    }
 
    double nd() throws IOException {
        return Double.parseDouble(ns());
    }
 
    String[] nsa(int n) throws IOException {
        String[] res = new String[n];
        for (int i = 0; i < n; i++) {
            res[i] = ns();
        }
        return res;
    }
 
    int[] nia(int n) throws IOException {
        int[] res = new int[n];
        for (int i = 0; i < n; i++) {
            res[i] = ni();
        }
        return res;
    }
 
    long[] nla(int n) throws IOException {
        long[] res = new long[n];
        for (int i = 0; i < n; i++) {
            res[i] = nl();
        }
        return res;
    }
 
    static BufferedReader in;
    static PrintWriter out;
    static StringTokenizer tok;
 
    public static void main(String[] args) throws IOException {
        in = new BufferedReader(new InputStreamReader(System.in));
        out = new PrintWriter(System.out);
        tok = new StringTokenizer("");
        Main main = new Main();
        main.solve();
        out.close();
    }
} public class Main {
 
    void solve() throws IOException {
        long N = nl();
        long ans = 10;
        for (long i = 1; i*i <= N; i++) {
            if(N%i==0){
                // System.out.println(i);
                // System.out.println(dc(i));
                ans = Math.min(ans,Math.max(dc(i), dc(N/i)));
            }
        }
        out.println(ans);
    }
    int dc(long d){
        int res = 0;
        for (int i = 0; i < 10; i++) {
            if(Math.pow(10,i) <= d) res = i+1;
        }
        return res;
    }
    final int mod = 1000000007;
    final BigInteger MOD = BigInteger.valueOf(mod);
    int upperBound(ArrayList<Long> list, Long target){
        int i = Collections.binarySearch(list, target, new UpperBoundComparator<Long>());
        return ~i;
    }
    class UpperBoundComparator<T extends Comparable<? super T>> implements Comparator<T>{
        public int compare(T x, T y){
            return (x.compareTo(y) > 0) ? 1 : -1;
        }
    }
    int lowerBound(ArrayList<Long> list, Long target){
        int i = Collections.binarySearch(list, target, new LowerBoundComparator<Long>());
        return ~i;
    }
    class LowerBoundComparator<T extends Comparable<? super T>> implements Comparator<T>{
        public int compare(T x, T y){
            return (x.compareTo(y) >= 0) ? 1 : -1;
        }
    }
    int mul(int x, int y){
        int val = (int)((x * 1L * y) % mod);
        return val>=0 ? val : val+mod;
    }
    int add(int x, int y) {
        x += y;
        if(x < 0) x += mod;
        if(x>=mod) x -= mod;
        return x;
    }
    int sub(int x, int y){
        x = add(x,mod-y);
        if(x < 0) x += mod;
        if(x>=mod) x -= mod;
        return x;
    }
    String ns() throws IOException {
        while (!tok.hasMoreTokens()) {
            tok = new StringTokenizer(in.readLine(), " ");
        }
        return tok.nextToken();
    }
 
    int ni() throws IOException {
        return Integer.parseInt(ns());
    }
 
    long nl() throws IOException {
        return Long.parseLong(ns());
    }
 
    double nd() throws IOException {
        return Double.parseDouble(ns());
    }
 
    String[] nsa(int n) throws IOException {
        String[] res = new String[n];
        for (int i = 0; i < n; i++) {
            res[i] = ns();
        }
        return res;
    }
 
    int[] nia(int n) throws IOException {
        int[] res = new int[n];
        for (int i = 0; i < n; i++) {
            res[i] = ni();
        }
        return res;
    }
 
    long[] nla(int n) throws IOException {
        long[] res = new long[n];
        for (int i = 0; i < n; i++) {
            res[i] = nl();
        }
        return res;
    }
 
    static BufferedReader in;
    static PrintWriter out;
    static StringTokenizer tok;
 
    public static void main(String[] args) throws IOException {
        in = new BufferedReader(new InputStreamReader(System.in));
        out = new PrintWriter(System.out);
        tok = new StringTokenizer("");
        Main main = new Main();
        main.solve();
        out.close();
    }
} Main
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.math.BigInteger;
import java.util.*;
 
public class Main {
 
    void solve() throws IOException {
        long N = nl();
        long ans = 10;
        for (long i = 1; i*i <= N; i++) {
            if(N%i==0){
                // System.out.println(i);
                // System.out.println(dc(i));
                ans = Math.min(ans,Math.max(dc(i), dc(N/i)));
            }
        }
        out.println(ans);
    }
    int dc(long d){
        int res = 0;
        for (int i = 0; i < 10; i++) {
            if(Math.pow(10,i) <= d) res = i+1;
        }
        return res;
    }
    final int mod = 1000000007;
    final BigInteger MOD = BigInteger.valueOf(mod);
    int upperBound(ArrayList<Long> list, Long target){
        int i = Collections.binarySearch(list, target, new UpperBoundComparator<Long>());
        return ~i;
    }
    class UpperBoundComparator<T extends Comparable<? super T>> implements Comparator<T>{
        public int compare(T x, T y){
            return (x.compareTo(y) > 0) ? 1 : -1;
        }
    }
    int lowerBound(ArrayList<Long> list, Long target){
        int i = Collections.binarySearch(list, target, new LowerBoundComparator<Long>());
        return ~i;
    }
    class LowerBoundComparator<T extends Comparable<? super T>> implements Comparator<T>{
        public int compare(T x, T y){
            return (x.compareTo(y) >= 0) ? 1 : -1;
        }
    }
    int mul(int x, int y){
        int val = (int)((x * 1L * y) % mod);
        return val>=0 ? val : val+mod;
    }
    int add(int x, int y) {
        x += y;
        if(x < 0) x += mod;
        if(x>=mod) x -= mod;
        return x;
    }
    int sub(int x, int y){
        x = add(x,mod-y);
        if(x < 0) x += mod;
        if(x>=mod) x -= mod;
        return x;
    }
    String ns() throws IOException {
        while (!tok.hasMoreTokens()) {
            tok = new StringTokenizer(in.readLine(), " ");
        }
        return tok.nextToken();
    }
 
    int ni() throws IOException {
        return Integer.parseInt(ns());
    }
 
    long nl() throws IOException {
        return Long.parseLong(ns());
    }
 
    double nd() throws IOException {
        return Double.parseDouble(ns());
    }
 
    String[] nsa(int n) throws IOException {
        String[] res = new String[n];
        for (int i = 0; i < n; i++) {
            res[i] = ns();
        }
        return res;
    }
 
    int[] nia(int n) throws IOException {
        int[] res = new int[n];
        for (int i = 0; i < n; i++) {
            res[i] = ni();
        }
        return res;
    }
 
    long[] nla(int n) throws IOException {
        long[] res = new long[n];
        for (int i = 0; i < n; i++) {
            res[i] = nl();
        }
        return res;
    }
 
    static BufferedReader in;
    static PrintWriter out;
    static StringTokenizer tok;
 
    public static void main(String[] args) throws IOException {
        in = new BufferedReader(new InputStreamReader(System.in));
        out = new PrintWriter(System.out);
        tok = new StringTokenizer("");
        Main main = new Main();
        main.solve();
        out.close();
    }
}