import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Comparator;
import java.util.HashMap;
import java.util.Map;
import java.util.StringTokenizer;
import java.util.Collections;

public class algorithms{

    public static void main(String[] args) throws IOException {
    	MyScanner in = new MyScanner();
    	Task282B task = new Task282B();
    	task.slove(in);
    }

    public static class Task282A {
    	public void slove(MyScanner in) {
    		String tmp = in.nextLine();
    		int first = Character.getNumericValue(tmp.charAt(0));
    		int second = Character.getNumericValue(tmp.charAt(1));
    		int arr[] = new int [10];
    		arr[0] = 2;
    		arr[1] = 7;
    		arr[2] = 2;
    		arr[3] = 3;
    		arr[4] = 3;
    		arr[5] = 4;
    		arr[6] = 2;
    		arr[7] = 5;
    		arr[8] = 1;
    		arr[9] = 2;
    		int answer = arr[first]*arr[second];
    		System.out.println(answer);
    	}

    }

    public static class Task282B {
    	public void slove(MyScanner in) {
    		long a = in.nextInt();
    		long b = in.nextInt();
    		if (a < b) {
    			System.out.println(0);
    			return;
    		}
    		long delta = a - b;
//    		System.out.println(delta);
//    		double d = Math.sqrt(delta);
//    		System.out.println(d);
//    		int r = (int) d;
    		long count = 0;
    		if (a == b) {
    			System.out.println("infinity");
    		} else {
        		for (long i = b; i <= delta;i++) {
//        			if (a%i == b) {
//        				count++;
//        			}

//        			System.out.println(a%i);
        			if (delta % i == 0) {
//        				if ((i < b) || (delta/i < b)) {
//	        				System.out.println(i);
	        				count++;
//        				}
        			}
         		}
    			System.out.println(count);
    		}
    	}

    }

    public static class Task2014A {
    	public void slove(MyScanner in) {
    		int n = in.nextInt();
    		int t = in.nextInt();
    		int arr [] = new int [n-1];
    		String answer = "NO";
    		for (int i = 0; i < n-1;i++) {
    			arr[i] = in.nextInt();
    		}
    		int index = 1;
    		while (index <= n-1){
    			if (index == t) {
    				answer = "YES";
    				break;
    			}
    			index = arr[index-1] + index;
    		}
    		if (index == t) {
				answer = "YES";
			}
    		System.out.println(answer);
    	}

    }

    public static class Task2014B {
    	public int arr [];
    	public int mat [][];
    	public int n;
    	public void slove(MyScanner in) {
    		n = in.nextInt();
    		arr = new int [n];
    		mat = new int [n][n];
    		for (int i = 0; i < n;i++) {
    			arr[i] = in.nextInt();
    		}
    		for (int i = 0; i < n;i++) {
    			String t = in.nextLine();
    			for (int j = 0; j < n; j++) {
    				if (t.charAt(j) == '0') {
    					mat[i][j] = 0;
    				} else {
    					mat[i][j] = 1;
    				}
    			}
    		}
    		mutable(0,0,n,n);
//    		mutable(0,0,n,n);
    		for (int i = 0; i < n;i++) {
    			System.out.print(arr[i] + " ");
    		}
    	}
    	public void mutable(int i_, int j_, int ni, int nj) {
    		for (int i = i_; i < ni;i++) {
    			if (j_ < i+1) {
    				j_ = i+1;
    			}
    			for (int j = j_; j < nj; j++) {
    				if (mat[i][j] == 1 && arr[j] < arr[i]) {
	    				int tmp = arr[i];
	    				arr[i] = arr[j];
	    				arr[j] = tmp;
	    				for (int k = 0; k < n; k++) {
	    					if (mat[i][k] == 1) {
	    						mutable(k, i, k+1, i+1);
	    					}
	    				}
    				}
    			}

    		}
    	}

    }

//    public static class Task2014C {
//    	public void slove(MyScanner in) {
//    		int n = in.nextInt();
//    		int m = in.nextInt();
//    		int w [] = new int [n];
//    		int b [] = new int [m];
//    		for (int i = 0; i < n;i++) {
//    			w[i] = in.nextInt();
//    		}
//    		for (int i = 0; i < m;i++) {
//    			b[i] = in.nextInt();
//    		}
//    		while (){
//
//    		}
//    		System.out.println();
//    	}
//
//    }

    public static class Task284A {
    	public void slove(MyScanner in) {
    		int n = in.nextInt();
    		int x = in.nextInt();
    		int l, r, count = 0, current = 1, b2;
    		for (int i = 0; i < n;i++) {
    			l = in.nextInt();
    			r = in.nextInt();
    			b2 = (l - current)/x;
    			if (b2 >= 1) {
    				current += x*b2;
    			}
    			count += r - current + 1;
    			current = r+1;
    		}
    		System.out.println(count);
    	}

    }

    public static class Task284B {
    	public void slove(MyScanner in) {
    		int n = in.nextInt();
    		int m = in.nextInt();
    		Map<String, String> map = new HashMap<String, String>();
    		String s, answer = "";
    		for (int i = 0; i < m;i++) {
    			s = in.nextLine();
    			String arr [] = s.split(" ");
    			if (arr[1].length() < arr[0].length()) {
    				map.put(arr[0], arr[1]);
    			} else {
    				map.put(arr[0], arr[0]);
    			}
    		}
    		s = in.nextLine();
    		for (String retval: s.split(" ")){
    			answer += map.get(retval) + " ";
    		}
    		System.out.println(answer);
    	}

    }

    public static class Task284C {
    	public void slove(MyScanner in) {
    		long x = in.nextInt();
    		long y = in.nextInt();
    		Point pa = new Point(x, y);
    		x = in.nextInt();
     		y = in.nextInt();
    		Point pb = new Point(x, y);
    		int count = 0;
    		int n = in.nextInt();
    		long a, b, c;
    		for (int i = 0; i < n;i++) {
        		a = in.nextInt();
         		b = in.nextInt();
         		c = in.nextInt();
         		if (pa.onOneSide(pb, a, b, c) == false) {
         			count++;
         		}
    		}
    		System.out.println(count);
    	}

    }

    public static class Point {

    	public long x;
    	public long y;

    	public Point(long x, long y) {
    		this.x = x;
    		this.y = y;
    	}

    	public boolean onOneSide(Point p, long a, long b, long c) {
    		long d2 = a*p.x + b*p.y + c;
    		long d1 = a*this.x + b*this.y + c;
    		if ((d2 > 0 && d1 < 0) || (d1 > 0 && d2 < 0)) {
    			return false;
    		}
    		return true;
    	}
    }

    public static class TaskA {
    	public void slove(MyScanner in) {
    		int n = in.nextInt();
    		int prev = 0, prevprev = 0, diff, answer;
    		int min = 1000, max = 0;
    		int imin = 1;
    		int arr [] = new int [n];
    		for (int i = 0; i < n;i++) {
    			arr[i] = in.nextInt();
    			if (i != 0) {
    				if (i > 1) {
		    			diff = arr[i] - prevprev;
		    			if (diff < min) {
		    				min = diff;
		    				imin = i;
		    			}
    				}
	    			if ((arr[i] - prev) > max) {
	    				max = arr[i] - prev;
	    			}
    			}
    			prevprev = prev;
    			prev = arr[i];
    		}
    		diff = arr[imin] - arr[imin-2];
    		if (diff > max) {
    			answer = diff;
    		} else {
    			answer = max;
    		}

    		System.out.println(answer);
    	}

    }

    public static class TaskB {
    	public int arr [];
    	public int n;
    	public void slove(MyScanner in) {
    		n = in.nextInt();
    		arr = new int [n];
    		int count[] = new int [10];
    		String s = in.nextLine();
    		String min = s, num;
    		for (int i = 0; i < n;i++) {
    			arr[i] = Character.getNumericValue(s.charAt(i));
    			count[arr[i]] += 1;
    		}
    		for (int i = 0; i < 10;i++) {
    			if (count[i] == 0) {
    				continue;
    			}
    			num = getSmallestInt(10 - i);
    			for (int j = 0; j < num.length();j++) {
	    			if (num.charAt(j) < min.charAt(j)) {
	    				min = num;
	    			}
	    			if (num.charAt(j) != min.charAt(j)) {
	    				break;
	    			}
    			}

    		}
    		String answer = "";
    		answer += min;
    		System.out.println(answer);
    	}

    	public String getSmallestInt(int offset) {
    		StringBuffer tmp = new StringBuffer();
    		long newvalue;
    		ArrayList<Integer> al = new ArrayList<Integer>();
			for (int i = 0; i < n;i++) {
				newvalue = arr[i] + offset;
				if (newvalue >= 10) {
					newvalue -= 10;
					if (newvalue == 0) {
						al.add(i);
					}
				}
				tmp.append((int)newvalue);
    		}
			String str = tmp.toString();
			String newstr;
			String min = String.format("%0" + n + "d", 0).replace("0","9");
			for(int i = 0; i < al.size(); i++) {
				newstr = str.substring(al.get(i)) + str.substring(0, al.get(i));
	    		for (int j = 0; j < newstr.length();j++) {
	    			if (newstr.charAt(j) < min.charAt(j)) {
	    				min = newstr;
	    			}
	    			if (newstr.charAt(j) != min.charAt(j)) {
	    				break;
	    			}
	    		}
			}
    		return min;
    	}

    }

    public static class TaskC {
    	public void slove(MyScanner in) {
    		int n = in.nextInt();
    		int m = in.nextInt();
    		String arr [] = new String [n];
    		char prev = ' ';
    		int count = 0;
    		for (int i = 0; i < n;i++) {
    			arr[i] = in.nextLine();
    		}
    		char c;
    		ArrayList<Integer> ignore = new ArrayList<Integer>();
    		ArrayList<Integer> ignorenext = new ArrayList<Integer>();
    		for (int i = 0; i < m;i++) {
    			prev = ' ';
    			for (int j = 0; j < n;j++) {
    				c = arr[j].charAt(i);
        			if (ignore.contains(j)) {
        				prev = c;
        				continue;
        			}
    				if (c > prev && prev != ' ') {
    					if (ignorenext.contains(j) == false) {
    						ignorenext.add(j);
    					}
    				}
    				if (c < prev) {
    					count++;
    					ignorenext.clear();
    					break;
    				}
    				prev = c;
    			}
    			ignore.addAll(ignorenext);
    			ignorenext.clear();
    		}
    		System.out.println(count);
    	}

    }

    public static class TaskD {
    	public void slove(MyScanner in) {
    		int n = in.nextInt();
    		int s = 0, t = 0;
    		int count1 = 0, count2 = 0;
    		int max = 0;
    		int arr[] = new int [n];
    		for (int i = 0; i < n; i++) {
    			arr[i] = in.nextInt();
    			if (arr[i] == 1) {
    				count1++;
    			} else {
    				count2++;
    			}
    		}
    		if (count1 != count2) {
    			if (count1 > count2) {
    				max = count1;
    			} else {
    				max = count2;
    			}
    			int x = 1, y = max;
    			while (max/x >= 1) {
    				if (max%x == 0) {
    					y = max/x;
    					System.out.println(x + " " + y);
    				}
    				x++;
    			}
    		}

    		System.out.println(s + " " + t);
    	}

    }

    public static class Pair implements Comparable<Pair> {
	  public final Comparator<Pair> SLOPE_ORDER = new Comparator<Pair>() {
		   // compare points by slope to this point
		       public int compare(Pair p1, Pair p2) {
		    	   return p1.compareTo(p2);
		       }
		};

    	private long min;
    	public long max;
    	private long count;
    	private int num;

    	public Pair(long min, long max, long count, int num) {
    		this.min = min;
    		this.max = max;
    		this.count = count;
    		this.num = num;
    	}

    	public void decrease() {
    		count--;
    	}

    	public long count() {
    		return count;
    	}

    	public int num() {
    		return num;
    	}

		public int compareTo(Pair that) {
	       if ((this.min == that.min) && (this.max == that.max)) {
	           return 0;
	       }
	       if ((this.min < that.min) || (this.min == that.min && this.max < that.max)) {
	           return -1;
	       }
	       return 1;
		}

		public int contain(Pair that) {
//			System.out.println(this.min);
//			System.out.println(this.max);
//			System.out.println(that.min);
//			System.out.println(that.max);
		       if ((this.min <= that.min) && (this.max >= that.max)) {
		           return 1;
		       }
		       if (this.min <= that.min) {
		    	   return 0;
		       }
		       return -1;
			}
    }

    public static class TaskE {
    	public void slove(MyScanner in) {
    		int n = in.nextInt();
    		Pair parties[] = new Pair [n];
    		int p_a[] = new int [n];
    		long min, max;
    		long count;
    		for (int i = 0; i< n;i++) {
    			min = in.nextLong();
    			max = in.nextLong();
    			parties[i] = new Pair(min, max, 0, i+1);
    		}
    		Arrays.sort(parties);
//    		for (int i = 0; i< n;i++) {
//    			System.out.println(parties[i].num());
//    		}
    		int m = in.nextInt();
    		Pair actors[] = new Pair [m];
    		for (int i = 0; i< m;i++) {
    			min = in.nextLong();
    			max = in.nextLong();
    			count = in.nextLong();
    			actors[i] = new Pair(min, max, count, i+1);
    		}
    		Arrays.sort(actors);
//    		for (int i = 0; i< m;i++) {
//    			System.out.println(actors[i].num());
//    		}
    		int j = 0;
    		Pair partie;
    		String answer = "YES\n";
    		for (int i = 0; i< n;i++) {
    			partie = parties[i];
//    			actor = actors[j];
//    			System.out.println(actor.count());
    			if (actors[j].count() <= 0) {
    				if (j == (m)) {
    					answer = "NO";
    					break;
    				}
    				j++;
//    				actor = actors[j];
    			}
//    			System.out.println(actor.contain(partie));
//    			Pair suitable_actor = null;
    			int index_actor = -1;
    			long min_max = 10000000000L;
    			for(int k = j; k< m; k++) {
    				if (actors[k].count() <= 0) {
    					continue;
    				}
	    			int contain = actors[k].contain(partie);
	    			if (contain == 1) {
//	    				System.out.println(actors[k].max);
	    				if (actors[k].max < min_max){
	    					index_actor = k;
	    					min_max = actors[k].max;
	    				}

//	    				actors[k].decrease();
//	    				System.out.println(actors[k].count());
//	    				System.out.println(partie.num());
//	    				System.out.println(actors[k].num());
//	    				p_a[partie.num()-1] = actors[k].num();
//	    				break;
	    			} else if (contain == -1){
//	    				answer = "NO";
						break;
	    			}
    			}
    			if (index_actor == -1) {
    				answer = "NO";
    				break;
    			}
//    			System.out.println(actors[index_actor].num);
    			actors[index_actor].decrease();
    			p_a[partie.num()-1] = actors[index_actor].num();

    		}
    		if (answer != "NO") {
    			for (int i = 0; i< n;i++) {
    				if (p_a[i] == 0) {
    					answer = "NO";
    					break;
    				}
    				answer += p_a[i] + " ";
    			}
    		}
    		System.out.println(answer);
    	}

    }

    public static class TaskDold {
    	public void slove(MyScanner in) {
    		int n = in.nextInt();
    		Boolean ok = true;
    		int arr [][] = new int [n][n];
    		int minj [] = new int [n];
    		int min = 1000000000;
    		int min_j = 0;
    		for (int i =0; i< n;i++) {
    			min = 1000000001;
    			min_j = 0;
    			for (int j=0; j< n; j++) {
    				arr[i][j] = in.nextInt();
    				if (arr[i][j] < min && (i != j)) {
    					min = arr[i][j];
    					min_j = j;
    				}
    				if ((i == j) && (arr[i][j] != 0)) {
    					ok = false;
    				}
    				if ((i > j) && (arr[i][j] != arr[j][i])) {
    					ok = false;
    				}
    				if ((i != j) && (arr[i][j] == 0)) {
    					ok = false;
    				}
    			}
    			minj[i] = min_j;
    			for (int j =0; j< i;j++) {
    				if ((j == min_j) && (minj[j] == i))
    				{

    				}
    			}
    		}
    		if (!ok) {
    			System.out.println("NO");
    			return;
    		}
    		int j;
    		for (int i =0; i< n;i++) {
    			min_j = minj[i];
//    			System.out.println(min_j);
    			for (j =0; j< i;j++) {
					if ((j == min_j) && (minj[j] == i))
					{

					}
    				if (minj[j] == min_j) {
//    					System.out.println(arr[i][j]);
//    					System.out.println(arr[j][minj[j]]);
//    					System.out.println(arr[i][min_j]);
    					if (arr[i][j] != (arr[j][minj[j]] + arr[i][min_j])) {
    						System.out.println("NO");
    		    			return;
    					}
    				}
    			}

    		}

    		System.out.println("YES");
    	}

    }

    public static class MyScanner {
		BufferedReader br;
		StringTokenizer st;

		public MyScanner() {
			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();
		}

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

	}

}


import java.util.Scanner;

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

		int t, s, q, ans = 0;

		t = sc.nextInt();
		s = sc.nextInt();
		q = sc.nextInt();

		while (timer < t) {
			s *= q;
			ans++;
		}

		System.out.print(ans);
	}
}


import java.util.*;
public class Main{
    public static void main(String [] args)
    {
        Scanner SC = new Scanner(System.in);
        long x=SC.nextInt();
        long y=SC.nextInt();

            if((x>y && (x-y)%2!=0) || (y=x+1))
            {
                System.out.println("YES");
            }
            else
            System.out.println("NO");

        }

}


import java.util.Scanner;

/**
 * Created by poly on 4/13/15.
 */
public class Main {
    public static void main(String argv[]) {
        calcStirling();
//        System.out.println(Arrays.toString(sumStirling));
        Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt();
        long ans = 1;
        for (int i = 1; i < n; i++) {
            long c = combi(n, i);
//            System.out.println(i + ":" + c + ":" + sumStirling[i]);

            ans += (c * sumStirling[i]) % MOD;
            ans %= MOD;
        }
        System.out.println(ans);
    }

    static long MOD = 1000000007;
    //    static long[][] dp = new long[4010][4010];
    static long[] sumStirling = new long[4010];

    // S(n, m) = S(n-1, m) * m + S(n-1, m-1)
    static void calcStirling() {
        int m = 4002;
        int n = 4002;
        long[] pre = new long[4010];
        pre[0] = 1;
//        dp[0][0] = 1;
        for (int i = 1; i <= n; i++) {
            long[] cur = new long[4010];
            for (int j = 1; j <= m; j++) {
//                dp[i][j] += dp[i - 1][j] * j;
//                dp[i][j] += dp[i - 1][j - 1];
//                dp[i][j] %= MOD;
//                sumStirling[i] += dp[i][j];
//                sumStirling[i] %= MOD;
                cur[j] += pre[j] * j;
                cur[j] += pre[j - 1];
                cur[j] %= MOD;
                sumStirling[i] += cur[j];
                sumStirling[i] %= MOD;
            }
            // copy cur to pre
            for (int j = 0; j <= m; j++) {
                pre[j] = cur[j];
            }
        }
    }

    static long a[][] = new long[4010][4010];

    static long combi(int n, int m) {
        if (a[n][m] > 0) return a[n][m];
        if (m == 0) return 1L;
        if (m < 0) return 0L;
        if (m == 1) return (long) n;
        if (n < m) return 0L;
        if (n == m) return 1L;
        if (m * 2 > n) m = n - m;
        long r = (combi(n - 1, m) + combi(n - 1, m - 1)) % MOD;
        a[n][m] = r;
        return r;
    }
}


import java.util.Scanner;

public class CF236_1 {

    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int k = in.nextInt();
        int a = in.nextInt();
        int b = in.nextInt();
        int v = in.nextInt();

        if (k > b) {
        int i;
        for (i = 0; a > 0; i++) {
            if (b > 0) {
            for (int j = 0; b >= 0; b--) {
                a = a - v;
            }
            }else {
                a = a - v;
            }
        }
        System.out.println(i);
        } else {
            int i;
            for (i = 0; a > 0; i++) {
                if(b > 0){
                    for (int j = 0; j < k  ; j++) {
                        if (b > 0) {
                            a = a - v;
                        }
                    }
                    b--;
                //  if( b == 0) break;
                } else {
                    a = a - v;
                }

            }

        System.out.println(i);

        }

    }


import java.io.BufferedInputStream;
import java.io.BufferedOutputStream;
import java.io.BufferedReader;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.StringTokenizer;

public class Main {
	public static void main(String[] args) throws FileNotFoundException, IOException {
		InputReader in = new InputReader(new BufferedInputStream(System.in));
		PrintWriter out = new PrintWriter(new BufferedOutputStream(System.out));
		TaskB solver = new TaskB();
//		long t1 = System.currentTimeMillis();
		solver.solve(1, in, out);
		out.flush();
//		long t2 = System.currentTimeMillis();
//		System.err.println(t2 - t1);
		out.close();

	}
}

class Pos implements Comparable<Pos> {
	int x;
	int y;
	long val;

	public Pos(int x, int y, long val) {
		this.x = x;
		this.y = y;
		this.val = val;
	}

	public int compareTo(Pos p) {
		if (val == p.val) {
			if (x == p.x)
				return Integer.compare(y, p.y);
			return Integer.compare(x, p.x);
		}
		return Long.compare(val, p.val);
	}

}

class Pair implements Comparable<Pair> {
	int fir;
	int sec;

	Pair(int fir, int sec) {
		this.fir = fir;
		this.sec = sec;
	}

	public int compareTo(Pair p) {
		return Integer.compare(sec, p.sec);
	}
}

class TaskB {

	int INF = (int) 1e9;
	int id[];
	int sz[];
	int sup[];

	void solve(int testNumber, InputReader in, PrintWriter pw) throws IOException {
		int n = in.nextInt();
		int m = in.nextInt();
		int x = in.nextInt();
		int y = in.nextInt();
		int vx = in.nextInt();
		int vy = in.nextInt();
		if (vx == 0) {
			if (x != 0 || x != n) {
				pw.println(-1);
				return;
			}
			int ans = (vy < 0) ? 0 : m;
			pw.println(x + " " + ans);
			return;
		}
		if (vy == 0) {
			if (y != 0 || y != m) {
				pw.println(-1);
				return;
			}
			int ans = (vx < 0) ? 0 : n;
			pw.println(ans + " " + y);
			return;
		}
		int xi, yi, sx, sy;
		if (x == 0 || x == n) {
			xi = 0;
			sx = x;
		} else if (vx < 0) {
			xi = x;
			sx = 0;
		} else {
			xi = n - x;
			sx = n;
		}
		if (y == 0 || y == m) {
			yi = 0;
			sy = y;
		} else if (vy < 0) {
			yi = y;
			sy = 0;
		} else {
			yi = m - y;
			sy = m;
		}
		int c = xi - yi;
		int a = n;
		int b = -m;
//		System.err.println(a + " " + b + " " + c);
		long tx = a;
		long ty = b;
		long xp = 1;
		long xq = 0;
		long yp = 0;
		long yq = 1;
//		System.err.println(a + " " + b + " " + c);
		if (tx < 0) {
			tx = -tx;
			xp = -1;
		}
		if (ty < 0) {
			ty = -ty;
			yq = -1;
		}
		while (ty > 0) {
			long by = tx / ty;
			long t = tx - by * ty;
			long tp = xp - by * yp;
			long tq = xq - by * yq;
			tx = ty;
			xp = yp;
			xq = yq;
			ty = t;
			yp = tp;
			yq = tq;
		}
		if (c % tx != 0) {
			pw.println(-1);
		} else {
			long p = xp;
			long q = xq;
			long z;
			if (b == 0) {
				z = -q / a;
			} else {
				z = p / b;
			}
			p -= z * b;
			q += z * a;
			p *= -c / tx;
			q *= -c / tx;
//			System.err.println(p + " " + q);
			long u = a / tx;
			long v = b / tx;
			if (v < 0) {
				u = -u;
				v = -v;
			}
			if (p > 0) {
				long k = (p + v - 1) / v;
				p -= k * v;
				q += k * u;
			}
			if (p < 0) {
				long k = (-p + v - 1) / v;
				p += k * v;
				q -= k * u;
			}
			if (q < 0) {
				long k = (-q + (-u) - 1) / (-u);
				p += k * v;
				q -= k * u;
			}
			pw.printf("%d %d\n", (p % 2 == 0) ? sx : n - sx, (q % 2 == 0) ? sy : m - sy);
		}
	}

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

class InputReader {
	BufferedReader br;
	StringTokenizer st;

	public InputReader(InputStream in) {
		br = new BufferedReader(new InputStreamReader(in));
		st = null;
	}

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

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

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

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


import java.io.BufferedInputStream;
import java.io.BufferedOutputStream;
import java.io.BufferedReader;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.StringTokenizer;

public class Main {
	public static void main(String[] args) throws FileNotFoundException, IOException {
		InputReader in = new InputReader(new BufferedInputStream(System.in));
		PrintWriter out = new PrintWriter(new BufferedOutputStream(System.out));
		TaskB solver = new TaskB();
//		long t1 = System.currentTimeMillis();
		solver.solve(1, in, out);
		out.flush();
//		long t2 = System.currentTimeMillis();
//		System.err.println(t2 - t1);
		out.close();

	}
}

class Pos implements Comparable<Pos> {
	int x;
	int y;
	long val;

	public Pos(int x, int y, long val) {
		this.x = x;
		this.y = y;
		this.val = val;
	}

	public int compareTo(Pos p) {
		if (val == p.val) {
			if (x == p.x)
				return Integer.compare(y, p.y);
			return Integer.compare(x, p.x);
		}
		return Long.compare(val, p.val);
	}

}

class Pair implements Comparable<Pair> {
	int fir;
	int sec;

	Pair(int fir, int sec) {
		this.fir = fir;
		this.sec = sec;
	}

	public int compareTo(Pair p) {
		return Integer.compare(sec, p.sec);
	}
}

class TaskB {

	int INF = (int) 1e9;
	int id[];
	int sz[];
	int sup[];

	void solve(int testNumber, InputReader in, PrintWriter pw) throws IOException {
		int n = in.nextInt();
		int m = in.nextInt();
		int x = in.nextInt();
		int y = in.nextInt();
		int vx = in.nextInt();
		int vy = in.nextInt();

		int c = vx * y - vy * x;
		int a = n * vy;
		int b = -m * vx;
//		System.err.println(a + " " + b + " " + c);
		long tx = a;
		long ty = b;
		long xp = 1;
		long xq = 0;
		long yp = 0;
		long yq = 1;
		if (tx < 0) {
			tx = -tx;
			xp = -1;
		}
		if (ty < 0) {
			ty = -ty;
			yq = -1;
		}
		while (ty > 0) {
			long by = tx / ty;
			long t = tx - by * ty;
			long tp = xp - by * yp;
			long tq = xq - by * yq;
			tx = ty;
			xp = yp;
			xq = yq;
			ty = t;
			yp = tp;
			yq = tq;
		}
		if (c % tx != 0) {
			pw.println(-1);
		} else {
			long p = xp;
			long q = xq;
			long z;
			if (b == 0) {
				z = -q / a;
			} else {
				z = p / b;
			}
			p -= z * b;
			q += z * a;
			p *= -c / tx;
			q *= -c / tx;
//			System.err.println(p + " " + q);
			long gcd = gcd(p, q);
			long k1 = gcd / b;
			k1++;
			long k2 = gcd / a;
			k2++;
			p -= (k1 * (b / gcd));
			q -= (k2 * (a / gcd));
			if ((p & 1) == 0) {
				p = 0;
			} else {
				p = n;
			}
			if ((q & 1) == 0) {
				q = 0;
			} else {
				q = n;
			}
			pw.println(p + " " + q);
		}
	}

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

class InputReader {
	BufferedReader br;
	StringTokenizer st;

	public InputReader(InputStream in) {
		br = new BufferedReader(new InputStreamReader(in));
		st = null;
	}

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

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

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

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


import java.util.*;

public class Solution {

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

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt(), a = 1;
        N--;
        boolean found = false;
        do {
            if (gcd(a, b) == 1) {
                found = true;
                System.out.println(a + " " + b);
            }
        } while (!found & a < N);
    }
}


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

public class D539 {
    public static void main(String[] args) {
        MyScanner sc = new MyScanner();
        PrintWriter out = new PrintWriter(new BufferedOutputStream(System.out));
        int n = sc.nextInt(); int m = sc.nextInt(); int a = sc.nextInt(); int b = sc.nextInt();
        fac = new long[m + 10];
        initFac(m + 6);
        long ans = 0;
        for (int k = 0; k <= n - 2; k++) {
            long middle = (nck(n - 2, k) * fac[k]) % mod;
            long sum = nck(m - 1, k);
            long cayley;
            if (n - k - 3 >= 0) cayley = ((k + 2) * pow(n, n - k - 3)) % mod; else cayley = 1;
            long total = (((middle * sum) % mod) * cayley) % mod;
            total = (total * pow(m, n - k - 2));
            ans = (ans + total) % mod;
        }
        out.println(ans);
        out.close();
    }

    static long[] fac;
    static long mod = (int) 1e9 + 7;

    static void initFac(long n) {
        fac[0] = 1;
        for (int i = 1; i <= n; i++) {
            fac[i] = (fac[i - 1]  * i) % mod;
        }
    }

    static long exponentiation(long base, long exp)
    {
        long t = 1L;
        while (exp > 0) {

            // for cases where exponent
            // is not an even value
            if (exp % 2 != 0)
                t = (t * base) % mod;

            base = (base * base) % mod;
            exp /= 2;
        }
        return t % mod;
    }

    static long nck(int n, int k) {
        if (n < k)
            return 0;
        long den = inv((int) (fac[k] * fac[n - k] % mod));
        return fac[n] * den % mod;
    }

    static long pow(long b, long e) {
        long ans = 1;
        while (e > 0) {
            if (e % 2 == 1)
                ans = ans * b % mod;
            e >>= 1;
            b = b * b % mod;
        }
        return ans;
    }

    static long inv(int x) {
        return pow(x, mod - 2);
    }

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

        public MyScanner() {
            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();
        }

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

    }

}


import java.io.BufferedInputStream;
import java.io.IOException;
import java.io.PrintWriter;
import java.text.DecimalFormat;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.Comparator;
import java.util.HashMap;
import java.util.HashSet;
import java.util.InputMismatchException;
import java.util.Iterator;
import java.util.LinkedList;
import java.util.Map.Entry;
import java.util.PriorityQueue;
import java.util.Queue;
import java.util.Random;
import java.util.Set;
import java.util.SortedSet;
import java.util.Stack;
import java.util.TreeMap;
import java.util.TreeSet;

import javax.net.ssl.SSLContext;

public class Main
{
	/********************************************** a list of common variables **********************************************/
	private MyScanner scan = new MyScanner();
	private PrintWriter out = new PrintWriter(System.out);
	private final double PI = Math.acos(-1.0);
	private final double EPS = 1e-6;
	private final int SIZEN = (int)(1e5);
	private final int MOD = (int)(1e9 + 7);
	private final long MODH = 10000000007L, BASE = 10007;
	private final int[] DX = {0, 1, 0, -1}, DY = {-1, 0, 1, 0};
	private ArrayList<Integer>[] edge;

	public void foo()
	{
		int a = scan.nextInt();
		int b = scan.nextInt();
		int w = scan.nextInt();
		int x = scan.nextInt();
		int c = scan.nextInt();
		if(b / x >= c - a)
		{
			out.println(Math.max(c - a, 0));
			return;
		}
		long ans = b / x;
		c -= b / x;
		b %= x;
		int[] index = new int[x];
		Arrays.fill(index, -1);
		index[b] = 0;
		ArrayList<Integer> arr1 = new ArrayList<Integer>();
		ArrayList<Integer> arr2 = new ArrayList<Integer>();
		int p = 1;
		while(true)
		{
			int k1 = (w - b - 1) / (w - x);
			int k2 = (b + (w - x) * k1) / x;
			b = (b + (w - x) * k1) % x;
			arr1.add(k1);
			arr2.add(k2);
			if(index[b] != -1)
			{
				p = index[b];
				break;
			}
			index[b] = p++;
		}
		long sum1 = 0, sum2 = 0;
		for(int i = b;i < arr1.size();++i)
		{
			sum1 += arr1.get(i);
			sum2 += arr2.get(i);
		}
		sum1 += sum2;
		int d = c - a;
		ans += d / sum2 * sum1;
		d %= sum2;
		if(d > 0)
		{
			for(int i = 0;i < arr1.size();++i)
			{
				if(d <= arr2.get(i))
				{
					ans += arr1.get(i) + d;
					break;
				}
				else
				{
					ans += arr1.get(i) + arr2.get(i);
					d -= arr2.get(i);
				}
			}
		}
		out.println(ans);
  	}

	public static void main(String[] args)
	{
		Main m = new Main();
		m.foo();
		m.out.close();
	}

	class Point
	{
		private int x;
		private int y;
		public Point(int aX, int aY)
		{
			x = aX;
			y = aY;
		}
	}

	/********************************************** a list of common algorithms **********************************************/
	/**
	 * 1---Get greatest common divisor
	 * @param a :	first number
	 * @param b :	second number
	 * @return		greatest common divisor
	 */
	public long gcd(long a, long b)
	{
		return 0 == b ? a : gcd(b, a % b);
	}

	/**
	 * 2---Get the distance from a point to a line
	 * @param x1	the x coordinate of one endpoint of the line
	 * @param y1	the y coordinate of one endpoint of the line
	 * @param x2	the x coordinate of the other endpoint of the line
	 * @param y2	the y coordinate of the other endpoint of the line
	 * @param x		the x coordinate of the point
	 * @param y		the x coordinate of the point
	 * @return		the distance from a point to a line
	 */
	public double getDist(long x1, long y1, long x2, long y2, long x, long y)
	{
		long a = y2 - y1;
		long b = x1 - x2;
		long c = y1 * (x2 - x1) - x1 * (y2 - y1);
		return Math.abs(a * x + b * y + c) / Math.sqrt(a * a + b * b);
	}

	/**
	 * 3---Get the distance from one point to a segment (not a line)
	 * @param x1	the x coordinate of one endpoint of the segment
	 * @param y1	the y coordinate of one endpoint of the segment
	 * @param x2	the x coordinate of the other endpoint of the segment
	 * @param y2	the y coordinate of the other endpoint of the segment
	 * @param x		the x coordinate of the point
	 * @param y		the y coordinate of the point
	 * @return		the distance from one point to a segment (not a line)
	 */
	public double ptToSeg(long x1, long y1, long x2, long y2, long x, long y)
	{
		double cross = (x2 - x1) * (x - x1) + (y2 - y1) * (y - y1);
		if(cross <= 0)
		{
			return (x - x1) * (x - x1) + (y - y1) * (y - y1);
		}
		double d = (x2 - x1) * (x2 - x1) + (y2 - y1) * (y2 - y1);
		if(cross >= d)
		{
			return (x - x2) * (x - x2) + (y - y2) * (y - y2);
		}
		double r = cross / d;
		double px = x1 + (x2 - x1) * r;
		double py = y1 + (y2 - y1) * r;
		return (x - px) * (x - px) + (y - py) * (y - py);
	}

	/**
	 * 4---KMP match, i.e. kmpMatch("abcd", "bcd") = 1, kmpMatch("abcd", "bfcd") = -1.
	 * @param t:	String to match.
	 * @param p:	String to be matched.
	 * @return		if can match, first index; otherwise -1.
	 */
	public int kmpMatch(char[] t, char[] p)
	{
		int n = t.length;
		int m = p.length;
		int[] next = new int[m + 1];
		next[0] = -1;
		int j = -1;
		for(int i = 1;i < m;++i)
		{
			while(j >= 0 && p[i] != p[j + 1])
			{
				j = next[j];
			}
			if(p[i] == p[j + 1])
			{
				++j;
			}
			next[i] = j;
		}
		j = -1;
		for(int i = 0;i < n;++i)
		{
			while(j >= 0 && t[i] != p[j + 1])
			{
				j = next[j];
			}
			if(t[i] == p[j + 1])
			{
				++j;
			}
			if(j == m - 1)
			{
				return i - m + 1;
			}
		}
		return -1;
	}

	/**
	 * 5---Get the hash code of a String
	 * @param	s:	input string
	 * @return	hash code
	 */
	public long hash(String s)
	{
		long key = 0, t = 1;
		for(int i = 0;i < s.length();++i)
		{
			key = (key + s.charAt(i) * t) % MODH;
			t = t * BASE % MODH;
		}
		return key;
	}

	/**
	 * 6---Get x ^ n % MOD quickly.
	 * @param	x:	base
	 * @param 	n:	times
	 * @return	x ^ n % MOD
	 */
	public long quickMod(long x, long n)
	{
		long ans = 1;
		while(n > 0)
		{
			if(1 == n % 2)
			{
				ans = ans * x % MOD;
 			}
			x = x * x % MOD;
			n >>= 1;
		}
		return ans;
	}

	/**
	 * 7---judge if a point is located inside a polygon
	 * @param x0	the x coordinate of the point
	 * @param y0	the y coordinate of the point
	 * @return true if it is inside the polygon, otherwise false
	 */
	/*public boolean contains(double x0, double y0)
	{
		int cross = 0;
		for(int i = 0;i < n;++i)
		{
			double s = x[i + 1] == x[i] ? 100000000 : (double)(y[i + 1] - y[i]) / (x[i + 1] - x[i]);
			boolean b1 = x[i] <= x0 && x0 < x[i + 1];
			boolean b2 = x[i + 1] <= x0 && x0 < x[i];
			boolean b3 = y0 < s * (x0 - x[i]) + y[i];
			if((b1 || b2) && b3) ++cross;
		}
		return cross % 2 != 0;
	}*/

	/**
	 * 8---judge if a point is located on the segment
	 * @param	x1	the x coordinate of one point of the segment
	 * @param	y1	the y coordinate of one point of the segment
	 * @param 	x2	the x coordinate of another point of the segment
	 * @param 	y2	the y coordinate of another point of the segment
	 * @param	x	the x coordinate of the point
	 * @param 	y	the y coordinate of the point
	 * @return	true if it is located on the segment, otherwise false
	 */
	public boolean isOnSeg(long x1, long y1, long x2, long y2, long x, long y)
	{
		return (x - x1) * (y2 - y1) == (x2 - x1) * (y - y1) &&
				x >= Math.min(x1, x2) && x <= Math.max(x1, x2) &&
				y >= Math.min(y1, y2) && y <= Math.max(y1, y2);
	}

	/**
	 * 9---get the cross product
	 * @param 	p1	point A
	 * @param 	p2	point B
	 * @param 	p	point O
	 * @return	cross product of OA x OB
	 */
	public long cross(Point p1, Point p2, Point p)
	{
		return (long)(p1.x - p.x) * (p2.y - p.y) - (long)(p2.x - p.x) * (p1.y - p.y);
	}

	class MyScanner
	{
	    private byte[] buf = new byte[1024];
	    private int curChar;
	    private int numChars;
	    BufferedInputStream bis = new BufferedInputStream(System.in);

	    public int read()
	    {
	        if (-1 == numChars)
	        {
	        	throw new InputMismatchException();
	        }
	        if (curChar >= numChars)
	        {
	            curChar = 0;
	            try
	            {
	                numChars = bis.read(buf);
	            }
	            catch (IOException e)
	            {
	                throw new InputMismatchException();
	            }
	            if (numChars <= 0)
	            {
	            	return -1;
	            }
	        }
	        return buf[curChar++];
	    }

	    public int nextInt()
	    {
	        int c = read();
	        while (isSpaceChar(c))
	        {
	        	c = read();
	        }
	        int sgn = 1;
	        if (c == '-')
	        {
	            sgn = -1;
	            c = read();
	        }
	        int 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 long nextLong()
	    {
	    	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 double nextDouble()
	    {
	        int c = read();
	        while (isSpaceChar(c))
	        {
	        	c = read();
	        }
	        int sgn = 1;
	        if (c == '-')
	        {
	            sgn = -1;
	            c = read();
	        }
	        double res = 0;
	        while (!isSpaceChar(c) && c != '.')
	        {
	            if (c == 'e' || c == 'E')
	            {
	            	return res * Math.pow(10, nextInt());
	            }
	            if (c < '0' || c > '9')
	            {
	            	throw new InputMismatchException();
	            }
	            res *= 10;
	            res += c & 15;
	            c = read();
	        }
	        if (c == '.')
	        {
	            c = read();
	            double m = 1;
	            while (!isSpaceChar(c))
	            {
	                if (c == 'e' || c == 'E')
	                {
	                	return res * Math.pow(10, nextInt());
	                }
	                if (c < '0' || c > '9')
	                {
	                	throw new InputMismatchException();
	                }
	                m /= 10;
	                res += (c & 15) * m;
	                c = read();
	            }
	        }
	        return res * sgn;
	    }

	    public String next()
	    {
	        int c = read();
	        while (isSpaceChar(c))
	        {
	        	c = read();
	        }
	        StringBuilder res = new StringBuilder();
	        do
	        {
	            res.appendCodePoint(c);
	            c = read();
	        } while (!isSpaceChar(c));
	        return res.toString();
	    }

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


import java.util.*
public class Main {
    public static void main(String[] args) {
        List<Integer> list = new ArrayList<>();
        Scanner in = new Scanner(System.in);
        int n = in.nextInt();
        int result=0;
        Integer[] nums = new Integer[n];
        for(int i = 0;i<n;i++)
            nums[i] = in.nextInt();
        Arrays.sort(nums);

        for(int i = 0 ; nums.length>0;){
            for(int j = i+1;j<nums.length;j++)
                if(nums[j] % nums[i] == 0){
                    nums = RemoveElement(nums, j);
                    j--;
                }
            nums = RemoveElement(nums, i);
                result++;
        }
        System.out.println(result);
    }
    private static Integer[] RemoveElement(Integer[] nums, int n){
        Integer[] newnums = new Integer[nums.length-1];
        int p = 0;
        for(int k=0; k<nums.length;k++){
            if(k==n){p++;continue;}
            newnums[k-p]=nums[k];
        }
        return newnums;
    }
}


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

import java.time.

public class Main {
    public static void main(String[] args) {
        InputStream is = System.in;
        OutputStream outputStream = System.out;
        InputReader in = new InputReader(is);
        PrintWriter out = new PrintWriter(outputStream);
        new Task().solve(in, out);
        out.close();
    }
}

class Task {

    public void solve(InputReader in, PrintWriter out) {
        int t1 = parseTime(in.next());
        int t2 = parseTime(in.next());
        int ans = t2 - t1;
        if (ans < 0) {
            ans += 3600;
        }
        int hh = ans / 60;
        int mm = ans % 60;
        out.printf("%02d:%02d\n", hh, mm);
    }

    public int parseTime(String s) {
        String[] t = s.split(":");
        int hh = Integer.parseInt(t[0]);
        int ss = Integer.parseInt(t[1]);
        return hh * 60 + ss;
    }
}

class InputReader {
    public BufferedReader reader;

    public StringTokenizer tokenizer;

    public InputReader(InputStream is) {
        reader = new BufferedReader(new InputStreamReader(is));
        tokenizer = null;
    }

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

    public boolean hasNext() {
        try {
            getToken();
        } catch (Exception e) {
            return false;
        }
        return true;
    }

    public String next() {
        getToken();
        return tokenizer.nextToken();
    }

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

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

}


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

public class cfa {

	public static void main(String args[])
	{
		Scanner in = new Scanner(System.in);
		int n = in.nextInt();
		int com = (n/7)*2;
		int rem = n%7;
		int a2=Math.min(com+rem,com+2);
        int a1=com;
        System.out.print(a1+" "+a2);
	}
}


import java.util.Scanner;

public class Main {
	public static void main(String []args){
    int n,dfi,dfo;
    Scanner scan = new Scanner(System.in);
    n=scan.nextInt();

    dfi=2*(n/7);
    dfo=2*(n/7);
     n=n%7;
     if(n>1){
    	 dfo+=2;
    	 n-=2;
     }else if (n==1){
    	 dfo+=1;
     }

    System.out.println(dfi+" "+dfo);
	}

}


import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.util.*;

public class Solution {
    //    private static int counter = 0;
    private static HashSet<Integer> visited = new HashSet<Integer>();
    private static int l, r;
    private static boolean[] vis;

    public static void main(String[] args) throws IOException {
//        Scanner in = new Scanner(new FileReader("input.txt"));
        Scanner in = new Scanner(System.in);
//        FileWriter out = new FileWriter("output.txt");
        l = in.nextInt();
        r = in.nextInt();
        in.close();
        int counter = 0, i1, i2;
        vis = new boolean[r + 1];
        vis[1] = true;
        for (int i = 1; i <= r; i++) {
            if (vis[i]) {
                i1 = i * 2;
                i2 = i * 3;
                if (i1 <= r && i1 > 0) {
                    vis[i1] = true;
                }
                if (i2 <= r && i2 > 0) {
                    vis[i2] = true;
                }
                if (i>=l)
                    counter++;
//                if (i1 > 0 && i2 >0)
//                    i = Math.min(i1, i2);
            }
        }
//        for (int i = 1; i <= r; i++) {
//            if (vis[i])
//                counter++;
//        }
//        Arrays.fill(vis, -1);
//        fire(1);
        System.out.println(counter);

//        int start2 = l;
//        int start3 = l;
//        while (start2 <= bound && !goodNum(start2))
//            start2++;
//        while (start3 <= bound && !goodNum(start3))
//            start3++;
//        fire(start2);
//        fire(start3);
//        System.out.println(visited.size());
//        out.write(String.valueOf(counter));

//        out.close();
    }

    static void fire(int cur) {
        if (cur <= r && cur >= l) {
            System.out.println(cur);
            visited.add(cur);
            int n1 = cur * 2;
            int n2 = cur * 3;
            fire(n1);
            fire(n2);
        }
    }

    private static boolean goodNum(int num) {
        while (num % 2 == 0)
            num /= 2;
        while (num % 3 == 0)
            num /= 3;
        return num == 1;

    }
}


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

public class Solution {
    public static void main(String[] args) {
        Solution solution = new Solution();
        solution.solve();
    }

    private static int n, l;
    private static long[] cost;
    private static long[] total;
    public void solve() {
        InputReader in = new InputReader();

        n = in.nextInt();
        l = in.nextInt();
        cost = new long[n+1];
        int size = 1 << (n-1);
        if(l > size) {
            size = l;
        }
        total = new long[size+1];
        Arrays.fill(total, Long.MAX_VALUE);

        for(int i = 1; i <= n; i++) {
            cost[i] = in.nextLong();
        }
        for(int i = n; i > 1; i--) {
            if(cost[i-1] > cost[i]) {
                cost[i-1] = cost[i];
                int r1 = 1 << (i-1);
                int r2 = i == 1 ? 0 : 1 << (i-2);

                for(int j = r1; j >= r2; j--) {
                    total[j] = cost[i];
                }
            }
            if(cost[i-1]*2 < cost[i]) {
                cost[i] = cost[i-1]*2;
            }
            total[1 << (i-1)] = cost[i];
        }
        //System.out.println(String.join(",", Arrays.toString(cost)));

        System.out.println(calculateMin(l));
    }

    private static long calculateMin(int c) {
        if(c == 1) {
            return cost[1];
        }
        for(int i = 0; i < n; i++) {
            int index = c - (1 << i);
            //System.out.println("c:"+c+"|i:"+i+"|index:"+index+" - "+Arrays.toString(total));
            if(index >= 1) {
                if(total[index] + cost[i+1] < total[c]) {
                    if(total[index] == Long.MAX_VALUE) {
                        total[c] = calculateMin(index) + cost[i+1];
                    } else {
                        total[c] = total[index] + cost[i+1];
                    }
                }
            } else {
                break;
            }

        }
        //System.out.println("c"+c+" - total:"+total[c]);
        return total[c];
    }

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

        public InputReader() {
            reader = new BufferedReader(new InputStreamReader(System.in), 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());
        }

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

    }
}


import java.util.Scanner;

public class partyLemonade {

	public static int minPrice(int[] price,int[] vol,int volreq)
	{
		int[][] arr=new int[vol.length][volreq+1];

		for(int i=0;i<arr.length;i++)
		{
			for(int j=0;j<arr[0].length;j++)
			{
				if(i==0)
					{
						arr[i][j]=j*price[i];
						//System.out.println("i=0  " + arr[i][j]);
					}

				else if(j==0)
					arr[i][j]=0;

				else {
					if(j>=vol[i])
						arr[i][j]=Math.min(arr[i-1][j], price[i]+arr[i][j-vol[i]]);
					else
						arr[i][j]=Math.min(arr[i-1][j], price[i]);
					/*System.out.println("i j arr[i][j]  "+i+" "+j +" arr  "+arr[i][j]);*/
				}
			}
		}

		return arr[vol.length-1][volreq];
	}

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

		int n=s.nextInt();
		int volreq=s.nextInt();
		int[] price=new int[n];
		for(int i=0;i<n;i++) {
			price[i]=s.nextInt();
		}

		int[] vol=new int[n];

		for(int i=0;i<n;i++)
			vol[i]=(int)Math.pow(2, i);

		System.out.println(minPrice(price, vol, volreq));
	}

}


import java.util.Scanner;

public class D {

public static int falta(int ha){
    switch(ha){
        case 11: case 9: case 8: case 7: case 6: case 5: case 4: case 3: case 2: case 1:
            return 4;
        case 10:
            return 15;
        default:
            return 0;
    }
}
    public static void main(String[] args) {
        int cases;
        String[] lol;
        String aux;
        Scanner koko = new Scanner(System.in);
        while(true){
        if(koko.hasNext()){
        aux=koko.nextLine();
        lol=aux.split(" ");
        cases=Integer.parseInt(lol[0]);
        int pasar = cases-10;
            System.out.println(falta(pasar));
        }}
    }

}


import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;

public class cfs159div2 {
	public static void main(String args[]) throws IOException
	{
		BufferedReader br=new BufferedReader(new InputStreamReader(System.in));

		String s=br.readLine();
		String[] numArray=s.split("\\s+");
		int n=Integer.parseInt(numArray[0]);
		int dev=Integer.parseInt(numArray[1]);
		int soc=Integer.parseInt(numArray[2]);
		s=br.readLine();
		String[] numArray2=s.split("\\s+");
		int[] socArr=new int[n];
		for(int i=0;i<n;i++)
		{
			socArr[i]=Integer.parseInt(numArray2[i]);

		}

		Arrays.sort(socArr);
		int res=soc;
		int count=0;
		while(res<dev && count<n && count< soc)
		{
			res+=socArr[n-1-count]-1;
			count++;
			soc+=socArr[n-1-count]-1;
		}

		if(res>=dev || count==0)
		{
			System.out.println(count);

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

	}

}


import java.io.*;
import java.lang.*;
import static java.lang.Math.max;
import static java.lang.Math.pow;
import java.lang.reflect.*;
import java.math.BigInteger;
import static java.math.BigInteger.*;
import java.security.CodeSource;
import java.security.KeyStore;
import java.util.*;
import java.util.jar.JarEntry;
import java.util.jar.JarFile;
import java.util.logging.Level;
import java.util.logging.Logger;

// https://netbeans.org/kb/73/java/editor-codereference_ru.html#display

public class Main {

    private void run() throws Exception {
        err = System.err;
        boolean oj = true;
        try {
            oj = System.getProperty("MYLOCAL") == null;
        } catch (Exception e) {
        }

        if( oj ){
            sc = new FastScanner(new InputStreamReader(System.in));
            out = new PrintWriter(new OutputStreamWriter(System.out));
        }
        else{
            try {
                sc = new FastScanner(new FileReader("input.txt"));
                out = new PrintWriter(new FileWriter("output.txt"));
            } catch ( IOException e) {
                MLE();
            }
        }
        solve();

        out.flush();
    }

    FastScanner sc;
    PrintWriter out;
    PrintStream err;

    void MLE(){
        int[][] arr = new int[1024*1024][];
        for (int i = 0; i < arr.length; i++) {
            arr[i] = new int[1024*1024];
        }
    }

    private int getBit(int msk, int pos) {
        return (msk >> pos) & 1;
    }

    class FastScanner {

        BufferedReader br;
        StringTokenizer st;

        FastScanner(InputStreamReader reader) {
            br = new BufferedReader(reader);
            st = new StringTokenizer("");
        }

        String next() {
            while( !st.hasMoreElements() )
                try {
                    st = new StringTokenizer(br.readLine());
                } catch (IOException ex) {
                    MLE();
                }
            return st.nextToken();
        }

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

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

    //-------------------------------------------------------------------//

    long f( int n ){ return n <= 1? 1 : n * f(n-1); }

    long C( int m, int n ){
        if(!( m <= n ))
            MLE();
        return f(n) / f(m) / f(n-m);
    }

    class BF{

        int nMax, ans, sz;
        int[] ord;

        BF( int _nMax ){
            nMax = _nMax;
            ord = new int[100];
        }

        void f( int val ){
            if( val == nMax + 1 ){
                if( sz == 0 ) return;
                int[] arr = Arrays.copyOf(ord, sz);

                for( int a : arr )
                for (int b : arr )
                    if( Arrays.binarySearch(arr, a^b) < 0 )
                        return;

                ++ans;
                //show(arr);err.println();
                solveGaus(arr);
            }
            else{
                ord[sz++] = val;
                f(val+1);
                --sz;

                f(val+1);
            }
        }

        int bf(){
            f(0);
            return ans;
        }

        void solveGaus(int[] arr) {

            err.println( "ans: " + ans );
            show(arr);err.println();

            int[] jj = new int[100];
            int n = arr.length;
            int j = 25;
            for( int i = 0; i < n; ++i ){
                cyc:
                for( ; 0 <= j; --j ){
                    for( int ii = i; ii < n; ++ii ){
                        if( ((1<<j)&arr[ii]) != 0 ){
                            int t = arr[i];
                            arr[i] = arr[ii];
                            arr[ii] = t;
                            break cyc;
                        }
                    }
                }

                if( j == -1 ){
                    arr = Arrays.copyOf(arr, i);
                    break;
                }

                jj[i] = j;
                for( int ii = i + 1; ii < n; ++ii ){
                    if( ((1<<j)&arr[ii]) != 0 ){
                        arr[ii] ^= arr[i];
                    }
                }
            }

            n = arr.length;
            if( j != -1 )
            for( int i = n-1; 0 <= i; --i ){
                j = jj[i];
                while( ((1<<j)&arr[i]) != 0  ) --j;
                for( int ii = i - 1; 0 <= ii; --ii ){
                    if( ((1<<j)&arr[ii]) != 0 ){
                        arr[ii] ^= arr[i];
                    }
                }
            }

            show(arr);err.println( "--------------\n" );

        }

        private void show(int[] arr) {
            for( int v : arr ){
                err.printf( "%5s\n", Integer.toBinaryString(v) );
            }
        }

    }

    final long mod = (long)1e9 + 7;
    int n;

    void solve(){
//        int p = 5;
//        out.println( new BF((1<<p)-1).bf() );
//        out.println( cleaver(p) );
//        out.println( getDP(0,p-1) );

        {
            n = sc.nextInt();
            int p = 31 - Integer.numberOfLeadingZeros(n);
            out.println( getAns(0,p) );
        }

//        for( n = 1; n <= 15; ++n ){
//            int p = 31 - Integer.numberOfLeadingZeros(n);
//            out.println( getAns(0,p) );
//
//            out.println( new BF(n).bf() );
//            out.println();
//            out.flush();
//
//        }
    }

//    long getAns( int cntOnes, int pos ){
//        if( pos == -1 ) return 1;
//
//        long ans = 0;
//        if( getBit(n,pos) == 1 ){
//            ans += getDP( cntOnes, pos - 1);
//            ans += getAns( cntOnes+1, pos - 1);
//            ans += getAns( cntOnes, pos - 1) * ( (1<<cntOnes) - 1 );
//        }
//        else{
//            ans += getAns( cntOnes, pos - 1);
//        }
//        err.printf( "%d %d %d\n", cntOnes, pos, ans );
//        return ans;
//    }

    long getAns( int cntOnes, int pos ){
        if( pos == -1 ) return 1;

        long ans = 0;
        // add vector
        if( getBit(n,pos) == 1 ){
            ans += getAns( cntOnes+1, pos - 1);
        }

        // don't add vector
        if( cntOnes == 0 ){
            if( getBit(n,pos) == 1 )
                ans += getDP( cntOnes, pos - 1 );
            else
                ans += getAns( cntOnes, pos - 1 );
        }
        else{
            if( getBit(n,pos) == 1 ){
                // set 0
                ans += getDP( cntOnes, pos - 1) * (1<<(cntOnes-1)) % mod;
                // set 1
                ans += getAns( cntOnes, pos - 1) * (1<<(cntOnes-1)) % mod;
            }
            else{
                // set 0
                ans += getAns( cntOnes, pos - 1) * (1<<(cntOnes-1)) % mod;
            }
        }
        err.printf( "%d %d %d\n", cntOnes, pos, ans );
        return ans % mod;
    }

    long getDP( int cntOnes, int pos ){
        if( pos == -1 ) return 1;
        long ans = 0;
        ans += getDP( cntOnes+1, pos - 1);
        ans += getDP( cntOnes, pos - 1) * (1<<cntOnes) % mod;
        return ans % mod;
    }

    @SuppressWarnings("empty-statement")
    long cleaver( int pow2 ){
        long ans = 1;

        for (int msk = 1; msk < (1<<pow2); msk++) {
            int b = 0, e = 30;
            for( ; (msk & (1<<e)) == 0; e-- );
            for( ; (msk & (1<<b)) == 0; b++ );

            long curAns = 1;
            for( int pos = 30, cnt1 = 0; 0 <= pos; --pos ){
                if( getBit(msk,pos)==1 ){
                    ++cnt1;
                }
                else{
                    curAns *= 1L << cnt1;
                    curAns %= mod;
                }
            }
            ans += curAns;
            ans %= mod;
        }

        return ans;
    }

    void fff(){
            for (int c = 1; c <= 10; c++) {
            double ans = 1;
            for (int lp = 1; lp <= c; lp++)
                for (int cntBaseVar = 1; cntBaseVar <= lp; cntBaseVar++) {
                    double cur =
                        C(cntBaseVar - 1, lp - 1) *
                        //pow(2, (c - lp) * cntBaseVar);
                        pow( pow(2,(c-lp)), cntBaseVar);
                    ans += cur;
                    err.println( lp +" "+ cntBaseVar +" "+ cur );
                }

            err.println("ans: " + ans);
            err.println();
        }
    }

}


import java.util.Scanner;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
public class Main {

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

		String s = sc.next();
		String x[] = {"Danil", "Olya", "Slava", "Ann","Nikita","Danil", "Olya", "Slava", "Ann","Nikita"};
		int size = x.length;
		int count=0;
		for (int i=0;i<size;i++) {
			Pattern p = Pattern.compile(x[i]);
			Matcher m = p.matcher(s);
			if (m.find()) {
				for (int j=0;j<s.length();j++) {
					if (s.charAt(j) == x[i].charAt(0)) {
						s = s.substring(0,j).concat(s.substring(x[i].length()));
						count++;
					}
				}
			}
		}
		if (count == 1) {
			System.out.println("YES");
		}
		else {
			System.out.println("NO");
		}

	}
}


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

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

    static void init(InputStream input) {
      reader = new BufferedReader(new InputStreamReader(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 Integer.parseInt(next());
    }

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

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

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

  // static StringBuilder sb = new StringBuilder();
  static long[] ones = {0, 1, 11, 111, 1111, 11111, 111111, 1111111, 11111111, 111111111, 1111111111, 11111111111L, 111111111111L, 1111111111111L, 11111111111111L, 111111111111111L};

  public static void main(String[] args) throws Exception {
    Reader.init(System.in);
    long n = Reader.nextLong();
    long res = decompose(n);
    System.out.println(res);
  }

  public static long decompose(long n) {
    if (n <= 6) {
      return n;
    }
    long numOfDigits = getNumOfDigits(n);
    long lower, upper;
    lower = ones[(int) numOfDigits];
    if (n < lower) {
      upper = lower;
      lower = ones[(int) (numOfDigits - 1)];
    } else if (n > lower) {
      upper = ones[(int) (numOfDigits + 1)];
    } else {
      return numOfDigits;
    }
    // System.out.printf("%sn=%d lower=%d upper=%d\n", spaces(indent), n, lower, upper);
    long resLower = decompose(n % lower) + (n / lower) * getNumOfDigits(lower);
    long resUpper = Long.MAX_VALUE;
    if (upper - n < n) {
      resUpper = decompose(upper - n) + getNumOfDigits(upper);
    }
    return Math.min(resLower, resUpper);
  }

  public static long getNumOfDigits(long n) {
    return (long) Math.floor(Math.log10(n)) + 1;
  }

  // public static String spaces(int n) {
  //   sb.setLength(0);
  //   for (int i = 0; i < n; i++) {
  //     sb.append("  ");
  //   }
  //   return sb.toString();
  // }
}


//package codeforces.contests;

import t17.numbers.Numbers;

import java.io.*;
import java.util.InputMismatchException;
import java.util.Random;

/**
 * @author tainic on Mar 30, 2019
 */
public class D {

    private static boolean LOCAL;
    static {
        try { LOCAL = "aurel".equalsIgnoreCase(System.getenv().get("USER")); } catch (Exception e){}
    }

    private static final String TEST =
        "1 10\n" +
        "5 3";

    void solve(InputReader in, PrintWriter out) {
        long n = in.nextInt();
        long k = in.nextInt();
        long a = in.nextInt();
        long b = in.nextInt();
        long min = Integer.MAX_VALUE, max = -1;
        for (int t = 0; t < n; t++) {
            long L = (k * t + k + a + b) % (n * k);
            min = Math.min(min, n * k / Numbers.gcd(n * k, L));
            max = Math.max(max, n * k / Numbers.gcd(n * k, L));

            L = (k * t + k - a + b) % (n * k);
            min = Math.min(min, n * k / Numbers.gcd(n * k, L));
            max = Math.max(max, n * k / Numbers.gcd(n * k, L));

            L = (k * t + k - a + k - b) % (n * k);
            min = Math.min(min, n * k / Numbers.gcd(n * k, L));
            max = Math.max(max, n * k / Numbers.gcd(n * k, L));

            L = (k * t + k + a - b) % (n * k);
            min = Math.min(min, n * k / Numbers.gcd(n * k, L));
            max = Math.max(max, n * k / Numbers.gcd(n * k, L));
        }
        out.println(min + " " + max);
    }

    //region util
    static class Util {

        private static final Random R = new Random();

        public static void sort(int[] a) {
            sort(a, 0, a.length - 1);
        }

        private static void sort(int[] a, int from, int to) {
            if (from >= to) {
                return;
            }

            // partition
            int pivotIndex = R.nextInt(to - from + 1) + from;
            int pivot = a[pivotIndex];
            // maintain this invariant, at each step i:
            // a[j] <  pivot, for j = fromIndex to lt - 1
            // a[j] == pivot, for j = lt to i - 1
            // a[j] >  pivot, for j = gt + 1 to toIndex
            int lt = from;
            int gt = to;
            int i = lt;
            while (i <= gt) {
                int cmp = a[i] - pivot;
                if (cmp < 0) {
                    swap(a, i, lt);
                    i++;
                    lt++;
                } else if (cmp > 0) {
                    swap(a, i, gt);
                    gt--;
                } else {
                    i++;
                }
            }

            // sort left and right
            sort(a, from, lt - 1);
            sort(a, gt + 1, to);
        }

        public static int findFirst(int[] a, int key) {
            return findFirstOrLast(a, key, 0, a.length - 1, -1);
        }

        public static int findLast(int[] a, int key) {
            return findFirstOrLast(a, key, 0, a.length - 1, 1);
        }

        public static int findFirstOrLast(int[] a, int key, int fromIndex, int toIndex, int dir) {
            int left = fromIndex;
            int right = toIndex;
            while (left <= right) {
                int mid = (left + right) >>> 1;
                int cmp = key - a[mid];
                if (cmp > 0) {
                    left = mid + 1;
                } else if (cmp < 0) {
                    right = mid - 1;
                } else if (dir == -1 && mid > fromIndex && a[mid - 1] == key) {
                    right = mid - 1;
                } else if (dir == 1 && mid < toIndex && a[mid + 1] == key) {
                    left = mid + 1;
                } else {
                    return mid;
                }
            }
            return -left - 1;
        }

        public static void swap(int[] a, int i, int j) {
            if (i != j) {
                int ai = a[i];
                a[i] = a[j];
                a[j] = ai;
            }
        }

        public static int[] readInts(InputReader in, int k) {
            int[] a = new int[k];
            for (int i = 0; i < k; i++) {
                a[i] = in.nextInt();
            }
            return a;
        }

    }
    //endregion

    //region main
    public static void main(String[] args) throws Exception {
        long t = System.currentTimeMillis();

        try (
            InputReader in = new StreamInputReader(!LOCAL ? System.in : new ByteArrayInputStream(TEST.getBytes()));
            PrintWriter out = new PrintWriter(new BufferedOutputStream(System.out, 2048), false)
        ) {
            new D().solve(in, out);
        }

        System.err.println("time: " + (System.currentTimeMillis() - t) + "ms");
    }
    //endregion

    //region fast io
    abstract static class InputReader implements AutoCloseable {

        public abstract int read();

        public int nextInt() {
            int c = read();
            while (isSpaceChar(c)) {
                c = read();
            }
            int sgn = 1;
            if (c == '-') {
                sgn = -1;
                c = read();
            }
            int 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 long nextLong() {
            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 String next() {
            int c = read();
            while (isSpaceChar(c)) {
                c = read();
            }
            StringBuilder res = new StringBuilder();
            do {
                res.appendCodePoint(c);
                c = read();
            } while (!isSpaceChar(c));
            return res.toString();
        }

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

    static class StreamInputReader extends InputReader {

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

        public StreamInputReader(InputStream stream) {
            this(stream, 2048);
        }

        public StreamInputReader(InputStream stream, int bufSize) {
            this.stream = stream;
            this.buf = new byte[bufSize];
        }

        @Override
        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++];
        }

        @Override
        public void close() throws Exception {
            stream.close();
        }

    }
    //endregion

    //region imports
    //endregion

}


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

public class A {
    FastScanner in;
    PrintWriter out;

    int gcd(int x, int y) {
        return x == 0 ? y : gcd(y % x, x);
    }

    int getCost(int n, boolean[] already) {
        boolean[] z = new boolean[n];
        for (int x = 3; x < n; x++) {
            if (!already[x]) {
                continue;
            }
            int g = gcd(n, x);
            int add = n / g;
            for (int i = 0; i < n; i += add) {
                z[i] = true;
            }
        }
        int cost = 0;
        for (int i = 0; i < n; i++) {
            cost += z[i] ? 0 : 1;
        }
        return cost;
    }

    int getAns(int maxN, int k) {
        int res = 0;
        boolean[] already = new boolean[maxN + 1];
        for (int it = 0; it < k; it++) {
            int mincost = Integer.MAX_VALUE;
            int minVal = -1;
            for (int n = 3; n <= maxN; n++) {
                if (already[n]) {
                    continue;
                }
                int cost = getCost(n, already);
                if (cost < mincost) {
                    mincost = cost;
                    minVal = n;
                }
            }
            already[minVal] = true;
            res += mincost;
        }
        return res;
    }

    void solve() {
        out.println(getAns(in.nextInt(), in.nextInt()));
    }

    void solve123() {
        for (int n = 3; n <= 50; n++) {
            boolean[] z = new boolean[n];
            for (int x = 3; x < n; x++) {
                int g = gcd(n, x);
                int add = n / g;
                for (int i = 0; i < n; i += add) {
                    z[i] = true;
                }
            }
            int cost = 0;
            for (int i = 0; i < n; i++) {
                cost += z[i] ? 0 : 1;
            }
            System.err.println(n + " -> " + cost);
        }
    }

    void run() {
        try {
            in = new FastScanner(new File("A.in"));
            out = new PrintWriter(new File("A.out"));

            solve();

            out.close();
        } catch (FileNotFoundException e) {
            e.printStackTrace();
        }
    }

    void runIO() {

        in = new FastScanner(System.in);
        out = new PrintWriter(System.out);

        solve();

        out.close();
    }

    class FastScanner {
        BufferedReader br;
        StringTokenizer st;

        public FastScanner(File f) {
            try {
                br = new BufferedReader(new FileReader(f));
            } catch (FileNotFoundException e) {
                e.printStackTrace();
            }
        }

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

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

        boolean hasMoreTokens() {
            while (st == null || !st.hasMoreTokens()) {
                String s = null;
                try {
                    s = br.readLine();
                } catch (IOException e) {
                    e.printStackTrace();
                }
                if (s == null)
                    return false;
                st = new StringTokenizer(s);
            }
            return true;
        }

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

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

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

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


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

public class Codeforces1208G {

	public static void main(String[] args) throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		StringTokenizer st = new StringTokenizer(br.readLine());
		int n = Integer.parseInt(st.nextToken());
		int k = Integer.parseInt(st.nextToken());

		if (k == 1) {
			System.out.println(3);
		}
		else {
			int[] phitable = new int[n+1];
			for (int i = 1; i <= n; i++) {
				phitable[i] += i;
				for (int j = 2; j <= n/i; j++) {
					phitable[i*j] -= phitable[i];
				}
			}

			sort(phitable);
			long ans = 0;
			for (int i = 1; i <= (k+2); i++) {
				ans += (long) phitable[i];
			}
			System.out.println(ans);
		}

	}

	public static void sort(int[] array) {
    	int N import java.io.*;
import java.util.*;

public class Codeforces1208G {

	public static void main(String[] args) throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		StringTokenizer st = new StringTokenizer(br.readLine());
		int n = Integer.parseInt(st.nextToken());
		int k = Integer.parseInt(st.nextToken());

		if (k == 1) {
			System.out.println(3);
		}
		else {
			int[] phitable = new int[n+1];
			for (int i = 1; i <= n; i++) {
				phitable[i] += i;
				for (int j = 2; j <= n/i; j++) {
					phitable[i*j] -= phitable[i];
				}
			}

			sort(phitable);
			long ans = 0;
			for (int i = 1; i <= (k+2); i++) {
				ans += (long) phitable[i];
			}
			System.out.println(ans);
		}

	}

	public static void sort(int[] array) {
    	int N = array.length;
    	if (N != 1) {
    		int[] firstHalf = Arrays.copyOfRange(array, 0, N/2);
    		sort(firstHalf);
        	int[] secondHalf = Arrays.copyOfRange(array, N/2, N);
        	sort(secondHalf);
        	int firstCounter = 0;
        	int secondCounter = 0;
        	for (int i = 0; i < N; i++) {
        		if (firstCounter == N/2) {
        			array[firstCounter+secondCounter] = secondHalf[secondCounter];
        			secondCounter++;
        		}
        		else if ((secondCounter == N-N/2) || firstHalf[firstCounter] <= secondHalf[secondCounter]) {
        			array[firstCounter+secondCounter] = firstHalf[firstCounter];
        			firstCounter++;
        		}
        		else {
        			array[firstCounter+secondCounter] = secondHalf[secondCounter];
        			secondCounter++;
        		}
        	}
    	}
    }

}= array.length;
    	if (N != 1) {
    		int[] firstHalf = Arrays.copyOfRange(array, 0, N/2);
    		sort(firstHalf);
        	int[] secondHalf = Arrays.copyOfRange(array, N/2, N);
        	sort(secondHalf);
        	int firstCounter = 0;
        	int secondCounter = 0;
        	for (int i = 0; i < N; i++) {
        		if (firstCounter == N/2) {
        			array[firstCounter+secondCounter] = secondHalf[secondCounter];
        			secondCounter++;
        		}
        		else if ((secondCounter == N-N/2) || firstHalf[firstCounter] <= secondHalf[secondCounter]) {
        			array[firstCounter+secondCounter] = firstHalf[firstCounter];
        			firstCounter++;
        		}
        		else {
        			array[firstCounter+secondCounter] = secondHalf[secondCounter];
        			secondCounter++;
        		}
        	}
    	}
    }

}


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

public class C200 {
    public static void main(String[] args) throws IOException {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        StringTokenizer st;

        st = new StringTokenizer(br.readLine());
        long a = Long.parseLong(st.nextToken());
        long b = Long.parseLong(st.nextToken());
        long count = 0;
        while (a != 0) {
            long gcd = gcd(a, b);
            a /= gcd;
            b /= gcd;
            if (a >= b) {
                long x = a / b;
                a -= x * b;
                count += x;
            } else {
                long x = b / (a + 1) + Math.min(1, b % (a + 1));
                b -= x * a;
                count += x;
            }
        }
        System.out.println(count);
    }

    private static long gcd(long a, long b) {
        if (a < b) {
            return gcd(b, a);
        }

        while (b != 0) {
            long temp = a;
            a = b;
            b = temp % b;
        }
        return a;
    }
}


import java.io.IOException;
import java.io.InputStream;
import java.util.InputMismatchException;
import java.util.HashMap;

public class B381{

	HashMap<String,Integer> day = new HashMap<String,Integer>();

	void solve()
	{
		day.put("sunday",0);
		day.put("monday",1);
		day.put("tuesday",2);
		day.put("wednesday",3);
		day.put("thursday",4);
		day.put("friday",5);
		day.put("saturday",6);
		int x = -day.get(ns()) + day.get(ns());
		System.out.println(x==0 || x==2 || x==3 || x==-4 || x==5 ? "YES":"NO");
	}

	public static void main(String[] args){new B381().solve();}

	byte[] bufferArray = new byte[1024];
	int bufLength = 0;
	int bufCurrent = 0;
	InputStream inputStream = System.in;

	int nextByte()
	{
		if(bufCurrent>=bufLength)
		{
			bufCurrent = 0;
			try
			{bufLength = inputStream.read(bufferArray);}
			catch(IOException e)
			{ throw new InputMismatchException();}
			if(bufLength<=0)
				return -1;
		}
		return bufferArray[bufCurrent++];
	}

	boolean isSpaceChar(int x)
	{return (x<33 || x>126);}

	boolean isDigit(int x)
	{return (x>='0' && x<='9');}

	int nextNonSpace()
	{
		int x;
		while((x=nextByte())!=-1 && isSpaceChar(x));
		return x;
	}

	int ni()
	{
		int ans = 0;
		int sign = 1;
		int x = nextNonSpace();
		if(x=='-')
		{
			sign = -1;
			x = nextByte();
		}
		while(!isSpaceChar(x))
		{
			if(isDigit(x))
			{
				ans = ans*10 + x -'0';
				x = nextByte();
			}
			else
				throw new InputMismatchException();
		}
		return sign*ans;
	}

	long nl()
	{
		long ans = 0;
		long sign = 1;
		int x = nextNonSpace();
		if(x=='-')
		{
			sign = -1;
			x = nextByte();
		}
		while(!isSpaceChar(x))
		{
			if(isDigit(x))
			{
				ans = ans*10 + x -'0';
				x = nextByte();
			}
			else
				throw new InputMismatchException();
		}
		return sign*ans;
	}

	String ns()
	{
		StringBuilder sb = new StringBuilder();
		int x = nextNonSpace();
		while(!isSpaceChar(x))
		{
			sb.append((char)x);
			x = nextByte();
		}
		return sb.toString();
	}

	String nL()
	{
		StringBuilder sb = new StringBuilder();
		int x = nextNonSpace();
		while(x==32 || !isSpaceChar(x))
		{
			sb.append((char)x);
			x = nextByte();
		}
		return sb.toString();
	}

	char nc()
	{ return (char)nextNonSpace();}

	double nd()
	{ return (double)Double.parseDouble(ns()); }

	char[] ca()
	{ return ns().toCharArray();}

	char[] ca(int n)
	{
		char[] ans = new char[n];
		int p =0;
		int x = nextNonSpace();
		while(p<n)
		{
			ans[p++] = (char)x;
			x = nextByte();
		}
		return ans;
	}

	int[] ia(int n)
	{
		int[] ans = new int[n];
		for(int i=0;i<n;i++)
			ans[i]=ni();
		return ans;
	}

	long[] la(int n)
	{
		long[] ans = new long[n];
		for(int i=0;i<n;i++)
			ans[i] = nl();
		return ans;
	}

}


import java.util.*;
import java.io.*;
public class TestClass
{
	public static void main(String[] args) throws IOException
	{
		Scanner sc=new Scanner(System.in);
		int a1=sc.nextInt();
		int b1=sc.nextInt();
		int c1=sc.nextInt();
		int a2=sc.nextInt();
		int b2=sc.nextInt();
		int c2=sc.nextInt();

		if( (a1/a2)!=(b1/b2)  )
			System.out.println("1");
		else if( (a1/a2)==(b1/b2)  && (b1/b2)==(c1/c2)  )
			System.out.println("-1");
		else
			System.out.println("0");
	}
}


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

public class Main {

	BufferedReader in;
	StringTokenizer str = null;
	PrintWriter out;

	private String next() throws Exception{
		while (str == null || !str.hasMoreElements())
			str = new StringTokenizer(in.readLine());
		return str.nextToken();
	}

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

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

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

	final long MOD = (long)(1e9) + 7;
	long []f;

	final int MAXN = 100010;

	public void run() throws Exception{
		in =  new BufferedReader(new InputStreamReader(System.in));
		out = new PrintWriter(System.out);
		int n = nextInt(), m = nextInt(), g = nextInt();
		if (n == 0) {
			if (g == 0) {
				out.println(1);
			}else {
				out.println(0);
			}
			out.close();
			return;
		}
		if (m == 0) {
			if (n % 2 == 0) {
				out.println(1);
			}else {
				out.println(0);
			}
			out.close();
			return;
		}
		f = new long[MAXN];
		f[0] = 1;
		for(int i = 1; i < MAXN; ++i) f[i] = (f[i-1] * i) % MOD;
		long ret = 0;
		for(int i = 0; i <= n; ++i) {
			if (i % 2 == 0) {
				if (m - 1 > 0 || n - i > 0) {
					if (g == 0) ret += C(m - 1, n - i + m - 1);
				}else {
					if (g == 1) ret += 1;
				}
			}else {
				if (m - 1 > 0 || n - i > 0) {
					if (g == 1) ret += C(m - 1, n - i + m - 1);
				}else {
					if (g == 0) ret += 1;
				}
			}
			if (ret >= MOD) ret -= MOD;
		}
		out.println(ret);
		out.close();
	}

	private long C(int m, int n){
		long ret = f[n];
		ret *= inv((f[m] * f[n - m]) % MOD, MOD);
		return ret;
	}

	private long inv(long a, long b) {
		return pow(a, b - 2);
	}

	private long pow(long x, long p) {
		long ret = 1;
		while(p > 0) {
			if (p % 2 == 1) ret = (ret * x) % MOD;
			x = (x * x) % MOD;
			p >>= 1;
		}
		return ret;
	}

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


import java.io.*;
import java.util.Scanner;
public class Main {
public static void main(String args[])throws IOException
{
	Scanner s1=new Scanner(System.in);
	int n=Integer.parseInt(s1.next());
	int k=Integer.parseInt(s1.next());
	long cows[]=new long[n];
	long counter=0;
	for(int i=0;i<n;i++)
		cows[i]=i;
	int j=0;
	for(int i=0;i<k;i++)
	{
		if(cows[j]==j && j!=n-1-j)
		{
		long temp=cows[j];
		cows[j]=cows[n-1-j];
		cows[n-1-j]=temp;
		j++;
		}
		if(j>=n)
			break;
	}
	for(int i=0;i<n;i++)
	{
		for(int z=i+1;z<n;z++)
		{
			if(cows[i]>cows[z])
				counter++;
		}
	}
	/*
	for(int i=0;i<n;i++)
	{
		if(cows[i]!=i)
			counter+=cows[i];
			else if(n!=1)
				counter+=j;
	}*/
	System.out.println(counter);
}
}


import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import java.io.PrintWriter;
import java.util.StringTokenizer;

public class LittleElephantandMagicSquare {

  static BufferedReader in;
  static PrintWriter out;
  static StringTokenizer tok;

  static void solve() throws Exception {
    int[][] m = new int[3][3];
    for (int i = 0; i < 3; i++)
      m[i] = nextIntArray(3, 0);
    int t = m[0][1] + m[0][2];
    for (int x = 1; x <= 100000; x++)
      for (int y = 1, z = t - 1; y < t && z > 0; y++, z--) {
        m[0][0] = x;
        m[1][1] = y;
        m[2][2] = z;
        if (check(m)) {
          print(m);
          return;
        }
      }
  }

  static boolean check(int[][] m) {
    int x = m[0][0] + m[1][1] + m[2][2];
    if (x != m[0][2] + m[1][1] + m[2][0])
      return false;
    for (int i = 0; i < 3; i++) {
      int y = 0;
      for (int j = 0; j < 3; j++)
        y += m[i][j];
      if (x != y)
        return false;
    }
    for (int j = 0; j < 3; j++) {
      int y = 0;
      for (int i = 0; i < 3; i++)
        y += m[i][j];
      if (x != y)
        return false;
    }
    return true;
  }

  static void print(int[][] m) {
    for (int i = 0; i < 3; i++) {
      for (int j = 0; j < 3; j++)
        out.print(m[i][j] + " ");
      out.println();
    }
  }

  public static void main(String args[]) {
    try {
      in = new BufferedReader(new InputStreamReader(System.in));
      out = new PrintWriter(new OutputStreamWriter(System.out));
      solve();
      in.close();
      out.close();
    } catch (Throwable e) {
      e.printStackTrace();
      System.exit(1);
    }
  }

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

  static int[] nextIntArray(int len, int start) throws IOException {
    int[] a = new int[len];
    for (int i = start; i < len; i++)
      a[i] = nextInt();
    return a;
  }

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

  static long[] nextLongArray(int len, int start) throws IOException {
    long[] a = new long[len];
    for (int i = start; i < len; i++)
      a[i] = nextLong();
    return a;
  }

  static String next() throws IOException {
    while (tok == null || !tok.hasMoreTokens()) {
      tok = new StringTokenizer(in.readLine());
    }
    return tok.nextToken();
  }

}


import java.util.*;
import java.io.*;
public class TableCF232B {

    /************************ SOLUTION STARTS HERE ************************/

    static class MM {       // MM (Modular Math) class
        static final long mod = (long) (1e9) + 7; // Default
        static long sub(long a, long b) {return (a - b  + mod) % mod;}
        static long mul(long a, long b) {return (a * b ) % mod;}
        static long add(long a, long b) {return (a + b) % mod;}
        static long div(long a, long b) {return mul(a, modInverse(b));}
        static long modInverse(long n)  {return modPow(n, mod - 2);} // Fermat's little theorem
        static long modPow(long a , long b) {
            long pow = 1;
            while(b > 0) {
                if((b & 1L) == 1)
                    pow = ((pow * a) % mod);

                a = ((a * a) % (mod));
                b >>= 1;
            }
            return pow;
        }
    }

    static final int MAX = 128;
    static long fact[] = new long[MAX];
    static long invFact[] = new long[MAX];
    static {
        fact[0] = fact[1] = 1;
        for (int i = 2; i < MAX; i++)
            fact[i] = MM.mul(i, fact[i - 1]);
        for (int i = 0; i < MAX; i++)
            invFact[i] = MM.modInverse(fact[i]);
    }

    static long nCr(int n, int r) { // Precompute inv Factorials (Dont compute every time)
        return MM.mul(fact[n], MM.mul(invFact[r], invFact[n - r]));
    }

    static long m;
    static int n;
    static long memo[][];
    static long rec(int idx , int k) {
        if(idx == n)
            return k == 0 ? 1 : 0;
        else if(memo[idx][k] != -1)
            return memo[idx][k];
        else {
            long pow = (m / n) + (idx < m % n ? 1 : 0);
            long sum = 0;
            for(int i = 0; i <= Math.min(k , n); i++)
                sum = MM.add(sum, MM.mul(rec(idx + 1, k - i), MM.modPow(nCr(n, i), pow)));

            return memo[idx][k] = sum;
        }
    }

    private static void solve() {

        n = nextInt();
        m = nextLong();
        int k = nextInt();

        memo = new long[n][k + 1];
        for(long temp[] : memo) Arrays.fill(temp, -1);

        println(rec(0, k));

    }

    /************************ SOLUTION ENDS HERE ************************/

    /************************ TEMPLATE STARTS HERE **********************/

    public static void main(String[] args) throws IOException {
        reader = new BufferedReader(new InputStreamReader(System.in));
        writer = new PrintWriter(new BufferedWriter(new OutputStreamWriter(System.out)), false);
        st     = null;
        solve();
        reader.close();
        writer.close();
    }

    static BufferedReader reader;
    static PrintWriter    writer;
    static StringTokenizer st;

    static String next()
    {while(st == null || !st.hasMoreTokens()){try{String line = reader.readLine();if(line == null){return null;}
    st = new StringTokenizer(line);}catch (Exception e){throw new RuntimeException();}}return st.nextToken();}
    static String nextLine()  {String s=null;try{s=reader.readLine();}catch(IOException e){e.printStackTrace();}return s;}
    static int    nextInt()   {return Integer.parseInt(next());}
    static long   nextLong()  {return Long.parseLong(next());}
    static double nextDouble(){return Double.parseDouble(next());}
    static char   nextChar()  {return next().charAt(0);}
    static int[]  nextIntArray(int n)         {int[] a= new int[n];   int i=0;while(i<n){a[i++]=nextInt();}  return a;}
    static long[] nextLongArray(int n)        {long[]a= new long[n];  int i=0;while(i<n){a[i++]=nextLong();} return a;}
    static int[]  nextIntArrayOneBased(int n) {int[] a= new int[n+1]; int i=1;while(i<=n){a[i++]=nextInt();} return a;}
    static long[] nextLongArrayOneBased(int n){long[]a= new long[n+1];int i=1;while(i<=n){a[i++]=nextLong();}return a;}
    static void   print(Object o)  { writer.print(o);  }
    static void   println(Object o){ writer.println(o);}

    /************************ TEMPLATE ENDS HERE ************************/

}


// program referenced from im_shubh7's solution
import java.util.*;
public class Main {
    public static void main(String[] args) throws IOException {
        Scanner sc = new Scanner(System.in);
        int w = sc.nextInt();
        int h = sc.nextInt();
        long res = 1;
        long div = 998244353;
        for(int i = 0; i<w+h; i++){
            res = ((2*res)+div)%div;
        }
        System.out.println(res);
    }
 }


import java.util.*;
public class Main {

    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int n;
        n = in.nextInt();
        while(n>0){
        if((n%2)>0)
            System.out.println("1");
         else
            System.out.println("2");
         }
    }
}
// 1536360878471


import java.util.Scanner;

public class hack {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n  = sc.nextInt();
		int a = sc.nextInt();
		int b = sc.nextInt();
		int[] arr = new int[n];
		for(int i = 0;i<n;i++)
			arr[i] = sc.nextInt();
		int i = 0;
		int j = n-1;
		int flag = 0;
		int ans = 0;
		for(i = 0;i<n/2;i++){
			if(arr[i] == 0 && arr[j] == 0){
				j--;
				continue;
			}
			if(arr[i] == 1 && arr[j] == 1){
				j--;
				continue;
			}
			if(arr[i] == 1 && arr[j] == 0){
				flag = 1;
				break;
			}
			if(arr[i] == 0 && arr[j] == 1){
				flag = 1;
				break;
			}
			if(arr[i] == 0&& arr[j] == 2){
				j--;
				ans = ans + a;
				continue;
			}
			if(arr[i] == 1 && arr[j] == 2){
				j--;
				ans = ans + b;
				continue;
			}
			if(arr[i] == 2 && arr[j] == 0){
				j--;
				ans = ans + a;
				continue;
			}
			if(arr[i] == 2 && arr[j] == 1){
				j--;
				ans = ans + b;
				continue;
			}
			if(arr[i] == 2 && arr[i] == 2){
				j--;
				ans = ans + 2*Math.min(a, b);
				continue;
			}

		}
		if(n%2 == 0){
			if(flag == 1)
				System.out.println(-1);
			else
				System.out.println(ans);
		}
		else{
			if(flag == 1)
				System.out.println(-1);
			else{
				if(arr[n/2] == 2){
					ans = ans + Math.min(a, b);
				}
				System.out.println(ans);
			}
		}

	}
}
close


import java.io.*;
import java.math.*;
import java.util.*;
public class Chocolate {
	static int n;
	static int[] arr;
	static int[] dp;
	public static void main(String[] args) {

		Scanner sc = new Scanner();
		PrintWriter out = new PrintWriter(System.out);
		n=sc.nextInt();
		arr=new int[n+1];
		for(int i=1;i<=n;i++)
		{
			arr[i]=sc.nextInt();
		}
		dp=new int[n+1];
		System.out.println(calculate(n));
		out.close();
	}

	public static int calculate(int n)
	{
		if(n<=0)
			return 1;
		int ones=0;
		if(arr[n]==1)
			ones++;
		int answer=0;
		int temp=n;
		while(ones<=1)
		{
			if(ones==1)
				answer+=calculate(temp-1);
			temp--;
			if(temp<=0)
				break;
			if(arr[temp]==1)
				ones++;
		}
		return dp[n]=answer;

	}

	public static long pow(long x, long n, long mod) {
		long res = 1;
		for (long p = x; n > 0; n >>= 1, p = (p * p) % mod) {
			if ((n & 1) != 0) {
				res = (res * p % mod);
			}
		}
		return res;
	}

	public static long gcd(long n1, long n2) {
		long r;
		while (n2 != 0) {
			r = n1 % n2;
			n1 = n2;
			n2 = r;
		}
		return n1;
	}

	static class Scanner {
		private byte[] buf = new byte[1024];
		private int curChar;
		private int snumChars;

		public int read() {
			if (snumChars == -1)
				throw new InputMismatchException();
			if (curChar >= snumChars) {
				curChar = 0;
				try {
					snumChars = System.in.read(buf);
				} catch (IOException e) {
					throw new InputMismatchException();
				}
				if (snumChars <= 0)
					return -1;
			}
			return buf[curChar++];
		}

		public String nextLine() {
			int c = read();
			while (isSpaceChar(c))
				c = read();
			StringBuilder res = new StringBuilder();
			do {
				res.appendCodePoint(c);
				c = read();
			} while (!isEndOfLine(c));
			return res.toString();
		}

		public String nextString() {
			int c = read();
			while (isSpaceChar(c))
				c = read();
			StringBuilder res = new StringBuilder();
			do {
				res.appendCodePoint(c);
				c = read();
			} while (!isSpaceChar(c));
			return res.toString();
		}

		public long nextLong() {
			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 int nextInt() {
			int c = read();
			while (isSpaceChar(c))
				c = read();
			int sgn = 1;
			if (c == '-') {
				sgn = -1;
				c = read();
			}
			int 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 int[] nextIntArray(int n) {
			int[] arr = new int[n];
			for (int i = 0; i < n; i++) {
				arr[i] = nextInt();
			}
			return arr;
		}

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

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

		private boolean isEndOfLine(int c) {
			return c == '\n' || c == '\r' || c == -1;
		}
	}
}


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

public class GFG {
	public static void main (String[] args) {
	PrintWriter pw=new PrintWriter(System.out);
	Scanner sc=new Scanner(System.in);
int n=sc.nextInt()
	while(n%4!=0)
	n++;
	pw.print(n);
	pw.close();
	}
}