import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.StringTokenizer;
import java.io.IOException;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        InputReader in = new InputReader(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        TaskB solver = new TaskB();
        solver.solve(1, in, out);
        out.close();
    }

    static class TaskB {
        long[] equivalence_relations;
        int[][] bc;

        public void solve(int testNumber, InputReader in, PrintWriter out) {
            int N = in.nextInt();
            int MOD = 1000000007;

            long ans = 0;
            compute_equivalence_relations(N, MOD);
            compute_binomial_coefficients(N, MOD);
            for (int m = 0; m < N; m++) {
                ans = (ans + equivalence_relations[m] * bc[N][N - m]) % MOD;
            }

            out.println(ans);
        }

        private void compute_binomial_coefficients(int N, int MOD) {
            bc = new int[N + 1][N + 1];
            for (int n = 1; n <= N; n++) {
                for (int k = 0; k <= n; k++) {
                    if (k == 0) bc[n][k] = 1;
                    else if (n == k) bc[n][k] = 1;
                    else bc[n][k] = (bc[n - 1][k - 1] + bc[n - 1][k]) % MOD;
                }
            }
        }

        private void compute_equivalence_relations(int N, int MOD) {
            long dp[][] = new long[N + 1][N + 1];

            dp[0][0] = 1;

            for (int elems = 1; elems <= N; elems++) {
                for (int classes = 1; classes <= elems; classes++) {
                    dp[elems][classes] = (long) (classes) * dp[elems - 1][classes] + dp[elems - 1][classes - 1];
                    dp[elems][classes] = dp[elems][classes] % MOD;
                }
            }

            equivalence_relations = new long[N + 1];

            for (int i = 0; i <= N; i++) {
                long tmp = 0;
                for (int j = 0; j <= i; j++) {
                    tmp = (tmp + dp[i][j]) % MOD;
                }
                equivalence_relations[i] = tmp;
            }
        }

    }

    static class InputReader {
        public BufferedReader reader;
        public StringTokenizer tokenizer;

        public InputReader(InputStream stream) {
            reader = new BufferedReader(new InputStreamReader(stream), 32768);
            tokenizer = null;
        }

        public String next() {
            while (tokenizer == null || !tokenizer.hasMoreTokens()) {
                try {
                    tokenizer = new StringTokenizer(reader.readLine());
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            }
            return tokenizer.nextToken();
        }

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

    }
}


import java.util.*;
public class A1186{
	public static void main(String[] args) {
		Scanner in = new Scanner(System.in);
		int a = in.nextInt(), b = in.nextInt(), c = in.nextInt();
		if(a <=b && a<=c)
			System.out.print("Yes");
		else
			System.out.print("No");
	}
}


import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.util.StringTokenizer;

public class Codeforces {
  public static void main(String[] args) {
    CustomInputReader in = new CustomInputReader(System.in);
    TaskB solver = new TaskB();
    solver.solve(in);
  }
}

class TaskB {
  public void solve(CustomInputReader in) {
    long w = in.nextLong(), m = in.nextLong(), k = in.nextLong();
    long t = 1, ans = 0;
    w /= k;
    int length = 0;
    while (t < m) {
      length++;
      t *= 10;
    }
    while (w >= (t - m) * length) {
      w -= (t - m) * length;
      ans += t - m;
      m = t;
      t *= 10;
      length++;
    }
    ans += w / length;
    System.out.println(ans);
  }
}

class CustomInputReader {
  public BufferedReader reader;
  public StringTokenizer tokenizer;

  public CustomInputReader(InputStream stream) {
    reader = new BufferedReader(new InputStreamReader(stream));
    tokenizer = null;
  }

  public String next() {
    while (tokenizer == null || !tokenizer.hasMoreTokens()) {
      try {
        tokenizer = new StringTokenizer(reader.readLine());
      } catch (IOException e) {
        throw new RuntimeException(e);
      }
    }
    return tokenizer.nextToken();
  }

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

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


import java.util.Scanner;

public class Problem765C {

    public static void main(String[] args) {

        Scanner in = new Scanner(System.in);

        int k = in.nextInt();

        int a = in.nextInt();
        int b = in.nextInt();

        if (a > b)
        {
            int temp = a;
            a = b;
            b = temp;
        }
        if (a < k && b < k)
        {
            System.out.println(-1);
            return;
        }
        if (a < k && b % k != 0)
        {
            System.out.println(-1);
            return;
        }
        if (a % k != 0) {
            a -= (a % k);
        }
        if (b % k != 0) {
            b -= (b % k);
        }
        int m = (a+b)/k;
        System.out.println(m);
    }
}


import java.util.ArrayList;
import java.util.Scanner;

public class Vacation {
    static int daysCount;
    static ArrayList<Integer> vacations = new ArrayList<>();
    static int[][] memoize;

    public static void main(String[] args) {
        Scanner s = new Scanner(System.in);
        daysCount = s.nextInt();
        for (int i = 0; i < daysCount; i++) {
            vacations.add(s.nextInt());
        }
        memoize = new int[daysCount][100];
        for (int i = 0; i < daysCount; i++) {
            for (int j = 0; j < 100; j++) {
                memoize[i][j] = -1;
            }
        }
        System.out.println(getMinimumVacationDays(0, 4));

    }

    private static int getMinimumVacationDays(int currentDayIndex, int previousDayActivity) {
        if (currentDayIndex == daysCount)
            return 0;

        if (memoize[currentDayIndex][previousDayActivity] != -1)
            return memoize[currentDayIndex][previousDayActivity];
        int currentDayActivity = vacations.get(currentDayIndex);
        if (currentDayActivity == 0) {
            return memoize[currentDayIndex][previousDayActivity] = 1 + getMinimumVacationDays(currentDayIndex + 1, 0);
        }
        if (currentDayActivity == 1) {
            int dayWithRest = 1 + getMinimumVacationDays(currentDayIndex + 1, 'R');
            int dayWithContest = Integer.MAX_VALUE;
            if (previousDayActivity != 'C') {
                dayWithContest = getMinimumVacationDays(currentDayIndex + 1, 'C');
            }
            return memoize[currentDayIndex][previousDayActivity] = Math.min(dayWithRest, dayWithContest);
        }
        if (currentDayActivity == 2) {
            int dayWithRest = 1 + getMinimumVacationDays(currentDayIndex + 1, 'R');
            int dayWithGym = Integer.MAX_VALUE;
            if (previousDayActivity != 'G') {
                dayWithGym = getMinimumVacationDays(currentDayIndex + 1, 'G');
            }
            return memoize[currentDayIndex][previousDayActivity] = Math.min(dayWithRest, dayWithGym);
        }
        int dayWithRest = 1 + getMinimumVacationDays(currentDayIndex + 1, 'R');
        int dayWithContest = Integer.MAX_VALUE;
        int dayWithGym = Integer.MAX_VALUE;
        if (previousDayActivity != 'C') {
            dayWithContest = getMinimumVacationDays(currentDayIndex + 1, 'C');
        }
        if (previousDayActivity != 'G') {
            dayWithGym = getMinimumVacationDays(currentDayIndex + 1, 'G');
        }
        return memoize[currentDayIndex][previousDayActivity] = Math.min(dayWithRest, Math.min(dayWithContest, dayWithGym));

    }
}


/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 *
 * @author YaSeR
 */
import java.util.Scanner;
public class Football1 {
    public static void main(String[] args) {
        Scanner cs = new Scanner(System.in);
        String line = cs.next();
        if(line.contains("1111111") || line.contains("0000000"))
        {
            System.out.println("YES");
        }
 else
        {
            System.out.println("NO");
 }
    }
}


import java.io.*;
import java.math.*;
import java.util.*;
import java.util.Arrays;
public class Test1{
    public static void main(String args[])throws IOException{
        Scanner sc=new Scanner(System.in);
        String s[]=new String[3];
        s[0]=sc.next();
        s[1]=sc.next();
        s[2]=sc.next();
        Arrays.sort(s);
        char n1=s[0].charAt(0),n2=s[1].charAt(0),n3=s[2].charAt(0);
        char c1=s[0].charAt(1),c2=s[1].charAt(1),c3=s[2].charAt(1);
        if(c1!=c2 && c2!=c3 && c3!=c1)
        System.out.println("2");
        else if(n1==n2 && n2==n3 && c1==c2 && c2==c3)
        System.out.println("0");
        else if(c1==c2 && c2==c3 && n2==(n1+1) && n3==(n2+1))
        System.out.println("0");
        else if((c1==c2 && n1==n2) || (c2==c3 && n2==n3) || (c1==c3 && n1==n3) || (c1==c2 && n2==n1+1) || (c2==c3 && n3==n2+1) || (c1==c3 && n3==n1+2))
        System.out.println("1");
        else if((c1==c2 && n2==n1+2) || (c2==c3 && n3==n2+2) || (c1==c3 && n3==n1+1))
        System.out.println("1");
        else
        System.out.println("2");
    }
}
// || (c1==c2 && n2==n1+1) || (c2==c3 && n3==n2+1) || (c1==c3 && n3==n1+2)


    import java.util.*;
    import java.io.*;

    public class Codeforces {

        public static void main(String[] args) throws IOException {
            Reader.init(System.in);

            long a = Reader.nextLong();
            long b = Reader.nextLong();
            gcd(Math.max(a, b), Math.min(a, b));
            System.out.println(count);
        }

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

    }

    class  Pair implements Comparable<Pair>{

        int id;
        int freq;
        int x;

        Pair(int a, int b){
            id = a;
            x = b;
        }

        @Override
        public int compareTo(Pair t) {
            int a = t.freq - freq;

            if(a == 0)
                return x - t.x;
            return a;
        }
    }

    class Reader {

        static BufferedReader reader;
        static StringTokenizer tokenizer;

        public static int pars(String x) {
            int num = 0;
            int i = 0;
            if (x.charAt(0) == '-') {
                i = 1;
            }
            for (; i < x.length(); i++) {
                num = num * 10 + (x.charAt(i) - '0');
            }

            if (x.charAt(0) == '-') {
                return -num;
            }

            return num;
        }

        static void init(InputStream input) {
            reader = new BufferedReader(
                    new InputStreamReader(input));
            tokenizer = new StringTokenizer("");
        }

        static void init(FileReader input) {
            reader = new BufferedReader(input);
            tokenizer = new StringTokenizer("");
        }

        static String next() throws IOException {
            while (!tokenizer.hasMoreTokens()) {
                tokenizer = new StringTokenizer(
                        reader.readLine());
            }
            return tokenizer.nextToken();
        }

        static int nextInt() throws IOException {
            return pars(next());
        }

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

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


import java.io.BufferedOutputStream;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.OutputStream;
import java.io.OutputStreamWriter;
import java.io.PrintWriter;
import java.io.Reader;
import java.io.UnsupportedEncodingException;
import java.io.Writer;
import java.text.DecimalFormat;
import java.util.StringTokenizer;

public class B implements Runnable {
    private final static long START_TIME=System.currentTimeMillis();
    private final static boolean LOG_ENABLED=true;
    private final static boolean ONLINE_JUDGE = LOG_ENABLED && (System.getProperty("ONLINE_JUDGE") != null);
    private final static String SYSTEM_ENCODING="utf-8";
    private final static int DEFAULT_BUFFER_SIZE=100000;

    private static class Logger{
        private final PrintWriter logWriter=Util.newPrintWriter(System.err,true);
        private final DecimalFormat df=new DecimalFormat("0.000");
        private void message(String type, String message, Object ... params){
            if(ONLINE_JUDGE){
                return;
            }
            logWriter.printf("["+type+"] "+df.format((System.currentTimeMillis()-START_TIME)/1000.0)+": "+message+"\r\n", params);
        }
        public void debug(String message, Object ... params){
            message("DEBUG", message, params);
        }
    }

    public final static class Util{
        public final static String LINE_SEPARATOR=System.getProperty("line.separator");
        public static PrintWriter newPrintWriter(OutputStream out, boolean autoFlush){
            try {
                return new PrintWriter(new OutputStreamWriter(new BufferedOutputStream(out), SYSTEM_ENCODING),autoFlush);
            } catch (UnsupportedEncodingException e) {
                throw new IllegalStateException(e);
            }
        }

        public static PrintWriter newPrintWriter(Writer writer, boolean autoFlush){
            return new PrintWriter(writer,autoFlush);
        }

        private static void flushStringBuilder(Writer writer, StringBuilder sb) throws IOException {
            if(sb.length()>DEFAULT_BUFFER_SIZE){
                writer.append(sb);
                sb.setLength(0);
            }
        }

        public static void printArray(Writer writer, Object ... elements) throws IOException{
            StringBuilder sb = new StringBuilder();
            boolean first=true;
            for(Object o:elements){
                if(first){
                    first=false;
                }else{
                    sb.append(" ");
                }
                sb.append(o);
                flushStringBuilder(writer, sb);
            }
            sb.append(LINE_SEPARATOR);
            writer.append(sb);
        }
        public static void printArray(Writer writer, int ... elements) throws IOException{
            StringBuilder sb = new StringBuilder();
            boolean first=true;
            for(Object o:elements){
                if(first){
                    first=false;
                }else{
                    sb.append(" ");
                }
                sb.append(o);
                flushStringBuilder(writer, sb);
            }
            sb.append(LINE_SEPARATOR);
            writer.append(sb);
        }

    }

    public final static class FastScanner{
        private BufferedReader reader;
        private StringTokenizer currentTokenizer;
        public FastScanner(Reader reader) {
            if(reader instanceof BufferedReader){
                this.reader=(BufferedReader) reader;
            }else{
                this.reader=new BufferedReader(reader);
            }
        }

        public String next(){
            if(currentTokenizer==null || !currentTokenizer.hasMoreTokens()){
                try {
                    currentTokenizer=new  StringTokenizer(reader.readLine());
                } catch (IOException e) {
                    throw new IllegalStateException(e);
                }
            }

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

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

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

    }

    private final static Logger log=new Logger();
    private final BufferedReader reader;
    private final FastScanner in;
    private final PrintWriter out;

    public B(Reader reader, Writer writer){
        this.reader=new BufferedReader(reader);
        this.out=new PrintWriter(writer,false);
        in=new FastScanner(this.reader);
    }

    public static void main(String[] args) throws IOException {
        new B(new InputStreamReader(System.in, SYSTEM_ENCODING),new OutputStreamWriter(new BufferedOutputStream(System.out), SYSTEM_ENCODING)).run();
    }

    public void run(){
        log.debug("Started");
        try{
            solve();
            out.flush();
        }finally{
            log.debug("Stopped");
        }
    }

    private void solve(){
        int mx = in.nextInt();
        int my = in.nextInt();
        int px = in.nextInt();
        int py = in.nextInt();
        int p;
        int q;
        if(1.0*mx/my>1.0*px/py){
            p=mx*py-px*my;
            q=mx*py;
        }else{
            p=my*px-py*mx;
            q=my*px;
        }
        int nod = findNode(p,q);
        out.println(p/nod+"/"+q/nod);
    }
    static int findNode(int a, int b){
        int maxNod = Math.min(a, b);
        if(maxNod==0){
            return Math.max(a, b);
        }
        for(int nod=2;nod<=maxNod; nod++){
            if((a%nod==0)&& (b%nod)==0){
                return nod*findNode(a/nod, b/nod);
            }
        }
        return 1;
    }

}


import java.util.*;
import java.lang.*;
public class Main
{
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int f = sc.nextInt();
		int r = sc.nextInt();
		int c = sc.nextInt();
		int min = Math.min(f/3,Math.min(r/2,c/2));
		int x = 0;
		if(min==f/3){
		    x = f/3;
		    f = f - 3*x;
		    r = r - 2*x;
		    c = c - 2*x;
		}
		else if(min==r/2){
		    x = r/2;
		    r = r - x*2;
		    f = f - 3*x;
		    c = c - 2*x;
		}
		else{
		    x = c/2;
		    c = c - x*2;
		    f = f - 3*x;
		    r = r - 2*x;
		}
		if(f>3) f = 3;
		if(r>2) r = 2;
		if(c>2) c = 2;
		int ans = x*7;

		int max = 0;
        int s[]={1,2,3,1,3,2,1};
        for(int i=0;i<7;i++){
            int f1 = f;
            int r1 = r;
            int c1 = c;
            int co = 0;
            for(int j=i;j<7;j++){
                if(s[j]==1){
                    f1--;
                    co++;
                    if(f1<0) break;
                }
                if(s[j]==2){
                    r1--;
                    co++;
                    if(r1<0) break;
                }
                if(s[j]==3){
                    c1--;
                    co++;
                    if(c1<0) break;
                }
                if(j==6) j=-1;
            }
            max = Math.max(max,co);
        }
        ans = ans+max;
        System.out.println(ans-1);
	}
}


public class MainD {
	MyScanner sc = new MyScanner();

	void run() {
		long n = sc.nextLong();
		long m = sc.nextLong();
		long k = sc.nextLong();
		long right = Long.MAX_VALUE;
		long left = 0;
		while (right - left > 1) {
			long mid = (left + right) / 2;
			long cnt = 0;
			long w = m;
			for (int i = 1; i <= n; i++) {
				while (w != 0 && w * i > mid) {
					w--;
				}
				cnt += w;
			}
			if (cnt < k) {
				left = mid;
			} else {
				right = mid;
			}
		}
		System.out.println(right);
	}

	public static void main(String[] args) {
		new MainD().run();
	}

	class MyScanner {
		int nextInt() {
			try {
				int c = System.in.read();
				while (c != '-' && (c < '0' || '9' < c))
					c = System.in.read();
				if (c == '-')
					return -nextInt();
				int res = 0;
				do {
					res *= 10;
					res += c - '0';
					c = System.in.read();
				} while ('0' <= c && c <= '9');
				return res;
			} catch (Exception e) {
				return -1;
			}
		}

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

		String next() {
			try {
				StringBuilder res = new StringBuilder("");
				int c = System.in.read();
				while (Character.isWhitespace(c))
					c = System.in.read();
				do {
					res.append((char) c);
				} while (!Character.isWhitespace(c = System.in.read()));
				return res.toString();
			} catch (Exception e) {
				return null;
			}
		}

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


import java.util.*;

public class bullCow
{

    static int [] countN(int a)
    {
        String s = Integer.toString(a);
        if(s.length() < 4)
            s = "0000".substring(0,4-s.length()) + s;
        int [] count = new int[10];
        for(int i=0;i<s.length();i++)
            count[s.charAt(i) - '0']++;
        return count;
    }
    static boolean check(int a)
    {
        int [] count = countN(a);
        for(int i: count)
            if(i>1)
                return false;
        return true;
    }

    static boolean match(int m, int [] guess)
    {
        int arr[][] = new int[2][4];
        int nn[] = {m, guess[0]};
        for(int i=0;i<2;i++)
        {
            int a = nn[i];
            for(int j=0;j<4;j++)
            {
                arr[i][j] = a%10;
                a/=10;
            }
        }
        int cows = 0, bulls = 0;
        for(int i=0;i<4;i++)
            for(int j=0;j<4;j++)
                if(arr[0][i] == arr[1][j])
                    if(i == j)
                        bulls++;
                    else
                        cows++;
        return (guess[1] == bulls && guess[2] == cows);
    }

    public static void main(String [] args)
    {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int [][] guess = new int[n][3];
        for(int i=0;i<n;i++)
            for(int j=0;j<3;j++)
                guess[i][j] = sc.nextInt();
        ArrayList<Integer> matches = new ArrayList<Integer>();
        for(int i=100;i<10000;i++)
        {
            if(!check(i))
                continue;
            boolean ok = true;
            for(int j=0;j<n;j++)
                if(!match(i,guess[j]))
                {
                    ok = false;
                    break;
                }
            if(ok)
                matches.add(i);
        }
        if(matches.size() > 1)
            System.out.println("Need more data");
        else
            if(matches.size() == 0)
                System.out.println("Incorrect data");
            else
            {
                String ans = Integer.toString(matches.get(0));
                if(ans.length() < 4)
                    ans = "0000".substring(0,4-ans.length()) + ans;
                System.out.println(ans);
            }
    }
}


import java.io.*;
import java.util.ArrayList;
import java.util.StringTokenizer;

/**
 *
 * @author arif_
 * @date
 * @algo
 * @difficulty
 */
public class CF_876C {
    /* START OF I/O ROUTINE */
    // PrintWriter for faster output
    public static PrintWriter out;

    // MyInputReader class for faster input
    public static class MyInputReader {
        BufferedReader br;
        StringTokenizer st;

        public MyInputReader(InputStream stream) {
            br = new BufferedReader(new InputStreamReader(stream), 32768);
        }

        String next() {
            while (st == null || !st.hasMoreElements()) {
                try {
                    st = new StringTokenizer(br.readLine());
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
            return st.nextToken();
        }

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

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

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

        String nextLine(){
            String str = "";
            try {
                str = br.readLine();
            } catch (IOException e) {
                e.printStackTrace();
            }
            return str;
        }
    } // end of class MyInputReader
    /* END OF I/O ROUTINE */

    public static void main(String[] args) {
        MyInputReader in = new MyInputReader(System.in);
        out = new PrintWriter(new BufferedOutputStream(System.out));

        int n = in.nextInt();

        ArrayList<Integer> ans = new ArrayList<Integer>();
        for (int i=81; i>=1; i--) {
            if (i >= n) continue;

            int x = n - i;
            int sum = 0, y = x;
            while (y > 0) {
                sum += (y % 10);
                y /= 10;
            }

            if (sum+x == n) ans.add(x);
        }

        out.println(ans.size());
        for (Integer a : ans) {
            out.println(a);
        }
        out.close();
    } // end of method main()
} // end of class Main


import java.util.*;
import java.io.*;
import java.math.BigInteger;

public class A {

	static Scanner s = new Scanner(System.in);

	public static void main(String[] args) {

		try (BufferedReader reader = new BufferedReader(new InputStreamReader(System.in))) {

			int n = Integer.parseInt(reader.readLine());
			int m = Integer.parseInt(reader.readLine());

			long ans = 0;
			if(n >= m) ans = m;
			else ans = m % getDeg(m, n);

			System.out.println(ans);

		} catch(IOException e) {
		}

	}

	static long getDeg(int num, int n) {
		long ans = 1;

		for(int i = 0; i < n && ans <= 100_000_000; i++) {
			ans += ans;
		}
		return ans;
	}

}


import java.io.*;
import java.util.*;

public class A {
    FScanner in = new FScanner();
    PrintWriter out = new PrintWriter(new BufferedOutputStream(System.out), true);

    void run() {
        int n = in.nextInt();
        int[] a = new int[n];
        for (int i = 0; i < n; i++) {
            int x = in.nextInt();
            a[i] = x;
        }
        out.print(a[0] % 2 != 0 && a[n - 1] % 2 != 0 && n % 2 == 1 ?
                "Yes" :
                "No");
        out.close();
    }

    public static void main(String[] args) {
        new A().run();
    }

    static class FScanner {
        BufferedReader br;
        StringTokenizer st;

        FScanner() {
            br = new BufferedReader(new InputStreamReader(System.in));
        }

        String next() {
            while (st == null || !st.hasMoreElements()) {
                try {
                    st = new StringTokenizer(br.readLine());
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
            return st.nextToken();
        }

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

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

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

        String nextLine() {
            String str = "";
            try {
                str = br.readLine();
            } catch (IOException e) {
                e.printStackTrace();
            }
            return str;
        }

        char[][] nextCharArray(int n, int m) {
            char[][] g = new char[n][m];
            for (int i = 0; i < n; i++)
                g[i] = next().toCharArray();
            return g;
        }

        double[] nextDoubleArray(int n) {
            double[] a = new double[n];
            for (int i = 0; i < n; i++)
                a[i] = nextDouble();
            return a;
        }

        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;
        }
    }
}


import java.io.*;
import java.util.*;
public class timePass {
	public static void main(String[] args) {
		Scanner s = new Scanner(System.in);
		int a = s.nextInt();int b = s.nextInt();int x=0,y=0,z=0;
		for(int i=1;i<7;i++){
			if(Math.abs(a-i)<Math.abs(b-i)){
				x++;
			}
			if(Math.abs(a-i)==Math.abs(b-i)){
				y++;
			}
			if(Math.abs(a-i)>Math.abs(b-i)){
				z++;
			}
		}
		System.out.println(x+" "+y+" "+z);
	}
}


import java.util.*;
public class A
{
    public static void main(String[] args)
    {
        int n,m;
        Scanner s = new Scanner(System.in);
        n = s.nextInt();
        m = s.nextInt();
        int a[] = new int[n];
        int b[] = new int[m];
        for(int i = 0 ; i < n ; i++)
        {
            a[i] = s.nextInt();
        }
        for(int j = 0 ; j < m ; j++)
        {
            b[j] = s.nextInt();
        }
        for(int i1 = 0 ; i1 < n ; i1++)
        {
            for(int j1 = 0 ; j1 < m ; j1++)
            {
                if(a[i1] == b[j1])
                {
                    System.out.print(a[i1] + " ");
                }
            }
        }
    }
}


import java.util.*;
import java.io.*;
import java.math.*;
import java.text.*;
public class Main
{
  static FastScanner in = new FastScanner(System.in);
  static StringBuilder sb = new StringBuilder();
  static DecimalFormat df = new DecimalFormat();
  static HashMap lookUp = new HashMap();
  public static int previousA = 0;
  public static void main(String[] args)
  {
    df.setMaximumFractionDigits(20);
    df.setMinimumFractionDigits(20);
    // String formatted = df.format(0.2);
    // Never sort array of primitive type
    // System.out.print(sb.toString());
    int number1 = Integer.parseInt(in.nextToken());
    int number2 = Integer.parseInt(in.nextToken());
    System.out.println(greed(number1, number2));
  }

  static int greed(int a, int b){
    int i = 0;
    if(a>b){
      return a-b;
    }
    while(b>a){
      if(b==a){
        return i;
      }
      if(b%2==0){
        b/=2;
        i++;
        continue;
      }
      else {
        b++;
        i++;
        continue;
      }
    }

  return a-b+i;
  }

  static int closester(int a, int b){
    if(a>=b){
      return a-b;
    }
    boolean bEven = false;
    if(b % 2 == 0){
      bEven = true;
    }
    else{
      bEven = false;
      b+=1;
    }
    int targetAbove = b;
    int targetBelow = 0;
    int i = 0;
    while(targetAbove > a && targetAbove % 2 == 0){
      targetAbove /= 2;
      i++;
    }
    i--;
    targetBelow = targetAbove;
    targetAbove *= 2;
    int below = naive(a, targetBelow, 0);
    lookUp = new HashMap();
    int above = naive(a, targetAbove, 0);
    // int smaller = Math.min(below, above);
    // if(above > below+1){
    //   i--;
    // }
    int smaller = above;
    if(bEven){
      return smaller + i;
    }
    else{
      return smaller + i + 1;
    }
  }

  static int naive(int a, int b, int c){
    // System.out.println("a: "+a);
    if(a == 0)
      return Integer.MAX_VALUE;
    if(a>=b){
      return a-b+c;
    }
    // if(lookUp.keySet().contains(a)){
    //   if(lookUp.keySet())
    // }
    c++;
    int minus = Integer.MAX_VALUE;
    int times = Integer.MAX_VALUE;
    lookUp.put(a,c);
    previousA = a;
    if(!lookUp.keySet().contains(a*2)){
      times = naive(a*2,b,c);
    }
    else{
      if(c<(int)lookUp.get(a*2)){
        lookUp.put(a*2,c);
        times = naive(a*2,b,c);
      }
        if(previousA == b/2){
        return times;
      }
    }

    if(!lookUp.keySet().contains(a-1)){
      minus = naive(a-1,b,c);
    }
    else{
      if(c<(int)lookUp.get(a-1)){
        lookUp.put(a-1,c);
        minus = naive(a-1,b,c);
      }
    }
    return Math.min(minus, times);
  }

  static BigInteger b(long n) { return BigInteger.valueOf(n);}
  static BigInteger b(String s) { return new BigInteger(s); }
  static BigDecimal bd(double d) { return BigDecimal.valueOf(d);}
  static BigDecimal bd(String s) { return new BigDecimal(s); }
}
class FastScanner
{
  BufferedReader reader;
  StringTokenizer tokenizer;
  FastScanner (InputStream inputStream)
  {
    reader = new BufferedReader(new InputStreamReader(inputStream));
  }
  String nextToken()
  {
    while (tokenizer == null || ! tokenizer.hasMoreTokens())
    {
      try {
        tokenizer = new StringTokenizer(reader.readLine());
      } catch (Exception e){}
    }
    return tokenizer.nextToken();
  }
  boolean hasNext()
  {
    if (tokenizer == null || ! tokenizer.hasMoreTokens())
    {
      try {
        tokenizer = new StringTokenizer(reader.readLine());
      } catch (Exception e){ return false; }
    }
    return true;
  }
  int nextInt()
  {
    return Integer.parseInt(nextToken());
  }
}


import java.util.*;

public class C915 {
	@SuppressWarnings("unused")

	public static void main(String args[]){
		@SuppressWarnings("resource")
		Scanner sc = new Scanner(System.in);

		int n=sc.nextInt();
		HashMap<Integer,String> map= new HashMap<Integer,String>();
		/*
		for(int i=1;i<=2500;i++){
		    int a = i;
		    while(a!=0){
		        int t = a%2;
		        a=a/2;
		        sb.append(t);
		    }
		    sb = sb.reverse();
		    map.put(i,sb.toString());

		}*/
		HashSet<String> set = new HashSet<String>();
		int cnt=0;
		for(int i=1;i<=n;i++){
		    for(int j=i+1;j<=n;j++){
		        int temp=(i^j);
		        if( temp  > 1  && temp <= n  &&  i+j>temp  &&  j+temp>i  && temp+i>j  &&  temp>j){
		            cnt++;

		        }
		    }
		}
		System.out.println(cnt);

	}

}


import java.io.*;
import java.util.Arrays;
import java.util.HashSet;
import java.util.Set;
import java.util.StringTokenizer;

/**
 * Created by peacefrog on 2/10/16.
 * 12:12 PM
 */
public class CF {
    final boolean ONLINE_JUDGE = System.getProperty("ONLINE_JUDGE") != null;
    PrintWriter out;
    long timeBegin, timeEnd;

    public void runIO() throws IOException {
        timeBegin = System.currentTimeMillis();

        InputStream inputStream;
        OutputStream outputStream;

        if (ONLINE_JUDGE) {
            inputStream = System.in;
            Reader.init(inputStream);
            outputStream = System.out;

            out = new PrintWriter(outputStream);
        } else {
            inputStream = new FileInputStream("/home/peacefrog/Dropbox/IdeaProjects/Problem Solving/input");
            Reader.init(inputStream);
            out = new PrintWriter(System.out);
        }
        solve();
        out.flush();
        out.close();
        timeEnd = System.currentTimeMillis();
        System.err.println("Time = " + (timeEnd - timeBegin));
    }

	/*
     * Start Solution Here
	 */

    private void solve() throws IOException {
        int n = Reader.nextInt() ;
        long[] arr = Reader.nextLongArray(n);
        long cnt = 0 ;
        Set<Long> taken = new HashSet<>();
        Arrays.sort(arr);

        for (int i = n-1; i >= 0; i--) {
            if(!taken.contains(arr[i])){
                taken.add(arr[i]);
                cnt+=arr[i];
            }
            else{
                long temp = arr[i];
                while (--temp>0)
                {
                    if(!taken.contains(temp)){
                        taken.add(temp);
                        cnt+=temp;
                        break;
                    }
                }
            }
        }

        out.println(cnt);
    }

    public static void main(String[] args) throws IOException {
        new CF().runIO();
    }

    static class Reader {
        static BufferedReader reader;
        static StringTokenizer tokenizer;

        /**
         * call this method to initialize reader for InputStream
         */
        static void init(InputStream input) {
            reader = new BufferedReader(new InputStreamReader(input));
            tokenizer = new StringTokenizer("");
        }

        /**
         * get next word
         */
        static String next() {
            while (tokenizer == null || !tokenizer.hasMoreTokens()) {
                try {
                    tokenizer = new StringTokenizer(reader.readLine());
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            }
            return tokenizer.nextToken();
        }

        static String nextLine() {
            try {
                return reader.readLine();
            } catch (IOException e) {
                e.printStackTrace();
            }
            return "";
        }

        static int nextChar() throws IOException {
            return reader.read();
        }

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

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

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

        static long[] nextLongArray(int n) throws IOException {
            long[] arr = new long[n];
            for (int i = 0; i < n; i++) {
                arr[i] = nextLong();
            }

            return arr;
        }

        static int[] nextIntArray(int n) throws IOException {
            int[] arr = new int[n];
            for (int i = 0; i < n; i++) {
                arr[i] = nextInt();
            }
            return arr;
        }
    }
}


import java.io.IOException;

public class Main {
	String readLine () { //no buffer-size needed
		StringBuilder s = new StringBuilder();
		int car;
		boolean nochars = true;
		try {
			while(true) {
				car = System.in.read();
				if (car < 0 || car == '\n') break;
				else if(car != '\r') {
					s.append((char) car);
					nochars = false;
				}
			}
		} catch (IOException e) { return null; }

		if (car < 0 && nochars) return null;
		return s.toString();
	}

	public static void main(String[] args){
		new Main().begin();
	}

	public void begin(){
		String input = readLine();
		System.out.println(input.replaceAll("(http|ftp)(\\w+?)ru(\\w*)", "$1://$2.ru/$3").replaceAll("/$", ""));
	}
}


import java.util.Scanner;

/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 *
 * @author ayushgrg
 */
public class compgcd {
    public static void main(String[] args){
        Scanner std = new Scanner(System.in);
        String a = std.next();
        String b = std.next();
        if(a.equals(b)){
            System.out.println(""+a);

        }
        else{
            System.out.println("1");

        }
    }
}


import java.io.*;

public class System_of_equation {

	public static void main(String[] args) throws Exception {
		// TODO Auto-generated method stub
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		String s[] = br.readLine().split(" ");
		int n = Integer.parseInt(s[0]);
		int m = Integer.parseInt(s[1]);
		int count = 0;
		for (int a = 0; a <= n; a++) {
			for (int b = 0; b <= m; b++) {
				if (a * a + b == n && a + b * b == m)
					count++;
			}

		}
		System.out.println(count);

	}

}


import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.math.BigInteger;

public class _486A_CalculatingFunction {

	public static void main(String[] args) throws IOException {
		// TODO Auto-generated method stub
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		BigInteger n = new BigInteger(br.readLine());

		if (n.remainder(new BigInteger("2")).equals(new BigInteger("0"))) {
			System.out.println(n.divide(new BigInteger("2")));
		} else {
			System.out.println(n.divide(new BigInteger("2")).add(new BigInteger("1")).multiply(new BigInteger("-1")));
		}

		br.close();
	}

}


import java.io.*;
import java.util.*;

public class Main {

	public static void main(String[] args) throws Throwable
	{
		BufferedReader in = new BufferedReader( new InputStreamReader( System.in ) );
		StringBuilder sb = new StringBuilder( );
		for ( String line; ( line =  in.readLine( ) )!=null; ) {
			StringTokenizer st = new StringTokenizer(line);
			String s1 = st.nextToken( );
			String s2 = st.nextToken( );
			int large = Integer.MIN_VALUE;
			for(int i=0; i<=1000; i++){
				int c1=-1;int c2=-1;
				try {c1 = Integer.parseInt(s1,i);} catch (Exception e) {}
				try {c2 = Integer.parseInt(s2,i);} catch (Exception e) {}
				if(c1!=-1 && c2 != -1) {
					String sum = fromDecimal2((c1+c2), i);
					if(sum.length()>large)
						large = sum.length();
				}
			}
			sb.append(large+"\n");
		}
		System.out.print(new String(sb));
	}

	public static String fromDecimal2(int n, int b)
	{
		String chars="0123456789ABCDEFGHIJ";
		String result="";

		while(n>0)
		{
			result=chars.charAt(n%b) + result;
			n/=b;
		}

		return result;
	}
}


import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.io.FilterInputStream;
import java.io.BufferedInputStream;
import java.io.InputStream;

/**
 * @author khokharnikunj8
 */

public class Main {
    public static void main(String[] args) {
        new Thread(null, new Runnable() {
            public void run() {
                new Main().solve();
            }
        }, "1", 1 << 26).start();
    }

    void solve() {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        ScanReader in = new ScanReader(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        DFelicitysBigSecretRevealed solver = new DFelicitysBigSecretRevealed();
        solver.solve(1, in, out);
        out.close();
    }

    static class DFelicitysBigSecretRevealed {
        int mod = 1000000007;

        public void solve(int testNumber, ScanReader in, PrintWriter out) {
            int n = in.scanInt();
            char[] ar = in.scanChars(n);
            int[][] dp = new int[n + 1][1 << 20];
            long ans = 0;
            int[][] value = new int[n + 1][n + 1];
            for (int i = 0; i <= n; i++) {
                int x = 0;
                for (int j = i; j <= n; j++) {
                    value[i][j] = x;
                    if (j == n) break;
                    x = x * 2 + (ar[j] - '0');
                    x = Math.min(x, 21);
                }
            }
            for (int i = 0; i < n; i++) {
                dp[i][0]++;
                for (int j = 0; j < (1 << 20); j++) {
                    if (dp[i][j] == 0) continue;
                    for (int k = i + 1; k <= n && value[i][k] <= 20; k++) {
                        if (value[i][k] != 0) {
                            dp[k][(j | (1 << (value[i][k] - 1)))] = (dp[k][(j | (1 << (value[i][k] - 1)))] + dp[i][j]);
                            if (dp[k][(j | (1 << (value[i][k] - 1)))] >= mod)
                                dp[k][(j | (1 << (value[i][k] - 1)))] -= mod;

                        }
                    }
                }
                for (int j = 1; j <= 20; j++) {
                    ans = (ans + dp[i + 1][(1 << j) - 1]);
                    if (ans >= mod) ans -= mod;
                }
            }
            out.println(ans);

        }

    }

    static class ScanReader {
        private byte[] buf = new byte[4 * 1024];
        private int index;
        private BufferedInputStream in;
        private int total;

        public ScanReader(InputStream inputStream) {
            in = new BufferedInputStream(inputStream);
        }

        private int scan() {
            if (index >= total) {
                index = 0;
                try {
                    total = in.read(buf);
                } catch (Exception e) {
                    e.printStackTrace();
                }
                if (total <= 0) return -1;
            }
            return buf[index++];
        }

        public int scanInt() {
            int integer = 0;
            int n = scan();
            while (isWhiteSpace(n)) n = scan();
            int neg = 1;
            if (n == '-') {
                neg = -1;
                n = scan();
            }
            while (!isWhiteSpace(n)) {
                if (n >= '0' && n <= '9') {
                    integer *= 10;
                    integer += n - '0';
                    n = scan();
                }
            }
            return neg * integer;
        }

        public char[] scanChars(int n) {
            char[] ar = new char[n];
            int c = scan();
            boolean flag = true;
            while (isWhiteSpace(c)) c = scan();
            ar[0] = (char) c;
            for (int i = 1; i < n; i++) ar[i] = (char) (c = scan());
            return ar;
        }

        private boolean isWhiteSpace(int n) {
            if (n == ' ' || n == '\n' || n == '\r' || n == '\t' || n == -1) return true;
            else return false;
        }

    }
}


import java.util.Scanner;

public class CodeforcesProblems {

	public static void main(String[] arg){
		Scanner sIn = new Scanner(System.in);
		int count = sIn.nextInt();
		String str = sIn.next();

		char[] chars = str.toCharArray();

		int changeBits = 0;
		for (int i = 0; i < count; i++){
			chars[i] += 1;
			changeBits++;
			if (chars[i] == '1'){
				break;
			}
		}
		System.out.println(changeBits);
	}
}


import java.util.Scanner;

public class Factorization {
	public static boolean check(int n){
		if(n<=2) return true;
		boolean checkif = true;
		for(int i=2;i<Math.sqrt(n)+1;i++){
			if(n%i==0) return false;
		}
		return checkif;
	}
	public static void findFactorization(int n,int k){
		if(k==1){
			System.out.println(n);
			return;
		}
		if(check(n)&&k!=1){
			System.out.println(-1);
			return;
		}
		int[] result = new int[k];
		int count = 0;
		while(!check(n)){
//			System.out.println("hi");
			for(int i=2;i<=Math.sqrt(n)+1;i++){
				if(n%i==0&&(result[k-1]==0)){
					result[count] = i;
					n = n/i;
					count += 1;
//					System.out.println(n+"hi");
					break;
				}
				if(n%i==0&&result[k-1]!=0){
//					System.out.println(i+"  "+result[k-1]);
					result[k-1] *= i;
					n = n/i;
//					System.out.println(n+"  hi");
					break;
				}
			}

		}
		result[k-1]*=n;
		if(result[k-2]!=0&&result[k-1]==0) result[k-1] = n;
		if(result[k-1]==0){System.out.println(-1);}
		else{
			for(int j=0;j<result.length;j++)
			System.out.print(result[j]+"  ");
		}

	}
	public static void main(String[] agrs){
		Scanner input = new Scanner(System.in);
		int n = input.nextInt();
		int k = input.nextInt();
		input.close();
		findFactorization(n, k);
	}
}


import java.util.*;
public class P_122A {
	public static void main(String[] args)
	{
		Scanner in = new Scanner(System.in);
		int N = in.nextInt();

		boolean ans = false;
		int[] check = {4, 7, 44, 47, 74, 77, 444, 447, 474, 477, 744, 747, 774, 777};
		for (int i = 0; i < check.length; ++i)
			if (N%check[i] == 0) ans = true;

		System.out.println(ans ? "YES" : "NO");
	}
}


/*
If you want to aim high, aim high
Don't let that studying and grades consume you
Just live life young
******************************
What do you think? What do you think?
1st on Billboard, what do you think of it
Next is a Grammy, what do you think of it
However you think, I’m sorry, but shit, I have no fucking interest
*******************************
Higher, higher, even higher, to the point you won’t even be able to see me
https://www.a2oj.com/Ladder16.html
*******************************
300IQ as writer = Sad!
*/
import java.util.*;
import java.io.*;
import java.math.*;

   public class D
   {
      static long MOD = 1000000007L;
      public static void main(String omkar[]) throws Exception
      {
         BufferedReader infile = new BufferedReader(new InputStreamReader(System.in));
         StringTokenizer st = new StringTokenizer(infile.readLine());
         N = Integer.parseInt(st.nextToken());
         N <<= 1;
         dp = new long[N+1][N/2+1][2];
         for(int i=0; i <= N; i++)
            for(int a=0; a <= N/2; a++)
               Arrays.fill(dp[i][a], -1);
         System.out.println(dfs(0, 0, 0));
      }
      static int N;
      static long[][][] dp;
      public static long dfs(int len, int bal, int take)
      {
         if(len > N || bal > N/2)
            return 0L;
         else if(len > N/2 && bal > N-len)
            return 0L;
         if(dp[len][bal][take] != -1)
            return dp[len][bal][take];
         long res = 0L;
         if(take == 1)
         {
            if(bal > 0)
               res += dfs(len+1, bal-1, 0);
            if(bal < N/2)
            {
               res += dfs(len+1, bal+1, 0);
               if(res >= MOD) res -= MOD;
            }
         }
         else
         {
            if(bal == 0)
               res = 1+dfs(len+1, bal+1, 1);
            else if(bal == N/2 || (len > N/2 && bal == N-len))
               res = 1+dfs(len+1, bal-1, 1);
            else
            {
               res = 1+dfs(len+1, bal+1, 1)+dfs(len+1, bal-1, 0);
               if(res >= MOD) res -= MOD;
               long temp = 1+dfs(len+1, bal+1, 0)+dfs(len+1, bal-1, 1);
               if(temp >= MOD) temp -= MOD;
               res = Math.max(res, temp);
            }
         }
         if(len == N)
            res = 0;
         return dp[len][bal][take] = res;
      }
   }


import java.util.*;
import java.io.*;
import java.lang.*;

public class A411 {

  public static void main(String[] args) {

    String p;

    Boolean l,u,d;
    l = false; u = false; d = false;

    Scanner s = new Scanner(System.in);
    p = s.next();

    for(int i=0; i<p.length(); i++){
      if(p.charAt(i) >= 'a' && p.charAt(i) <= 'z')
        l = true;
      if(p.charAt(i) >= 'A' && p.charAt(i) <= 'Z')
        u = true;
      if(p.charAt(i) >= '0' && p.charAt(i) <= '9')
        d = true;
    }

    if(l && u && d && p.length() > 4)
      System.out.println("Correct");
    else
      System.out.println("Too weak");
  }
}


import java.util.Scanner;

public class MyClass {

    static int c, d, n, m, k, commonParty, must;

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);

        c = sc.nextInt();
        d = sc.nextInt();
        n = sc.nextInt();
        m = sc.nextInt();
        k = sc.nextInt();
        commonParty = n * m;
        must = commonParty - k;

        if (must > 0) {

            int algC = algC();
            int algD = algD();

            int algJoint = algC - c;
            int partyCMinusRound = (algJoint / c) * n;

            int i = (must - partyCMinusRound);
            while (i > 0) {
                i -= 1;
                algJoint += d;
            }

            System.out.println(min(algC, algD, algJoint));
        } else {
            System.out.println(0);
        }

    }

    public static int algC() {
        int tempCommonParty = must;
        int sumTask = 0;
        while (tempCommonParty > 0) {
            tempCommonParty -= n;
            sumTask += c;
        }
        return sumTask;
    }

    public static int algD() {
        int tempCommonParty = must;
        int sumTask = 0;
        while (tempCommonParty > 0) {
            tempCommonParty -= 1;
            sumTask += d;
        }
        return sumTask;
    }

    public static int algFull() {
        //int tempCommonParty = must;
        int algC = algC();
        int algD = algD();

        int sumTask = algC - n;
        int partyCMinusRound = algC * (n - 1);

        int i = (must - partyCMinusRound);
        while (i > 0) {
            i -= 1;
            sumTask += d;
        }

        return min(algC, algD, sumTask);
    }

    public static int min(int... numbers) {
        int minNumber = Integer.MAX_VALUE;

        for (int number : numbers) {
            minNumber = (number < minNumber) ? number : minNumber;
        }

        return minNumber;
    }
}


import java.io.*;
import java.util.*;

public class A {
    public static void solution(BufferedReader reader, PrintWriter out)
            throws IOException {
        In in = new In(reader);
        int n = in.nextInt();
        long max = 1;
        for (int a = Math.max(1, n - 100); a <= n; a++)
            for (int b = Math.max(1, n - 100); b <= n; b++)
                for (int c = Math.max(1, n - 100); c <= n; c++)
                    max = Math.max(max, lcm(a, lcm(b, c)));
        out.println(max);
    }

    private static long lcm(long a, long b) {
        long gcd = gcd(a, b);
        return a / gcd * b;
    }

    private static long gcd(long a, long b) {
        while (b != 0) {
            long t = b;
            b = a % b;
            a = t;
        }
        return a;
    }

    public static void main(String[] args) throws Exception {
        BufferedReader reader = new BufferedReader(
                new InputStreamReader(System.in));
        PrintWriter out = new PrintWriter(
                new BufferedWriter(new OutputStreamWriter(System.out)));
        solution(reader, out);
        out.close();
    }

    protected static class In {
        private BufferedReader reader;
        private StringTokenizer tokenizer = new StringTokenizer("");

        public In(BufferedReader reader) {
            this.reader = reader;
        }

        public String next() throws IOException {
            while (!tokenizer.hasMoreTokens())
                tokenizer = new StringTokenizer(reader.readLine());
            return tokenizer.nextToken();
        }

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

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

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


import java.util.Arrays;
import java.util.Scanner;

public class Main {
	MyScanner sc = new MyScanner();
	Scanner sc2 = new Scanner(System.in);
	final int MOD = 1000000007;
	int[] dx = { 1, 0, 0, -1 };
	int[] dy = { 0, 1, -1, 0 };

	void run() {
		int n = sc.nextInt();
		int m = sc.nextInt();

		int day = 1;
		while (true) {
			n--;
			if (day % m == 0) {
				n++;
			}
			if (n == 0) {
				break;
			}
			day++;
		}
		System.out.println(day);
	}

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

	void debug(Object... o) {
		System.out.println(Arrays.deepToString(o));
	}

	void debug2(int[][] array) {
		for (int i = 0; i < array.length; i++) {
			for (int j = 0; j < array[i].length; j++) {
				System.out.print(array[i][j]);
			}
			System.out.println();
		}
	}

	class MyScanner {
		int nextInt() {
			try {
				int c = System.in.read();
				while (c != '-' && (c < '0' || '9' < c))
					c = System.in.read();
				if (c == '-')
					return -nextInt();
				int res = 0;
				do {
					res *= 10;
					res += c - '0';
					c = System.in.read();
				} while ('0' <= c && c <= '9');
				return res;
			} catch (Exception e) {
				return -1;
			}
		}

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

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

		String next() {
			try {
				StringBuilder res = new StringBuilder("");
				int c = System.in.read();
				while (Character.isWhitespace(c))
					c = System.in.read();
				do {
					res.append((char) c);
				} while (!Character.isWhitespace(c = System.in.read()));
				return res.toString();
			} catch (Exception e) {
				return null;
			}
		}
	}
}


import java.io.InputStreamReader;
import java.io.IOException;
import java.util.InputMismatchException;
import java.io.BufferedReader;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.io.Reader;
import java.io.Writer;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 * @author Nipuna Samarasekara
 */
public class Main {
	public static void main(String[] args) {
		InputStream inputStream = System.in;
		OutputStream outputStream = System.out;
		FastScanner in = new FastScanner(inputStream);
		FastPrinter out = new FastPrinter(outputStream);
		TaskA solver = new TaskA();
		solver.solve(1, in, out);
		out.close();
	}
}

class TaskA {
    public void solve(int testNumber, FastScanner in, FastPrinter out) {
        int n=in.nextInt(),m=in.nextInt(),i=in.nextInt(),j=in.nextInt(),a=in.nextInt(),b=in.nextInt();
          int[] D= new int[2];
        int[] P= new int[2];
      int i1=0,i2=0,ans=100000000,v1=0,v2=0;
        v1=Math.max((i-1)/a,(n-i)/a);
        v2=Math.max((j-1)/b,(m-j)/b);
        if((i-1)%a==0){D[i1]=(i-1)/a; i1++;}
        if((n-i)%a==0){D[i1]=(n-i)/a; i1++;}
        if((j-1)%b==0){P[i2]=(j-1)/b; i2++;}
        if((m-j)%b==0){P[i2]=(m-j)/b; i2++;}
        for (int k = 0; k < i1; k++) {
            for (int l = 0; l < i2; l++) {
                if((D[k]-P[l])%2==0){
                    if(D[k]==P[l])
                    ans= Math.min(ans,Math.max(D[k],P[l]));
                    else if(D[k]>P[l]&&v2>0)  ans= Math.min(ans,Math.max(D[k],P[l]));
                    else if(D[k]<P[l]&&v1>0) ans= Math.min(ans,Math.max(D[k],P[l]));

                }
            }
        }

      if(ans>99999999) out.println("Poor Inna and pony!");
       else out.println(ans);

    }
}

class FastScanner extends BufferedReader {

    public FastScanner(InputStream is) {
        super(new InputStreamReader(is));
    }

    public int read() {
        try {
            int ret = super.read();
//            if (isEOF && ret < 0) {
//                throw new InputMismatchException();
//            }
//            isEOF = ret == -1;
            return ret;
        } catch (IOException e) {
            throw new InputMismatchException();
        }
    }

    static boolean isWhiteSpace(int c) {
        return c >= 0 && c <= 32;
    }

    public int nextInt() {
        int c = read();
        while (isWhiteSpace(c)) {
            c = read();
        }
        int sgn = 1;
        if (c == '-') {
            sgn = -1;
            c = read();
        }
        int ret = 0;
        while (c >= 0 && !isWhiteSpace(c)) {
            if (c < '0' || c > '9') {
                throw new NumberFormatException("digit expected " + (char) c
                        + " found");
            }
            ret = ret * 10 + c - '0';
            c = read();
        }
        return ret * sgn;
    }

    public String readLine() {
        try {
            return super.readLine();
        } catch (IOException e) {
            return null;
        }
    }

    }

class FastPrinter extends PrintWriter {

    public FastPrinter(OutputStream out) {
        super(out);
    }

    public FastPrinter(Writer out) {
        super(out);
    }

}


import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.LinkedList;
import java.util.StringTokenizer;
import java.util.TreeSet;

public class LuckyPermutation {

	static class Scanner{
		BufferedReader br=null;
		StringTokenizer tk=null;
		public Scanner(){
			br=new BufferedReader(new InputStreamReader(System.in));
		}
		public String next() throws IOException{
			while(tk==null || !tk.hasMoreTokens())
				tk=new StringTokenizer(br.readLine());
			return tk.nextToken();
		}
		public int nextInt() throws NumberFormatException, IOException{
			return Integer.valueOf(next());
		}
	}

	static long[] fact = new long[14];
	static TreeSet<Long> set = new TreeSet<Long>();

	static void init(){
		fact[0] = 1;
		for(int i = 1; i <= 13; i++)
			fact[i] = fact[i - 1]*i;
		for(int tam = 1; tam <= 11; tam++){
			for(int i = 0;  i < (1<<tam); i++){
				long num = 0;
				for(int k = tam - 1; k >= 0; k--){
					int n= ( (((i>>k) & 1) == 1)? 7: 4);
					num *= 10;
					num += n;
				}
				set.add(num);
			}
		}
		return;
	}

	public static void main(String args[]) throws NumberFormatException, IOException{
		Scanner sc = new Scanner();
		init();
		int N = sc.nextInt();
		int K = sc.nextInt();
		LinkedList<Integer> ans = new LinkedList<Integer>();
		if (N <= 13 && fact[N] < K){
			System.out.println("-1");
			return;
		}
		int amount = 0;
		long left = 1;
		long right = N - 13;
		for(long lucky: set){
			if (lucky>= left && lucky<=right)
				amount++;
		}
		TreeSet<Integer> current = new TreeSet<Integer>();
		for(int i = Math.max(1, N - 12); i <= N; i++)
			current.add(i);
		int limit = current.size();
		for(int i = 0; i < limit; i++){
			int index = 1;
			for(int e: current){
				if (fact[current.size() - 1]*index >= K){
					K -= fact[current.size() - 1] * (index - 1);
					current.remove(e);
					ans.add(e);
					break;
				}
				index++;
			}
		}
		int pos = Math.max(N - 12,1);
		for(int e: ans){
			if (set.contains(pos + 0L) && set.contains(e + 0L))
				amount++;
			pos++;
		}
		System.out.println(amount);
	}

}


//package solution;

import java.io.BufferedReader;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.StringTokenizer;

public class Solution implements Runnable {

    BufferedReader in;
    PrintWriter out;
    StringTokenizer tok = new StringTokenizer("");
    final boolean OJ = System.getProperty("ONLINE_JUDGE") != null;

    void init() throws FileNotFoundException {
        if (OJ) {
            in = new BufferedReader(new InputStreamReader(System.in));
            out = new PrintWriter(System.out);
        } else {
            in = new BufferedReader(new FileReader("input.txt"));
            out = new PrintWriter("output.txt");
        }

    }

    public void run() {
        try {
            init();
            solve();
            out.close();
        } catch (Exception e) {
            e.printStackTrace();
            System.exit(-1);
        }
    }

    String readString() throws IOException {
        while (!tok.hasMoreTokens()) {
            tok = new StringTokenizer(in.readLine());
        }

        return tok.nextToken();
    }

    int readInt() throws IOException {
        return Integer.parseInt(readString());
    }

    long readLong() throws IOException {
        return Long.parseLong(readString());
    }

    char readChar() throws IOException {
        return readString().charAt(0);
    }

    public static void main(String[] args) {
        new Thread(null, new Solution(), "", 256 * 1l << 20).start();
    }

    long make() throws IOException {
        int n = readInt();
        int base = readInt();
        int[] nums = new int[n];
        for (int i = 0; i < n; i++) {
            nums[i] = readInt();
        }
        long ans = 0;
        long currBase = 1;
        for (int i = n - 1; i >= 0; i--) {
            ans += currBase * nums[i];
            currBase *= base;
        }

        return ans;
    }

    void solve() throws IOException {
        long first = make();
        long second = make();
        if (first == second) out.print("=");
        else if (first > second) out.print(">");
        else out.print("<");
    }
}


import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.LinkedList;
import java.util.Queue;

public class ProblemB {

    /**
     * @param args
     */
    private static boolean visited[][] = new boolean[20][20];
    private static boolean isSafe(int i,int j, int n,int m){
        if(i<0 || i>=n || j<0 || j>= m)
            return false;
        if(visited[i][j]){
            return false;
        }
        return true;
    }

    public static void main(String[] args) throws Exception {
        // TODO Auto-generated method stub
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        String input = br.readLine();
        int n,m;
        n = Integer.parseInt(input.split(" ")[0]);
        m = Integer.parseInt(input.split(" ")[1]);
        String hD = br.readLine();
        String vD = br.readLine();
        for(int i=0;i<20;i++){
            for(int j=0;j<20;j++){
                visited[i][j] = false;
            }
        }
        boolean isConnected = true;
        for(int i=0;i<n;i++){
            for(int j=0;j<m;j++){
                visited[i][j] = true;
                BFS(hD,vD,n,m,i,j);
                isConnected = true;
                for(int l=0;l<n;l++){
                    for(int k=0;k<m;k++){
                        if(!visited[l][k]){
                            isConnected = false;
                            break;
                        }
                    }
                    if(!isConnected){
                        break;
                    }
                }
                if(!isConnected){
                    break;
                }
                for(int l=0;l<20;l++){
                    for(int k=0;k<20;k++){
                        visited[l][k] = false;
                    }
                }
            }
            if(!isConnected){
                break;
            }
        }
        if(isConnected){
            System.out.println("YES");
        }else{
            System.out.println("NO");
        }

    }

    private static void BFS(String hD, String vD, int n, int m, int i, int j) {
        // TODO Auto-generated method stub
        Queue<Integer> qh = new LinkedList<Integer>();
        Queue<Integer> qv = new LinkedList<Integer>();
        qh.add(i);
        qv.add(j);
        while(!qh.isEmpty()){
            int u = qh.remove();
            int v = qv.remove();
            if(isSafe(u, v+1, n, m)){
                if(hD.charAt(u) == '>'){
                    visited[u][v+1] = true;
                    qh.add(u);
                    qv.add(v+1);
                }
            }
            if(isSafe(u, v-1, n, m)){
                if(hD.charAt(u) == '<'){
                    visited[u][v-1] = true;
                    qh.add(u);
                    qv.add(v-1);
                }
            }
            if(isSafe(u-1, v, n, m)){
                if(vD.charAt(v) == '^'){
                    visited[u-1][v] = true;
                    qh.add(u-1);
                    qv.add(v);
                }
            }
            if(isSafe(u+1, v, n, m)){
                if(vD.charAt(v) == 'v'){
                    visited[u+1][v] = true;
                    qh.add(u+1);
                    qv.add(v);
                }
            }
        }
    }

}


import java.io.*;
import java.util.*;
public class j
{
public static void main(String a[])throws IOException
{
BufferedReader b=new BufferedReader(new InputStreamReader(System.in));
int m=0,n=0,p=0,i=0;
String r,s="\0",t="\0",u="\0";
r=b.readLine();
StringTokenizer c=new StringTokenizer(r);
s=c.nextToken();
t=c.nextToken();
m=s.length();
n=t.length();
if(m<n)
System.out.print(t);
if(m==n)
{
if(s.compareTo(t)<0)
System.out.print(t);
else
System.out.print("1"+t);
}
if(m>n)
{
if(s.compareTo("100000")==0)
System.out.print(100000+Integer.parseInt(t));
else
{
s=String.valueOf(Integer.parseInt(s)+1);
while(true)
{
p=s.length();
for(i=0;i<p;i++)
if(s.charAt(i)=='4'||s.charAt(i)=='7')
u+=s.charAt(i);
u=u.trim();
if(u.compareTo(t)==0)
{
System.out.print(s);
break;
}
else
{
u="\0";
s=String.valueOf(Integer.parseInt(s)+1);
}
}
}
}
}
}


import java.io.BufferedReader;
import java.io.InputStreamReader;

public class CF1102A {

    public static void main(String[] args) throws Exception{
        BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
        StringBuilder sb = new StringBuilder();
        int N = Integer.parseInt(in.readLine());
        long ans = (N*(N+1))/2;
        if(ans%2==0)
            sb.append("0\n");
        else
            sb.append("1\n");
        System.out.print(new String(sb));

    }
}


import java.util.Scanner;

public class Chores
{
    public static void main(String[] args)
    {
        Scanner in = new Scanner(System.in);
        int n = in.nextInt();
        int k = in.nextInt();
        int A = Integer.MAX_VALUE, sum = 0, index = 0;
        int x = in.nextInt();

        for(int i = 0; i < n; i++)
        {
            int N = in.nextInt();

            if(i == (n - k))
            {
                A = N;
            }
            if(N >= A)
            {
                index = i;
                break;
            }
            else
            {
                sum = sum + N;
            }
        }
        System.out.println(sum + ((n - index) * x));

    }
}


import java.util.*;
import java.io.*;
import java.text.*;

public class B653 {

	public static int solve(String[] l2, String[] l1, String s, int n) {
		if (s.length() == n)
			return 1;
		int ans = 0;
		for (int i = 0; i < l1.length; i++) {
			if (((char) s.charAt(0) + "").equals(l1[i])) {
				ans += solve(l2, l1, l2[i] + s.substring(1), n);
//				System.out.println("LL");
			}
		}
		return ans;

	}

	public static void main(String[] args) throws IOException {
		Scanner sc = new Scanner(System.in);
		PrintWriter pw = new PrintWriter(System.out);
		int n = sc.nextInt();
		int q = sc.nextInt();
		String[] l2 = new String[q];
		String[] l1 = new String[q];
		for (int i = 0; i < l1.length; i++) {
			l2[i] = sc.next();
			l1[i] = sc.next();
		}
//		pw.println(Arrays.toString(l1));
//		pw.println(Arrays.toString(l2));
		pw.print(solve(l2, l1, "a", n));
		pw.close();
	}

	static class Scanner {
		StringTokenizer st;
		BufferedReader br;

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

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

		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 {
			String x = next();
			StringBuilder sb = new StringBuilder("0");
			double res = 0, f = 1;
			boolean dec = false, neg = false;
			int start = 0;
			if (x.charAt(0) == '-') {
				neg = true;
				start++;
			}
			for (int i = start; i < x.length(); i++)
				if (x.charAt(i) == '.') {
					res = Long.parseLong(sb.toString());
					sb = new StringBuilder("0");
					dec = true;
				} else {
					sb.append(x.charAt(i));
					if (dec)
						f *= 10;
				}
			res += Long.parseLong(sb.toString()) / f;
			return res * (neg ? -1 : 1);
		}

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

	}
}


// Utilities
import java.io.*;
import java.util.*;

public class Main {
	static int N, K;
	static long[] fac;
	static long res = 0;
	static final int MOD = 998244353;

	public static void main(String[] args) throws IOException {
		N = in.iscan(); K = in.iscan(); fac = new long[N+1]; fac[0] = 1;
		for (int i = 1; i <= N; i++) fac[i] = fac[i-1] * i % MOD;
		for (int i = 1; i <= N; i++) {
			res = (res + choose(N/i-1, K-1)) % MOD;
		}
		out.println(res);
		out.close();
	}

	static long choose(int n, int k) {
		if (k > n) return 0;
		long a = fac[n];
		long b = fac[k] * fac[n-k] % MOD;
		// b ^ prime-1 = 1 -> b ^ 998244352 = 1 -> b * (b ^ 998244351) = 1
		// -> Mod_inv = b ^ 998244351
		return a * UTILITIES.fast_pow_mod(b, MOD-2, MOD) % MOD;
	}

	static INPUT in = new INPUT(System.in);
	static PrintWriter out = new PrintWriter(System.out);
	private static class INPUT {

		private InputStream stream;
		private byte[] buf = new byte[1024];
		private int curChar, numChars;

		public INPUT (InputStream stream) {
			this.stream = stream;
		}

		public INPUT (String file) throws IOException {
			this.stream = new FileInputStream (file);
		}

		public int cscan () throws IOException {
			if (curChar >= numChars) {
				curChar = 0;
				numChars = stream.read (buf);
			}

			if (numChars == -1)
				return numChars;

			return buf[curChar++];
		}

		public int iscan () throws IOException {
			int c = cscan (), sgn = 1;

			while (space (c))
				c = cscan ();

			if (c == '-') {
				sgn = -1;
				c = cscan ();
			}

			int res = 0;

			do {
				res = (res << 1) + (res << 3);
				res += c - '0';
				c = cscan ();
			}
			while (!space (c));

			return res * sgn;
		}

		public String sscan () throws IOException {
			int c = cscan ();

			while (space (c))
				c = cscan ();

			StringBuilder res = new StringBuilder ();

			do {
				res.appendCodePoint (c);
				c = cscan ();
			}
			while (!space (c));

			return res.toString ();
		}

		public double dscan () throws IOException {
			int c = cscan (), sgn = 1;

			while (space (c))
				c = cscan ();

			if (c == '-') {
				sgn = -1;
				c = cscan ();
			}

			double res = 0;

			while (!space (c) && c != '.') {
				if (c == 'e' || c == 'E')
					return res * UTILITIES.fast_pow (10, iscan ());

				res *= 10;
				res += c - '0';
				c = cscan ();
			}

			if (c == '.') {
				c = cscan ();
				double m = 1;

				while (!space (c)) {
					if (c == 'e' || c == 'E')
						return res * UTILITIES.fast_pow (10, iscan ());

					m /= 10;
					res += (c - '0') * m;
					c = cscan ();
				}
			}

			return res * sgn;
		}

		public long lscan () throws IOException {
			int c = cscan (), sgn = 1;

			while (space (c))
				c = cscan ();

			if (c == '-') {
				sgn = -1;
				c = cscan ();
			}

			long res = 0;

			do {
				res = (res << 1) + (res << 3);
				res += c - '0';
				c = cscan ();
			}
			while (!space (c));

			return res * sgn;
		}

		public boolean space (int c) {
			return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
		}
	}

	public static class UTILITIES {

		static final double EPS = 10e-6;

		public static int lower_bound (int[] arr, int x) {
			int low = 0, high = arr.length, mid = -1;

			while (low < high) {
				mid = (low + high) / 2;

				if (arr[mid] >= x)
					high = mid;
				else
					low = mid + 1;
			}

			return low;
		}

		public static int upper_bound (int[] arr, int x) {
			int low = 0, high = arr.length, mid = -1;

			while (low < high) {
				mid = (low + high) / 2;

				if (arr[mid] > x)
					high = mid;
				else
					low = mid + 1;
			}

			return low;
		}

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

		public static long lcm (long a, long b) {
			return a * b / gcd (a, b);
		}

		public static long fast_pow_mod (long b, long x, int mod) {
			if (x == 0) return 1;
			if (x == 1) return b;
			if (x % 2 == 0) return fast_pow_mod (b * b % mod, x / 2, mod) % mod;

			return b * fast_pow_mod (b * b % mod, x / 2, mod) % mod;
		}

		public static int fast_pow (int b, int x) {
			if (x == 0) return 1;
			if (x == 1) return b;
			if (x % 2 == 0) return fast_pow (b * b, x / 2);

			return b * fast_pow (b * b, x / 2);
		}

		public static long choose (long n, long k) {
			k = Math.min (k, n - k);
			long val = 1;

			for (int i = 0; i < k; ++i)
				val = val * (n - i) / (i + 1);

			return val;
		}

		public static long permute (int n, int k) {
			if (n < k) return 0;
			long val = 1;

			for (int i = 0; i < k; ++i)
				val = (val * (n - i));

			return val;
		}
	}
}


import java.io.*;
import java.util.*;
import java.math.BigDecimal;

public class B
{
public static void main(String args[]) throws IOException
{
  BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
 // BufferedWriter bw=new BufferedWriter(new OutputStreamWriter(System.out));
  // code starts here
  String s[]=br.readLine().split(" ");
  long x=Long.parseLong(s[0]);
  long y=Long.parseLong(s[1]);
  if(x==y){
  System.out.println("=");
  return;}
  double e=Math.E;
  if(x>e && y>e)
  {
  if(x>y)
    System.out.println("<");
   else
    System.out.println(">");
    return;
   }
  BigDecimal l1=new BigDecimal(Math.log(x));
   BigDecimal l2=new  BigDecimal(Math.log(y));
  BigDecimal x1=new  BigDecimal(x);
   BigDecimal y1=new  BigDecimal(y);
    BigDecimal a1=l1.multiply(y1);
     BigDecimal a2=l2.multiply(x1);
  //double a2=l2/y;
  if(a1.compareTo(a2)<0)
    System.out.println("<");
   else if(a1.compareTo(a2)>0)
    System.out.println(">");
    else
      System.out.println("=");
 //bw.flush();
}

}


/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

import java.util.Scanner;

/**
 *
 * @author atheeralharbi
 */
public class JavaApplication29 {

    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {
        // TODO code application logic here

          Scanner read = new Scanner(System.in);
          String s3 = read.next();
          String s4 = read.next();

          s3 = s3.toUpperCase();
		s4 = s4.toUpperCase();

          for (int i = 0 ; i<s3.length(); i++){

             if ((s3.charAt(i) == s4.charAt(i)) && (i == s3.length()-1) ){
                 System.out.println(0);
             break;}

              if (s3.charAt(i) > s4.charAt(i)){

              System.out.println(1);
              break;
              }
                 if (s3.charAt(i) < s4.charAt(i)){

              System.out.println(-1);
              break;
              }

          }
    }

}


import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);

        String s=sc.next();
        int a=0;
        for (int i = 0; i < s.length(); i++) {
            if(s.charAt(i)=='a'){
                a++;
            }
        }
        int tamaño=s.length();
        while(true){
            if(a>tamaño/2){
                System.out.println(tamaño);
                break;
            }else{
                tamaño--;
            }
        }
    }
}


import java.io.*;
import java.util.StringTokenizer;

/**
 * Created by sachin.goyal on 16/05/16.
 */
public class MainB {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        InputReader in = new InputReader(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        Task solver = new Task();
        solver.solve(1, in, out);
        out.close();
    }

    static class Task {
        public void solve(int testNumber, InputReader in, PrintWriter out) {
            int n = in.nextInt();
            int t = in.nextInt();
            if(t == 0){
                out.print(0);
                return;
            }
            double[][] ans = new double[11][11];
            for(int i=0;i<n;i++){
                for(int j=0;j<n;j++) {
                    ans[i][j] = 0d;
                }}
            ans[0][0] = t;

            int finalAns = 1;
            for(int i=1;i<n;i++){
                for(int j=0;j<=i;j++){
                    int left = j-1;
                    int right = left+1;
                    ans[i][j] += left >=0 && ans[i-1][left] > 1? (ans[i-1][left] -1)/2 : 0;
                    ans[i][j] += right<=i-1 && ans[i-1][right] > 1 ? (ans[i-1][right] -1)/2 : 0;
                    if(ans[i][j] >= 1d) finalAns++;
                }
            }
            out.print(finalAns);

        }
    }

    static class InputReader {
        public BufferedReader reader;
        public StringTokenizer tokenizer;

        public InputReader(InputStream stream) {
            reader = new BufferedReader(new InputStreamReader(stream), 32768);
            tokenizer = null;
        }

        public String next() {
            while (tokenizer == null || !tokenizer.hasMoreTokens()) {
                try {
                    tokenizer = new StringTokenizer(reader.readLine());
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            }
            return tokenizer.nextToken();
        }

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

    }
}


import java.io.IOException;
import java.io.OutputStreamWriter;
import java.io.BufferedWriter;
import java.util.InputMismatchException;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.util.NoSuchElementException;
import java.io.Writer;
import java.math.BigInteger;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 * @author Alex
 */
public class Main {
	public static void main(String[] args) {
		InputStream inputStream = System.in;
		OutputStream outputStream = System.out;
		InputReader in = new InputReader(inputStream);
		OutputWriter out = new OutputWriter(outputStream);
		TaskA solver = new TaskA();
		solver.solve(1, in, out);
		out.close();
	}
}

class TaskA {
    public void solve(int testNumber, InputReader in, OutputWriter out) {
        long x = in.readLong(), y = in.readLong(), m = in.readLong();
        long min = Math.min(x, y), max = Math.max(x, y);
        long counter = 0;
        while (min < m && max < m) {
            if (min <= 0 && max <= 0) {
                out.print(-1);
                return;
            }
            long diff = max - min;
            long times = Math.max(diff / max, 1);
            min += (max * times);
            counter += times;

            long tempmin = Math.min(min, max);
            long tempmax = Math.max(min, max);
            min = tempmin;
            max = tempmax;
        }
        out.print(counter);
    }
}

class InputReader {
	private InputStream stream;
	private byte[] buf = new byte[1024];
	private int curChar;
	private int numChars;
	private SpaceCharFilter filter;

	public InputReader(InputStream stream) {
		this.stream = stream;
	}

	public int read() {
		if (numChars == -1)
			throw new InputMismatchException();
		if (curChar >= numChars) {
			curChar = 0;
			try {
				numChars = stream.read(buf);
			} catch (IOException e) {
				throw new InputMismatchException();
			}
			if (numChars <= 0)
				return -1;
		}
		return buf[curChar++];
	}
	public long readLong() {
		int c = read();
		while (isSpaceChar(c))
			c = read();
		int sgn = 1;
		if (c == '-') {
			sgn = -1;
			c = read();
		}
		long res = 0;
		do {
			if (c < '0' || c > '9')
				throw new InputMismatchException();
			res *= 10;
			res += c - '0';
			c = read();
		} while (!isSpaceChar(c));
		return res * sgn;
	}
	public boolean isSpaceChar(int c) {
		if (filter != null)
			return filter.isSpaceChar(c);
		return isWhitespace(c);
	}

	public static boolean isWhitespace(int c) {
		return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
	}
	public interface SpaceCharFilter {
		public boolean isSpaceChar(int ch);
	}
}

class OutputWriter {
	private final PrintWriter writer;

	public OutputWriter(OutputStream outputStream) {
		writer = new PrintWriter(new BufferedWriter(new OutputStreamWriter(outputStream)));
	}
	public void close() {
		writer.close();
	}
	public void print(long i) {
		writer.print(i);
	}
	public void print(int i) {
		writer.print(i);
	}
}