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

public class practice {
	static class Reader
    {
        final private int BUFFER_SIZE = 1 << 16;
        private DataInputStream din;
        private byte[] buffer;
        private int bufferPointer, bytesRead;

        public Reader()
        {
            din = new DataInputStream(System.in);
            buffer = new byte[BUFFER_SIZE];
            bufferPointer = bytesRead = 0;
        }

        public Reader(String file_name) throws IOException
        {
            din = new DataInputStream(new FileInputStream(file_name));
            buffer = new byte[BUFFER_SIZE];
            bufferPointer = bytesRead = 0;
        }

        public String readLine() throws IOException
        {
            byte[] buf = new byte[100001]; // line length
            int cnt = 0, c;
            while ((c = read()) != -1)
            {
                if (c == '\n')
                    break;
                buf[cnt++] = (byte) c;
            }
            return new String(buf, 0, cnt);
        }

        public int nextInt() throws IOException
        {
            int ret = 0;
            byte c = read();
            while (c <= ' ')
                c = read();
            boolean neg = (c == '-');
            if (neg)
                c = read();
            do
            {
                ret = ret * 10 + c - '0';
            }  while ((c = read()) >= '0' && c <= '9');

            if (neg)
                return -ret;
            return ret;
        }

        public long nextLong() throws IOException
        {
            long ret = 0;
            byte c = read();
            while (c <= ' ')
                c = read();
            boolean neg = (c == '-');
            if (neg)
                c = read();
            do {
                ret = ret * 10 + c - '0';
            }
            while ((c = read()) >= '0' && c <= '9');
            if (neg)
                return -ret;
            return ret;
        }

        public double nextDouble() throws IOException
        {
            double ret = 0, div = 1;
            byte c = read();
            while (c <= ' ')
                c = read();
            boolean neg = (c == '-');
            if (neg)
                c = read();

            do {
                ret = ret * 10 + c - '0';
            }
            while ((c = read()) >= '0' && c <= '9');

            if (c == '.')
            {
                while ((c = read()) >= '0' && c <= '9')
                {
                    ret += (c - '0') / (div *= 10);
                }
            }

            if (neg)
                return -ret;
            return ret;
        }

        private void fillBuffer() throws IOException
        {
            bytesRead = din.read(buffer, bufferPointer = 0, BUFFER_SIZE);
            if (bytesRead == -1)
                buffer[0] = -1;
        }

        private byte read() throws IOException
        {
            if (bufferPointer == bytesRead)
                fillBuffer();
            return buffer[bufferPointer++];
        }

        public void close() throws IOException
        {
            if (din == null)
                return;
            din.close();
        }
    }
	public static void debug(int[][] arr) {
		int r = arr.length;
		int c = arr[0].length;
		int i,j;
		for(i=0;i<r;++i) {
			for(j=0;j<c;++j)  System.err.print(arr[i][j]+" ");
			System.err.println();
		}
	}
	public static void debug(long[][] arr) {
		int r = arr.length;
		int c = arr[0].length;
		int i,j;
		for(i=0;i<r;++i) {
			for(j=0;j<c;++j)  System.err.print(arr[i][j]+" ");
			System.err.println();
		}
	}
	public static void debug(int ...var) {
		for(int i:var)  System.err.print(i+" ");
		System.err.println();
	}
	public static void debug(String ...var) {
		for(String i:var)  System.err.print(i+" ");
		System.err.println();
	}
	public static void debug(double ...var) {
		for(double i:var)  System.err.print(i+" ");
		System.err.println();
	}

	public static void debug(long ...var) {
		for(long i:var)  System.err.print(i+" ");
		System.err.println();
	}

    public static void main(String args[]) throws Exception{
        //Reader scan = new Reader();
        //be careful of readLine() length of string;
        Scanner scan = new Scanner(System.in);
		//scan.useDelimiter("");  // for reading character by character

        int[] colors = new int[26];
        int n = scan.nextInt();
        int k = scan.nextInt();
        String s = scan.next();
        for(int i=0;i<n;++i) {
            char c = s.charAt(i);
            int index = c-'a';
            ++colors[index];
            if(colors[index]>k) {
                System.out.println("NO");
                return;
            }
        }
        System.out.println("YES");
        scan.close();

    }
}


// practice with rainboy
import java.io.*;
import java.util.*;

public class CF571A extends PrintWriter {
	CF571A() { super(System.out, true); }
	Scanner sc = new Scanner(System.in);
	public static void main(String[] $) {
		CF571A o = new CF571A(); o.main(); o.flush();
	}

	long count2(int h) {
		return h % 2 == 1 ? (long) (h + 1) / 2 * ((h + 1) / 2 + 1)
			: (long) (h / 2 + 1) * (h / 2 + 1);
	}
	long count1(int h, int r) {
		return count2(h) - (r >= h ? 0 : count2(h - 1 - r));
	}
	long count(int h, int k, int r) {
		return count1(h, r) - (k == 0 ? 0 : count1(k - 1, r));
	}
	long solve(int a, int b, int c, int h) {
		if (a + 1 > b + c + h)
			return 0;
		int k = a + 1 <= b + c ? 0 : a + 1 - (b + c);
		int l = 1 - a - (c - b);
		int r = a - 1 - (c - b);
		if (l >= 0)
			return count(h, k, r) - (l == 0 ? 0 : count(h, k, l - 1));
		if (r <= 0) {
			r = -r; l = -l;
			return count(h, k, l) - (r == 0 ? 0 : count(h, k, r - 1));
		}
		return count(h, k, -l) + count(h, k, r) - count(h, k, 0);
	}
	void main() {
		int a = sc.nextInt();
		int b = sc.nextInt();
		int c = sc.nextInt();
		int l = sc.nextInt();
		long ans = 0;
		for (int l_ = 0; l_ <= l; l_++)
			ans += solve(a + l_, b, c, l - l_);
		println(ans);
	}
}


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

public class C implements Runnable{

    BufferedReader in;
    PrintWriter out;
    StringTokenizer Tokenizer;

    private void solve() throws IOException{
        int n = NextInt();
        long res = 1000000000;
        res*=1000000;
        long es1 = n;
        es1 = (es1+1)*9;
        for(int i = (int)Math.cbrt(n); i>0; i--)
            if (n%i == 0){
                int m = n/i;
                for(int j = (int)Math.sqrt(m); j>=i; j--)
                    if(m%j==0){
                        int k = m/j;
                        if (k<j) continue;
                        long res1 = i+1;
                        res1 = res1*(j+2);
                        res1 = res1*(k+2);
                        res1-=n;
                        if (res1<res) res = res1;
                    }
            }
        out.print(res);
        out.print(" ");
        out.println(es1-n);
    }

    public static String removeCharAt(String s, int pos) {
           StringBuffer buf = new StringBuffer( s.length() - 1 );
           buf.append( s.substring(0,pos) ).append( s.substring(pos+1) );
           return buf.toString();
        }

    public void run(){
        try{
            in = new BufferedReader(new InputStreamReader(System.in));
            out = new PrintWriter(System.out);
            solve();
            in.close();
            out.close();
        } catch (Exception e){
            System.out.println(e.getMessage());
        }
    }

    int NextInt() throws IOException{
        return Integer.parseInt(NextToken());
    }

    long NextLong() throws IOException{
        return Long.parseLong(NextToken());
    }

    double NextDouble() throws IOException{
        return Double.parseDouble(NextToken());
    }
    String str(int x){
        return Integer.toString(x);
    }

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

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


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

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

    static class Task_random_1 {
        public void solve(int testNumber, InputReader in, OutputWriter out) {

            int x = in.nextInt(), y = in.nextInt();

            //check if good root print black// else continue the code

            double ff = (Math.pow(x, 2) + Math.pow(y, 2));
            double h = Math.sqrt(ff);
            int g = (int) Math.sqrt(ff);

            if (h == g) {
                out.println("black");
                return;
            }

            boolean even = false;
            if (g % 2 == 0)
                even = true;

            if ((x > 0 && y > 0) || (x < 0 && y < 0)) {
                //q1,3 starts with white
                if (!even) out.println("white");
                else out.println("black");
            }
            else if ((x > 0 && y < 0) || (x < 0 && y > 0)) {
                //q2,4
                if (even) out.println("white");
                else out.println("black");
            }

            else {
                out.println("black");
            }

        }

    }

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

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

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

        public 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 boolean isSpaceChar(int c) {
            if (filter != null) {
                return filter.isSpaceChar(c);
            }
            return isWhitespace(c);
        }

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

        public interface SpaceCharFilter {
            public boolean isSpaceChar(int ch);

        }

    }

    static class OutputWriter {
        private final PrintWriter writer;

        public OutputWriter(OutputStream outputStream) {
            writer = new PrintWriter(new BufferedWriter(new OutputStreamWriter(outputStream)));
        }

        public OutputWriter(Writer writer) {
            this.writer = new PrintWriter(writer);
        }

        public void print(Object... objects) {
            for (int i = 0; i < objects.length; i++) {
                if (i != 0) {
                    writer.print(' ');
                }
                writer.print(objects[i]);
            }
        }

        public void println(Object... objects) {
            print(objects);
            writer.println();
        }

        public void close() {
            writer.close();
        }

    }
}


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

import static java.lang.Math.*;

public class AC {

    //solve by Fdg (it's good solve)

    int [][][][] d;
    int l;
    char [] c ;
    public void solve() throws IOException {

        c = in.readLine().toCharArray();
        int n  = readInt();
        l = c.length;
        d = new int [202][l+2][n+2][2];
        for (int i =0; i<202;i++){
            for (int j =0; j<l+2;j++){
                for(int k = 0; k<n+2; k++){
                    for (int q = 0; q<2; q++){
                        d[i][j][k][q] = -1;
                    }
                }
            }
        }
        out.print(rec(100,0,n,0));
    }

    int rec (int pos,int step,int left,int cource ){

        if(d[pos][step][left][cource]!=-1) {
            return d[pos][step][left][cource];
        }
        if (step==l){
            if ((left&1)>0){
                return 0;
            }
            return abs(pos-100);
        }
        int way=0;
        if (cource==0){
            way++;
        }
        else way--;
        int ans = 0;
        if (c[step]=='F'){
            ans = max(ans,rec(pos+way,step+1,left,cource));
        }
        if (c[step] == 'T'){
            ans = max(ans,rec(pos,step+1,left,cource^1));
        }
        if (left>0){
            if (c[step]=='F'){
                ans = max(ans,rec(pos,step+1,left-1,cource^1));
            }
            if (c[step]=='T'){
                ans = max(ans,rec(pos+way,step+1,left-1,cource));
            }
        }
        return d[pos][step][left][cource] = ans;

    }

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

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

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

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

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

    double readDouble() throws IOException {
        return Double.parseDouble(readString());
    }

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

    public void run() {
        try {
            long t1 = System.currentTimeMillis();
            init();
            solve();
            out.close();
            long t2 = System.currentTimeMillis();
            System.err.println("Time = " + (t2 - t1));
        } catch (Exception e) {
            e.printStackTrace(System.err);
            System.exit(-1);
        }
    }

}


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

public class A123 {
        public static void main(String[] args) {
                InputStream inputStream = System.in;
                OutputStream outputStream = System.out;
                InputReader in = new InputReader(inputStream);
                PrintWriter out = new PrintWriter(outputStream);
                CodeA123 solver = new CodeA123();
                solver.solve(1, in, out);
                out.close();
        }
}

class CodeA123
{
public void solve(int testNumber, InputReader in, PrintWriter out)
{
	int d=in.nextInt();
	int s=in.nextInt();
	int t=in.nextInt();
	int D=d*t;
	int T=0;
	if(D%s==0)
	{
		T=D/s;
	}
	else
	{
		T=D/s+1;
	}
	out.println(T-t);
}

}

class InputReader {
    private BufferedReader reader;
    private StringTokenizer tokenizer;

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

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

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

    public long nextLong() {
        return Long.parseLong(next());
    }
	public void inputShuffleArrayInt(int arr[])
	{
		int l=arr.length;
		for(int i=0;i<l;i++)
		{
			if(i%2==0)
			{
				arr[i/2]=nextInt();
			}
			else
			{
				arr[l-((i+1)/2)]=nextInt();
			}
		}
	}

    }


import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.*;
import java.util.List.*;

public class Test {

	public static void main(String[] args) {
		// TODO Auto-generated method stub
		//ApplicationContext con = new ClassPathXmlApplicationContext("bean.xml");
		FastReader reader = new FastReader();
		int n = reader.nextInt();
		Set<Integer> set = new HashSet<Integer>();

		for (int i = 0; i < n; i++) {
			int a = reader.nextInt();
			if(a!=0){
				set.add(a);
			}
		}
		System.out.println(set.size());

	}

}
class FastReader {

    BufferedReader br;
    StringTokenizer st;

    public FastReader() {
        br = new BufferedReader(new InputStreamReader(System.in));

    }

    public String next() {
        while (st == null || !st.hasMoreElements()) {
            try {
                st = new StringTokenizer(br.readLine());

            } catch (IOException e) {
                e.printStackTrace();
            }
        }
        return st.nextToken();
    }

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

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

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

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


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

public class Solution {

    static MyScanner sc;
    private static PrintWriter out;
    static long M2 = 1_000_000_000L + 7;

    private static HashMap<Long, Long>[] mods;

    public static void main(String[] s) throws Exception {
        StringBuilder stringBuilder = new StringBuilder();
        if (stringBuilder.length() == 0) {
            sc = new MyScanner(System.in);
        } else {
            sc = new MyScanner(new BufferedReader(new StringReader(stringBuilder.toString())));
        }

        out = new PrintWriter(new OutputStreamWriter(System.out));

        initData();
        solve();
        out.flush();
    }

    private static void initData() {

    }

    static long[] fact = new long[5001];

    static {
        fact[0] = 1;
        for (int i = 1; i < fact.length; i++) {
            fact[i] = (fact[i - 1] * i) % 998_244_353;
        }
    }

    private static void solve() throws IOException {
        int n1 = sc.nextInt();
        int n2 = sc.nextInt();
        int n3 = sc.nextInt();
        long[][] r1 = new long[5001][5001];
        for (int i = 0; i < r1.length; i++) {
            r1[i][0] = 1;
            for (int k = 1; k <= i; k++) {
                r1[i][k] = r1[i - 1][k] + r1[i - 1][k - 1];
                r1[i][k] %= 998_244_353;
            }
        }

        long res = 1;
        res *= mm(n1, n2, r1);
        res %= 998_244_353;
        res *= mm(n1, n3, r1);
        res %= 998_244_353;
        res *= mm(n3, n2, r1);
        out.println(res % 998_244_353);
    }

    private static long mm(int n1, int n3, long[][] r1) {
        long res = 0;
        for (int i = 0; i <= Math.min(n1, n3); i++) {
            long cur = r1[n3][i] * r1[n1][i];
            cur %= 998_244_353;
            cur *= fact[i];
            cur %= 998_244_353;
            res += cur;
            res %= 998_244_353;
        }
        return res;
    }

    private static boolean solve(int n, int p, int p1, int i) {
        return false;
    }

    private static boolean isset(long i, int k) {
        return (i & (1 << k)) > 0;
    }

    private static void solveT() throws IOException {
        int t = sc.nextInt();
        while (t-- > 0) {
            solve();
        }
    }

    private static long gcd(long l, long l1) {
        if (l > l1) return gcd(l1, l);
        if (l == 0) return l1;
        return gcd(l1 % l, l);
    }

    private static long pow(long a, long b, long m) {
        if (b == 0) return 1;
        if (b == 1) return a;
        long pp = pow(a, b / 2, m);
        pp *= pp;
        pp %= m;
        return (pp * (b % 2 == 0 ? 1 : a)) % m;
    }

    static class MyScanner {
        BufferedReader br;
        StringTokenizer st;

        MyScanner(BufferedReader br) {
            this.br = br;
        }

        public MyScanner(InputStream in) {
            this(new BufferedReader(new InputStreamReader(in)));
        }

        void findToken() {
            while (st == null || !st.hasMoreTokens()) {
                try {
                    st = new StringTokenizer(br.readLine());
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            }
        }

        String next() {
            findToken();
            return st.nextToken();
        }

        Integer[] nab(int n) {
            Integer[] k = new Integer[n];
            for (int i = 0; i < n; i++) {
                k[i] = sc.fi();
            }
            return k;
        }

        int[] na(int n) {
            int[] k = new int[n];
            for (int i = 0; i < n; i++) {
                k[i] = sc.fi();
            }
            return k;
        }

        long[] nl(int n) {
            long[] k = new long[n];
            for (int i = 0; i < n; i++) {
                k[i] = sc.nextLong();
            }
            return k;
        }

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

        int fi() {
            String t = next();
            int cur = 0;
            boolean n = t.charAt(0) == '-';
            for (int a = n ? 1 : 0; a < t.length(); a++) {
                cur = cur * 10 + t.charAt(a) - '0';
            }
            return n ? -cur : cur;
        }

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

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

}


import java.util.Scanner;

public class Main {

    public static void main(String[] args) {
     Scanner sc = new Scanner(System.in);
     String s = sc.next();
     int ans = 0;
     int a = 1;
     for(int i=0;i<s.length();i++){
         if(s.charAt(i)=='A'||s.charAt(i)=='E'||s.charAt(i)=='I'||s.charAt(i)=='O'||s.charAt(i)=='U'||s.charAt(i)=='Y'){
             ans = Math.max(a, ans);
             a=1;
         }else{
             a++;
         }
     }
     ans  = Math.max(a, ans);
     System.out.println(ans);
    }

}


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

public class Main {
	boolean eof;

	public String nextToken() {
		while (st == null || !st.hasMoreTokens()) {
			try {
				st = new StringTokenizer(br.readLine());
			} catch (Exception e) {
				eof = true;
				return "-1";
			}
		}
		return st.nextToken();
	}

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

	BufferedReader br;
	StringTokenizer st;
	PrintWriter out;

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

	void run() {
		try {
			try {
				File f = new File("input.txt");
				if (f.exists()) {
					br = new BufferedReader(new FileReader("input.txt"));
					out = new PrintWriter(new FileWriter("output.txt"));
				} else {
					br = new BufferedReader(new InputStreamReader(System.in));
					out = new PrintWriter(new OutputStreamWriter(System.out));
				}
			} catch (Throwable e) {
				br = new BufferedReader(new InputStreamReader(System.in));
				out = new PrintWriter(new OutputStreamWriter(System.out));
			}

			solve();
			br.close();
			out.close();
		} catch (Throwable e) {
			e.printStackTrace();
			System.exit(1);
		}
	}

	void solve() {
		int n = nextInt();
		long[] a = new long[] { 1, 18, 1800, 670320, 734832000, 890786230,
				695720788, 150347555 };
		if (n % 2 == 0){
			out.print(0);
		}else{
			out.print(a[n / 2]);
		}
	}
}


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

public class ETry implements Runnable {

    BufferedReader in;
    PrintWriter out;
    StringTokenizer tok;

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

    @Override
    public void run() {
        try {
            in = new BufferedReader(new InputStreamReader(System.in));
            out = new PrintWriter(System.out);

            Locale.setDefault(Locale.US);
            tok = new StringTokenizer("");
            solve();
            in.close();
            out.close();
        } catch (Throwable t) {
            t.printStackTrace(System.err);
            System.exit(-1);
        }
    }

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

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

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

    double readDouble() throws IOException {
        return Double.parseDouble(readString());
    }

    // solution

    class Point {
        long x, y;
        int i;

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

        @Override
        public String toString() {
            return String.format("[(%d %d) %d]", x, y, i);
        }

    }

    class PointComparator implements Comparator<Point> {
        Point root;

        public PointComparator(Point root) {
            this.root = root;
        }

        @Override
        public int compare(Point a, Point b) {
            long wp = (a.x - root.x) * (b.y - root.y) - (a.y - root.y) * (b.x - root.x);
            if (wp < 0)
                return -1;
            if (wp > 0)
                return 1;
            return 0;
        }

    }

    int n;
    List<Integer>[] graph;
    int[] size;
    int[] parent;
    Point[] points;
    int[] ans;

    void solve() throws IOException {
        n = readInt();
        // читаем граф
        graph = new List[n];
        for (int i = 0; i < n; i++) {
            graph[i] = new ArrayList<Integer>();
        }
        for (int i = 0; i < n - 1; i++) {
            int x = readInt() - 1;
            int y = readInt() - 1;
            graph[x].add(y);
            graph[y].add(x);
        }

        // читаем точки
        points = new Point[n];
        for (int i = 0; i < n; i++) {
            points[i] = new Point(readLong(), readLong(), i);
        }

        // подвешиваем дерево и
        size = new int[n];
        parent = new int[n];
        dfs(0, -1);

        // считаем ответ
        ans = new int[n];
        Arrays.fill(ans, -1);

        // ищем самый левый
        int rootIndex = 0;
        for (int i = 1; i < n; i++) {
            if (points[i].x < points[rootIndex].x || points[i].x == points[rootIndex].x
                    && points[i].y < points[rootIndex].y) {
                rootIndex = i;
            }
        }

        // ставим самый левый первым
        Point tmp = points[0];
        points[0] = points[rootIndex];
        points[rootIndex] = tmp;

        // считаем
        rec(0, 0, n - 1);

        // ответ
        for (int i = 0; i < n; i++) {
            if (ans[i] == -1) {
                throw new RuntimeException("Answer is wrong");
            }
        }
        for (int i = 0; i < n; i++) {
            out.print(ans[i] + 1);
            if (i == n - 1) {
                out.println();
            } else {
                out.print(" ");
            }
        }
    }

    private void rec(int x, int left, int right) {
        ans[points[left].i] = x;
        Arrays.sort(points, left + 1, right + 1, new PointComparator(points[left]));
        int i = left + 1;
        for (int y : graph[x]) {
            if (y != parent[x]) {
                rec(y, i, i + size[y] - 1);
                i += size[y];
            }
        }
    }

    private void dfs(int x, int p) {
        parent[x] = p;
        size[x] = 1;
        for (int y : graph[x]) {
            if (y != p) {
                dfs(y, x);
                size[x] += size[y];
            }
        }
    }

}


import java.util.Scanner;

public class A {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        char[][][] cs = new char[20][8][8];
        for(int i = 0; i < 8; i++) {
            cs[0][i] = sc.next().toCharArray();
        }

        for(int i = 0; i < 19; i++) {
            for(int y = 0; y < 8; y++)
                for(int x = 0; x < 8; x++)
                    if(cs[i][y][x] == 'M')
                        for(int dy = -1; dy <= 1; dy++)
                            for(int dx = -1; dx <= 1; dx++) {
                                final int xx = x+dx;
                                final int yy = y+dy;
                                if(0 <= xx && xx < 8 && 0 <= yy && yy < 8 && cs[i][yy][xx] != 'S')
                                    cs[i+1][yy][xx] = 'M';
                            }

            for(int y = 6; y >= 0; y--)
                for(int x = 0; x < 8; x++)
                    if(cs[i][y][x] == 'S')
                        cs[i+1][y+1][x] = 'S';
        }

        String res = "LOSE";
        for(int y = 0; y < 8; y++)
            for(int x = 0; x < 8; x++)
                if(cs[19][y][x] == 'M')
                    res = "WIN";
        System.out.println(res);
    }
}


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

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

class TaskA {
    public void solve(int testNumber, InputReader in, OutputWriter out) {
		long price = in.readLong();
		while (price % 3 == 0 && price != 0)
			price /= 3;
		long answer = price / 3 + 1;
		out.printLine(answer);
    }
}

class InputReader {

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

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

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

	public long readLong() {
		int c = read();
		while (isSpaceChar(c))
			c = read();
		int sgn = 1;
		if (c == '-') {
			sgn = -1;
			c = read();
		}
		long res = 0;
		do {
			if (c < '0' || c > '9')
				throw new InputMismatchException();
			res *= 10;
			res += c - '0';
			c = read();
		} while (!isSpaceChar(c));
		return res * sgn;
	}

	public boolean isSpaceChar(int c) {
		if (filter != null)
			return filter.isSpaceChar(c);
		return isWhitespace(c);
	}

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

	public interface SpaceCharFilter {
		public boolean isSpaceChar(int ch);
	}
}

class OutputWriter {
	private final PrintWriter writer;

	public OutputWriter(OutputStream outputStream) {
		writer = new PrintWriter(new BufferedWriter(new OutputStreamWriter(outputStream)));
	}

	public OutputWriter(Writer writer) {
		this.writer = new PrintWriter(writer);
	}

	public void print(Object...objects) {
		for (int i = 0; i < objects.length; i++) {
			if (i != 0)
				writer.print(' ');
			writer.print(objects[i]);
		}
	}

    public void printLine(Object...objects) {
		print(objects);
		writer.println();
	}

	public void close() {
		writer.close();
	}

	}


//import java.util.Arrays;
import java.math.BigInteger;
import java.util.Scanner;
public class A682
{
    public static void main(String[] args)
    {
        Scanner sc=new Scanner(System.in);
        BigInteger ans=new BigInteger("0");
        int n=sc.nextInt();
        int m=sc.nextInt();
        int[] arr=new int[5];
        for(int i=1;i<=m;i++)
        arr[i%5]++;
        //System.out.println(Arrays.toString(arr));
        for(int i=1;i<=n;i++)
        {
            if(i%5==0)
            ans=ans.add(BigInteger.valueOf(arr[0]));
            else
            ans=ans.add(BigInteger.valueOf(arr[5-i%5]));
        }
        System.out.println(ans);
        sc.close();
    }
}


import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.*;

public class d{

	static class Pos{
		int i,j;
		Pos(int i, int j){this.i=i;this.j=j;}
	}
	static class Node{
		int i,j,k,l,c;
		Node(int i,int j,int k,int l,int c){this.i=i;this.j=j;this.k=k;this.l=l;this.c=c;}
	}

	static void solve(){
		int n = ni();
		int[][][][] dis = new int[n][n][3][n*n+1];
		Pos[] pos =new Pos[n*n];
		for(int i=0;i<n;++i)for(int j=0;j<n;++j)pos[ni()-1] = new Pos(i, j);
		for(int i=0;i<n;++i)for(int j=0;j<n;++j)for(int k=0;k<3;++k)for(int l=0;l<=n*n;++l)dis[i][j][k][l]=Integer.MAX_VALUE;
		PriorityQueue<Node> que = new PriorityQueue<>((a,b)->a.c-b.c);
		for(int k=0;k<3;++k){
			dis[pos[0].i][pos[0].j][k][1]=0;
			que.add(new Node(pos[0].i, pos[0].j, k, 1, 0));
		}
		List<Integer> movex[] = new List[3];
		List<Integer> movey[] = new List[3];
		movex[0] = Arrays.asList(-2,-2,-1,-1,1,1,2,2);
		movey[0] = Arrays.asList(1,-1,2,-2,2,-2,1,-1);
		for(int i=1;i<3;++i){
			movex[i]=new ArrayList<>();
			movey[i]=new ArrayList<>();
		}
		for(int i=1;i<=n;++i){
			movex[1].add(i);movex[1].add(-i);
			movey[1].add(0);movey[1].add(0);
			movex[1].add(0);movex[1].add(0);
			movey[1].add(i);movey[1].add(-i);

			movex[2].add(i);movex[2].add(-i);
			movey[2].add(i);movey[2].add(-i);
			movex[2].add(i);movex[2].add(-i);
			movey[2].add(-i);movey[2].add(i);
		}
		while(!que.isEmpty()){
			Node node = que.poll();
			if(node.c > dis[node.i][node.j][node.k][node.l])continue;
			int i=node.i, j=node.j, k=node.k, l=node.l;
			if(l==n*n){
				out.println(node.c/1000+" "+node.c%1000);
				return;
			}
			for(int kk=0;kk<3;++kk){
				if(kk==k)continue;
				if(dis[i][j][kk][l] > dis[i][j][k][l]+1001){
					dis[i][j][kk][l]=dis[i][j][k][l]+1001;
					que.add(new Node(i, j, kk, l, dis[i][j][kk][l]));
				}
			}
			for(int x=0;x<movex[k].size();++x){
				int dx = movex[k].get(x);
				int dy = movey[k].get(x);

				if(inrange(i+dy, j+dx, n, n)){
					int ll = l;
					if(pos[l].i==i+dy && pos[l].j==j+dx)++ll;
					if(dis[i+dy][j+dx][k][ll]>dis[i][j][k][l]+1000){
						dis[i+dy][j+dx][k][ll]=dis[i][j][k][l]+1000;
						que.add(new Node(i+dy, j+dx, k, ll, dis[i+dy][j+dx][k][ll]));
					}
				}
			}
		}

	}

	 public static void main(String[] args){
		 solve();
		 out.flush();
	 }
	 private static InputStream in = System.in;
	 private static PrintWriter out = new PrintWriter(System.out);

	 static boolean inrange(int y, int x, int h, int w){
		 return y>=0 && y<h && x>=0 && x<w;
	 }
	 @SuppressWarnings("unchecked")
	 static<T extends Comparable> int lower_bound(List<T> list, T key){
		 int lower=-1;int upper=list.size();
		 while(upper - lower>1){
		 int center =(upper+lower)/2;
		 if(list.get(center).compareTo(key)>=0)upper=center;
		 else lower=center;
		 }
		 return upper;
	 }
	 @SuppressWarnings("unchecked")
	 static <T extends Comparable> int upper_bound(List<T> list, T key){
		 int lower=-1;int upper=list.size();
		 while(upper-lower >1){
		 int center=(upper+lower)/2;
		 if(list.get(center).compareTo(key)>0)upper=center;
		 else lower=center;
		 }
		 return upper;
	 }
	 @SuppressWarnings("unchecked")
	 static <T extends Comparable> boolean next_permutation(List<T> list){
		 int lastIndex = list.size()-2;
		 while(lastIndex>=0 && list.get(lastIndex).compareTo(list.get(lastIndex+1))>=0)--lastIndex;
		 if(lastIndex<0)return false;
		 int swapIndex = list.size()-1;
		 while(list.get(lastIndex).compareTo(list.get(swapIndex))>=0)swapIndex--;
		 T tmp = list.get(lastIndex);
		 list.set(lastIndex++, list.get(swapIndex));
		 list.set(swapIndex, tmp);
		 swapIndex = list.size()-1;
		 while(lastIndex<swapIndex){
		 tmp = list.get(lastIndex);
		 list.set(lastIndex, list.get(swapIndex));
		 list.set(swapIndex, tmp);
		 ++lastIndex;--swapIndex;
		 }
		 return true;
	 }
	 private static final byte[] buffer = new byte[1<<15];
	 private static int ptr = 0;
	 private static int buflen = 0;
	 private static boolean hasNextByte(){
		 if(ptr<buflen)return true;
		 ptr = 0;
		 try{
			 buflen = in.read(buffer);
		 } catch (IOException e){
			 e.printStackTrace();
		 }
		 return buflen>0;
	 }
	 private static int readByte(){ if(hasNextByte()) return buffer[ptr++]; else return -1;}
	 private static boolean isSpaceChar(int c){ return !(33<=c && c<=126);}
	 private static int skip(){int res; while((res=readByte())!=-1 && isSpaceChar(res)); return res;}

	 private static double nd(){ return Double.parseDouble(ns()); }
	 private static char nc(){ return (char)skip(); }
	 private static String ns(){
		 StringBuilder sb = new StringBuilder();
		 for(int b=skip();!isSpaceChar(b);b=readByte())sb.append((char)b);
		 return sb.toString();
	 }
	 private static int[] nia(int n){
		 int[] res = new int[n];
		 for(int i=0;i<n;++i)res[i]=ni();
		 return res;
	 }
	 private static long[] nla(int n){
		 long[] res = new long[n];
		 for(int i=0;i<n;++i)res[i]=nl();
		 return res;
	 }
	 private static int ni(){
		 int res=0,b;
		 boolean minus=false;
		 while((b=readByte())!=-1 && !((b>='0'&&b<='9') || b=='-'));
		 if(b=='-'){
			 minus=true;
			 b=readByte();
		 }
		 for(;'0'<=b&&b<='9';b=readByte())res=res*10+(b-'0');
		 return minus ? -res:res;
	 }
	 private static long nl(){
		 long res=0,b;
		 boolean minus=false;
		 while((b=readByte())!=-1 && !((b>='0'&&b<='9') || b=='-'));
		 if(b=='-'){
			 minus=true;
			 b=readByte();
		 }
		 for(;'0'<=b&&b<='9';b=readByte())res=res*10+(b-'0');
		 return minus ? -res:res;
	}
}


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

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

    static class D1DominoEasyVersion {
        private boolean found;

        private void solveEvenXEvenMatrix(int dominoes) {
            //~ if the matrix is: even x even
            //~ then it is enough to check the number of dominoes are even or not
            if (dominoes % 2 == 0) found = true;
        }

        public void solve(int testNumber, InputReader in, OutputWriter out) {
            int tc = in.readInteger();
            for (int cs = 1; cs <= tc; ++cs) {
                int n = in.readInteger();
                int m = in.readInteger();
                int k = in.readInteger();

                found = false;
                if (n % 2 == 0 && m % 2 == 0) {//~ even x even matrix
                    solveEvenXEvenMatrix(k);
                } else if (n % 2 == 0 && m % 2 == 1) {//~ even x odd matrix
                    int maxPossibleHorizons = (m * n) / 2 - (n / 2);

                    if (k <= maxPossibleHorizons) {//~ k should not be > maxPossibleHorizons
                        solveEvenXEvenMatrix(k);
                    }
                } else if (n % 2 == 1 && m % 2 == 0) { //~ odd x even matrix
                    int leastHorizons = m / 2;
                    if (k >= leastHorizons) {
                        int restHorizons = k - leastHorizons;
                        solveEvenXEvenMatrix(restHorizons);
                    }
                }
                if (found) out.printLine("YES");
                else out.printLine("NO");
            }
        }

    }

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

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

        public int read() {
            if (numChars == -1) {
                throw new InputMismatchException();
            }
            if (curChar >= numChars) {
                curChar = 0;
                try {
                    numChars = stream.read(buf);

                } catch (IOException e) {
                    throw new InputMismatchException();
                }
                if (numChars <= 0) {
                    return -1;
                }
            }
            return buf[curChar++];
        }

        public int readInteger() {
            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 boolean isSpaceChar(int c) {
            if (filter != null) {
                return filter.isSpaceChar(c);
            }
            return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
        }

        public interface SpaceCharFilter {
            public boolean isSpaceChar(int ch);

        }

    }

    static class OutputWriter {
        private final PrintWriter writer;

        public OutputWriter(OutputStream outputStream) {
            writer = new PrintWriter(new BufferedWriter(new OutputStreamWriter(outputStream)));
        }

        public OutputWriter(Writer writer) {
            this.writer = new PrintWriter(writer);
        }

        public void print(Object... objects) {
            for (int i = 0; i < objects.length; i++) {
                if (i != 0) {
                    writer.print(' ');
                }
                writer.print(objects[i]);
            }
        }

        public void printLine(Object... objects) {
            this.print(objects);
            writer.println();
        }

        public void close() {
            writer.flush();
            writer.close();
        }

    }
}


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

 //@Manan Parmar

public class Solution2 implements Runnable {

    public void run() {

        InputReader sc = new InputReader(System.in);
        PrintWriter out = new PrintWriter(System.out);

        int y=sc.nextInt(),b=sc.nextInt(),r=sc.nextInt();
        if(y<=b&&y<r)
        {
            if(r-y>1&&b-y>=1)
                out.println(y+(y+1)+(y+2));
            else
                out.println((y-1)+y+(y+1));
        }
        else if(b<=y&&b<r)
        {
            out.println((b-1)+b+(b+1));
        }
        else
        {
            out.println((r-2)+(r-1)+(r));
        }

        out.close();
    }

//========================================================================

    static class InputReader {
        private InputStream stream;
        private byte[] buf = new byte[1024];
        private int curChar;
        private int numChars;
        private SpaceCharFilter filter;
        private BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

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

        public int read() {
            if (numChars==-1)
                throw new InputMismatchException();

            if (curChar >= numChars) {
                curChar = 0;
                try {
                    numChars = stream.read(buf);
                }
                catch (IOException e) {
                    throw new InputMismatchException();
                }

                if(numChars <= 0)
                    return -1;
            }
            return buf[curChar++];
        }

        public String nextLine() {
            String str = "";
            try {
                str = br.readLine();
            }
            catch (IOException e) {
                e.printStackTrace();
            }
            return str;
        }
        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 - '0';
                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 - '0') * m;
                    c = read();
                }
            }
            return res * sgn;
        }

        public String readString() {
            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) {
            if (filter != null)
                return filter.isSpaceChar(c);
            return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
        }

        public String next() {
            return readString();
        }

        public interface SpaceCharFilter {
            public boolean isSpaceChar(int ch);
        }
    }

    public static void main(String args[]) throws Exception {
        new Thread(null, new Solution2(),"Main",1<<27).start();
    }
}


import java.util.Scanner;

/**
 *
 * @author LittleBird
 */
public class Main {

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

        int n = cin.nextInt();
        int k = cin.nextInt();

        String cell = cin.next();

        int tPos = 0, pPos = 0;
        for (int i = 0; i < cell.length(); i++) {

            if (cell.charAt(i) == 'T') {
                tPos = i;
            }
            if (cell.charAt(i) == 'G') {
                pPos = i;
            }
        }

        int minv = Math.min(tPos, pPos);
        boolean flag = true;
        while (flag) {
            minv += k;
            if (minv >= n) {
                break;
            }
            if (cell.charAt(minv) == '#') {
                break;
            }
            if (cell.charAt(minv) == 'T' || cell.charAt(minv) == 'G') {
                flag = false;
            }
        }
        if (flag) {
            System.out.println("NO");
        } else {
            System.out.println("YES");
        }
    }
}


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

public class Main
{
	static long mod=1000000007,m;
	static long[] a,b;
	public static void main(String[] args) throws IOException
	{
		FastReader in=new FastReader();
		PrintWriter pw=new PrintWriter(System.out);
		long n=in.nextLong();
		if(n==1)
			pw.println(1);
		else
		{
			long ans=0;
			for(long i=1;i*i<=n;i++)
			{
				if(n%i==0)
					ans+=2;
				if(i*i==n)
					ans--;
			}
			pw.println(ans);
		}
		pw.flush();
	}
}

class pair<A,B>
{
	A f;
	B s;

	public pair(A a,B b)
	{
		f=a;
		s=b;
	}
}

class FastReader
{
	BufferedReader br;
	StringTokenizer st;

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

	public String next() throws IOException
	{
		if(st==null || !st.hasMoreElements())
		{
			st=new StringTokenizer(br.readLine());
		}
		return st.nextToken();
	}

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

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


import java.io.*;
import java.util.*;
/**
 * @author OleGG
 */
public class Task92A {
    public int chips(int n, int m) {
        m %= n * (n + 1) / 2;
        for (int i = 1; i <= m; ++i) {
            m -= i;
        }
        return m;
    }

    public static void main(String[] args) throws Throwable {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int m = sc.nextInt();
        System.out.println(new Task92A().chips(n, m));
    }
}


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

public class ProblemA_62 {

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

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

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

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

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

    public void run(){
        try{
            long t1=System.currentTimeMillis();
            init();
            solve();
            out.close();
            long t2=System.currentTimeMillis();
            System.err.println("Time = "+(t2-t1));
        }catch (Exception e){
            e.printStackTrace(System.err);
            System.exit(-1);
        }
    }

public class Permutation {

        int[] a;
        int n;

        public Permutation(int n){
            this.n=n;
            a=new int[n];
            for (int i=0; i<n; i++){
                a[i]=i;
            }
        }

        public boolean nextPermutation(){ //Пишется с do{}while(nextPermutation(a));
            int i=n-1;
            for (i=n-2; i>=0; i--){
                if (a[i]<a[i+1]){
                    break;
                }
            }
            if (i==-1){
                return false;
            }
            int jMin=i+1;
            for (int j=n-1; j>i; j--){
                if (a[i]<a[j]&&a[j]<a[jMin]){
                    jMin=j;
                }
            }
            swap(i, jMin);
            for (int j=1; j<=(n-i)/2; j++){
                swap(i+j, n-j);
            }
            return true;
        }

        public int get(int i){
            return a[i];
        }

        void swap(int i, int j){
            int r=a[i];
            a[i]=a[j];
            a[j]=r;
        }
    }

    void solve() throws IOException{
        Permutation per;
        int[] p = new int[4];
        for (int i = 0; i < 4; i++){
            p[i] = readInt();
        }
        int a = readInt();
        int b = readInt();
        int count = 0;
        for (int x = a; x <= b; x++){
            per = new Permutation(4);
            int pr = 0;
            do{
                int p1 = p[per.get(0)];
                int p2 = p[per.get(1)];
                int p3 = p[per.get(2)];
                int p4 = p[per.get(3)];
                if (x % p1 % p2 % p3 % p4 == x){
                    pr++;
                }
            }while(per.nextPermutation());
            if (pr >= 7){
                count++;
            }
        }
        out.print(count);
    }
}


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

public class Main {

	private void solve() throws IOException{
		InputStreamReader isr = new InputStreamReader(System.in);
		BufferedReader br = new BufferedReader(isr);
		int n = Integer.parseInt(br.readLine());
		byte[] pairs = new byte[n];
		StringTokenizer st = new StringTokenizer(br.readLine(), " ");
		int stay = 0;

		//input
		for(int i = 0; i < n; i++)
			pairs[i] = Byte.parseByte(st.nextToken());

		if(n > 1){
			if(pairs[0] != 0)
				if(pairs[0] != 0 || pairs[1] != 0) stay++;
			for(int i = 1; i < n-1; i++){
				if(pairs[i] == 0){
					if(pairs[i-1] != 0 && pairs[i+1] != 0) stay++;
				}else{
					stay++;
				}
			}
			if(pairs[n-1] != 0) stay++;
		}else{
			if(pairs[0] == 1) stay++;
		}

		System.out.println(stay);
	}

	public static void main(String[] args) throws IOException{
		Main m = new Main();
		m.solve();
	}
}


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

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 oo = Long.MAX_VALUE;

	public void run() throws Exception{
		in =  new BufferedReader(new InputStreamReader(System.in));
		out = new PrintWriter(System.out);
		long t = nextLong(), w = nextLong(), b = nextLong();
		if (t < Math.min(w, b) || w == b)	{
			out.println("1/1");
			out.close();
			return;
		}

		long gcd = gcd(w, b);
		BigInteger lcm = new BigInteger("" + w).divide(new BigInteger("" + gcd)).multiply(new BigInteger("" + b));
		// long lcm = w / gcd * b;
		// System.out.println("lcm = " + lcm);

		// long num = (t / lcm - 1) * Math.min(w, b);
		BigInteger bigT = new BigInteger("" + t);
		BigInteger step = new BigInteger("" + Math.min(w, b));
		BigInteger num = ((bigT.divide(lcm)).subtract(BigInteger.ONE)).multiply(step);
		num = num.add(step.subtract(BigInteger.ONE));
		// num += Math.min(w, b) - 1;

		// if (bigT.mod(lcm).longValue() != 0) {
			BigInteger l = bigT.divide(lcm).multiply(lcm);
			BigInteger left = bigT.subtract(l).add(BigInteger.ONE);
			if (step.compareTo(left) > 0) {
				num = num.add(left);
			}else {
				num = num.add(step);
			}
		// }
		// if (t % lcm != 0) {
		// 	long l = (t / lcm) * lcm;
		// 	long left = t - l + 1;
		// 	num += Math.min(Math.min(w, b), left);
		// }
		long nn = num.longValue();
		gcd = gcd(nn, t);
		nn /= gcd;
		t /= gcd;

		out.println(nn + "/" + t);
		out.close();
	}

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

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


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

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

class TaskA {
    public void solve(int testNumber, InputReader in, OutputWriter out) {
        long x = in.readLong();
        long y = in.readLong();
        long m = in.readLong();

        if (x >= m || y >= m) {
            out.printLine(0);
            return;
        }

        if (x <= 0 && y <= 0) {
            out.printLine(-1);
            return;
        }

        long answer = 0;

        if (x < 0) {
            answer += (Math.abs(x) + y) / y;
            x = x + answer * y;
        }

        if (y < 0) {
            answer += (Math.abs(y) + x) / x;
            y = y + answer * x;
        }

        Queue<Pair<Long, Long>> pairQueue = new ArrayDeque<Pair<Long, Long>>();

        pairQueue.add(Pair.makePair(x, y));

        while (true) {
            Pair<Long, Long>[] temp = new Pair[pairQueue.size()];
            pairQueue.toArray(temp);
            pairQueue = new ArrayDeque<Pair<Long, Long>>();
            for (Pair<Long, Long> cur : temp) {
                if (cur.first >= m || cur.second >= m) {
                    out.printLine(answer);
                    return;
                }
                if (cur.first > 0 && cur.first >= cur.second)
                    pairQueue.add(Pair.makePair(cur.first, cur.first + cur.second));
                if (cur.second > 0 && cur.second >= cur.first)
                    pairQueue.add(Pair.makePair(cur.first + cur.second, cur.second));
            }
            answer++;
        }
    }
}

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

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

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

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

    public long readLong() {
        int c = read();
        while (isSpaceChar(c))
            c = read();
        int sgn = 1;
        if (c == '-') {
            sgn = -1;
            c = read();
        }
        long res = 0;
        do {
            if (c < '0' || c > '9')
                throw new InputMismatchException();
            res *= 10;
            res += c - '0';
            c = read();
        } while (!isSpaceChar(c));
        return res * sgn;
    }

    public interface SpaceCharFilter {
        public boolean isSpaceChar(int ch);
    }

}

class OutputWriter {
    private final PrintWriter writer;

    public OutputWriter(OutputStream outputStream) {
        writer = new PrintWriter(new BufferedWriter(new OutputStreamWriter(outputStream)));
    }

    public OutputWriter(Writer writer) {
        this.writer = new PrintWriter(writer);
    }

    public void print(Object...objects) {
        for (int i = 0; i < objects.length; i++) {
            if (i != 0)
                writer.print(' ');
            writer.print(objects[i]);
        }
    }

    public void printLine(Object...objects) {
        print(objects);
        writer.println();
    }

    public void close() {
        writer.close();
    }

}

class Pair<U, V> implements Comparable<Pair<U, V>> {

    public final U first;
    public final V second;

    public static<U, V> Pair<U, V> makePair(U first, V second) {
        return new Pair<U, V>(first, second);
    }

    public Pair(U first, V second) {
        this.first = first;
        this.second = second;
    }

    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        Pair pair = (Pair) o;

        return !(first != null ? !first.equals(pair.first) : pair.first != null) && !(second != null ? !second.equals(pair.second) : pair.second != null);

    }

    public int hashCode() {
        int result = first != null ? first.hashCode() : 0;
        result = 31 * result + (second != null ? second.hashCode() : 0);
        return result;
    }

    public String toString() {
        return "(" + first + "," + second + ")";
    }

    public int compareTo(Pair<U, V> o) {
        int value = ((Comparable<U>)first).compareTo(o.first);
        if (value != 0)
            return value;
        return ((Comparable<V>)second).compareTo(o.second);
    }
}


import java.io.IOException;
import java.util.Scanner;

public class Main
{

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

	public static void main(String[] args) throws IOException
	{

		long n = in.nextLong();
		long s = in.nextLong();
		long minNum = getMin(s);
		//System.out.println("minNum==" + minNum);
		if (n < minNum)
			System.out.println(0);
		else
		{
			System.out.println(n - minNum + 1);
		}

	}

	static long getMin(long s)
	{
		long ans = (s / 9) * 9;
		if (ans != s)
			ans += 9;

		ans = ans - ans % 10 + 10;
		while (true)
		{
			if (ans - getStringSum(ans) >= s)
			{
				break;
			}
			ans += 10;
		}
		return ans;
	}

	static int getStringSum(long s)
	{
		int sum = 0;
		while (s != 0)
		{
			sum += s % 10;
			s = s / 10;
		}
		return sum;
	}

}


import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.HashMap;

public class CF_218_2_B {
    static HashMap<Integer, Integer> weights = new HashMap<>();
    static int ans = 1 << 30;

    public static void main(String[] args) throws Exception {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        String[] line = br.readLine().split("\\s");
        int a = Integer.parseInt(line[0]);
        int b = Integer.parseInt(line[1]);

        f(a, 0);
        f2(b, 0);
        if (ans == 1 << 30)
            System.out.println(-1);
        else
            System.out.println(ans);
    }

    static void f(int a, int d) {
        if (weights.containsKey(a))
            return;

        weights.put(a, d);

        if (a % 2 == 0)
            f(a / 2, d + 1);
        if (a % 3 == 0)
            f(a / 3, d + 1);
        if (a % 5 == 0)
            f(a / 5, d + 1);
    }

    static void f2(int b, int d) {
        if (weights.containsKey(b)) {
            ans = Math.min(ans, d + weights.get(b));
            return;
        }

        if (b % 2 == 0)
            f2(b / 2, d + 1);
        if (b % 3 == 0)
            f2(b / 3, d + 1);
        if (b % 5 == 0)
            f2(b / 5, d + 1);
    }
}


import java.util.*;
public class substring
{
public static void main(String[] args)
{
Scanner input = new Scanner(System.in);
String s = input.nextLine();
Boolean found = false;
int i = s.length();
while(found==false)
{
i--;
ArrayList<String> sub = new ArrayList<String>();
for(int j = 0; j <= s.length() - i; j++)
{
if(sub.contains(s.substring(j, j+i)))
found = true;
else
sub.add(s.substring(j, j+i));
}

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


import java.util.Scanner;

public class vasyaTheHipster {

	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		int a = scan.nextInt(), b = scan.nextInt();
		if (a > b) {
			System.out.print(b + " ");
			a -= b;
			a /= 2;
			System.out.print(a + " ");
		} else {
			System.out.print(a + " ");
			b -= a;
			b /= 2;
			System.out.print(b + " ");
		}
	}

}


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

public class TaskB implements Runnable {
    boolean prime[] = new boolean[100001];
    void sieveOfEratosthenes(int n) {
        for (int i = 0; i < n; i++)
            prime[i] = true;
        for (int p = 2; p * p <= n; p++) {
            if (prime[p] == true) {
                for (int i = p * p; i <= n; i += p)
                    prime[i] = false;
            }
        }
    }
    public void run() {
        InputReader c = new InputReader(System.in);
        PrintWriter w = new PrintWriter(System.out);
        int n=c.nextInt();
        int k=c.nextInt();
        int ans;
        k = Math.min(k,n-k+1);
        System.out.println(k+n*3-1);
        w.close();
    }

    public static void sortbyColumn(int arr[][], int col)
    {

        Arrays.sort(arr, new Comparator<int[]>()
        {
            public int compare(int[] o1, int[] o2){
                return(Integer.valueOf(o1[col]).compareTo(o2[col]));
            }
        });

    }
    class Graph{
        private final int v;
        private List<List<Integer>> adj;
        Graph(int v){
            this.v = v;
            adj = new ArrayList<>(v);
            for(int i=0;i<v;i++){
                adj.add(new LinkedList<>());
            }
        }
        private void addEdge(int a,int b){
            adj.get(a).add(b);
        }
        private boolean isCyclic()
        {
            boolean[] visited = new boolean[v];
            boolean[] recStack = new boolean[v];
            for (int i = 0; i < v; i++)
                if (isCyclicUtil(i, visited, recStack))
                    return true;

            return false;
        }
        private boolean isCyclicUtil(int i, boolean[] visited, boolean[] recStack)
        {
            if (recStack[i])
                return true;
            if (visited[i])
                return false;
            visited[i] = true;
            recStack[i] = true;
            List<Integer> children = adj.get(i);
            for (Integer c: children)
                if (isCyclicUtil(c, visited, recStack))
                    return true;
            recStack[i] = false;
            return false;
        }
    }
    static long gcd(long a, long b)
    {
        if (b == 0)
            return a;
        return gcd(b, a % b);
    }
    public static class DJSet {
        public int[] upper;

        public DJSet(int n) {
            upper = new int[n];
            Arrays.fill(upper, -1);
        }

        public int root(int x) {
            return upper[x] < 0 ? x : (upper[x] = root(upper[x]));
        }

        public boolean equiv(int x, int y) {
            return root(x) == root(y);
        }

        public boolean union(int x, int y) {
            x = root(x);
            y = root(y);
            if (x != y) {
                if (upper[y] < upper[x]) {
                    int d = x;
                    x = y;
                    y = d;
                }
                upper[x] += upper[y];
                upper[y] = x;
            }
            return x == y;
        }
    }
    public static int[] radixSort(int[] f)
    {
        int[] to = new int[f.length];
        {
            int[] b = new int[65537];
            for(int i = 0;i < f.length;i++)b[1+(f[i]&0xffff)]++;
            for(int i = 1;i <= 65536;i++)b[i]+=b[i-1];
            for(int i = 0;i < f.length;i++)to[b[f[i]&0xffff]++] = f[i];
            int[] d = f; f = to;to = d;
        }
        {
            int[] b = new int[65537];
            for(int i = 0;i < f.length;i++)b[1+(f[i]>>>16)]++;
            for(int i = 1;i <= 65536;i++)b[i]+=b[i-1];
            for(int i = 0;i < f.length;i++)to[b[f[i]>>>16]++] = f[i];
            int[] d = f; f = to;to = d;
        }
        return f;
    }
    static class InputReader {
        private InputStream stream;
        private byte[] buf = new byte[1024];
        private int curChar;
        private int numChars;
        private SpaceCharFilter filter;
        private BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

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

        public int read() {
            if (numChars==-1)
                throw new InputMismatchException();

            if (curChar >= numChars) {
                curChar = 0;
                try {
                    numChars = stream.read(buf);
                }
                catch (IOException e) {
                    throw new InputMismatchException();
                }

                if(numChars <= 0)
                    return -1;
            }
            return buf[curChar++];
        }

        public String nextLine() {
            String str = "";
            try {
                str = br.readLine();
            }
            catch (IOException e) {
                e.printStackTrace();
            }
            return str;
        }
        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 - '0';
                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 - '0') * m;
                    c = read();
                }
            }
            return res * sgn;
        }

        public String readString() {
            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) {
            if (filter != null)
                return filter.isSpaceChar(c);
            return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
        }

        public String next() {
            return readString();
        }

        public interface SpaceCharFilter {
            public boolean isSpaceChar(int ch);
        }
    }
    public static void main(String args[]) throws Exception {
        new Thread(null, new TaskB(),"TaskB",1<<26).start();
    }
}


import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.nio.charset.Charset;
import java.util.Arrays;

public class CF1161C {
    public static void main(String[] args) throws Exception {
        boolean local = System.getProperty("ONLINE_JUDGE") == null;
        boolean async = false;

        Charset charset = Charset.forName("ascii");

        FastIO io = local ? new FastIO(new FileInputStream("D:\\DATABASE\\TESTCASE\\Code.in"), System.out, charset) : new FastIO(System.in, System.out, charset);
        Task task = new Task(io, new Debug(local));

        if (async) {
            Thread t = new Thread(null, task, "dalt", 1 << 27);
            t.setPriority(Thread.MAX_PRIORITY);
            t.start();
            t.join();
        } else {
            task.run();
        }

        if (local) {
            io.cache.append("\n\n--memory -- \n" + ((Runtime.getRuntime().totalMemory() - Runtime.getRuntime().freeMemory()) >> 20) + "M");
        }

        io.flush();
    }

    public static class Task implements Runnable {
        final FastIO io;
        final Debug debug;
        int inf = (int) 1e8;
        int mod = (int) 1e9 + 7;

        public int mod(int val) {
            val %= mod;
            if (val < 0) {
                val += mod;
            }
            return val;
        }

        public int mod(long val) {
            val %= mod;
            if (val < 0) {
                val += mod;
            }
            return (int) val;
        }

        int bitAt(int x, int i) {
            return (x >> i) & 1;
        }

        int bitAt(long x, int i) {
            return (int) ((x >> i) & 1);
        }

        public Task(FastIO io, Debug debug) {
            this.io = io;
            this.debug = debug;
        }

        @Override
        public void run() {
            solve();
        }

        public void solve() {
            int n = io.readInt();
            int m = 50;
            int cnt = 0;
            for (int i = 0; i < n; i++) {
                int v = io.readInt();
                if (m > v) {
                    m = v;
                    cnt = 0;
                }
                if (m == v) {
                    cnt++;
                }
            }

            if (cnt > n / 2) {
                io.cache.append("Bob");
            } else {
                io.cache.append("Alice");
            }
        }
    }

    public static class FastIO {
        public final StringBuilder cache = new StringBuilder();
        private final InputStream is;
        private final OutputStream os;
        private final Charset charset;
        private StringBuilder defaultStringBuf = new StringBuilder(1 << 8);
        private byte[] buf = new byte[1 << 13];
        private int bufLen;
        private int bufOffset;
        private int next;

        public FastIO(InputStream is, OutputStream os, Charset charset) {
            this.is = is;
            this.os = os;
            this.charset = charset;
        }

        public FastIO(InputStream is, OutputStream os) {
            this(is, os, Charset.forName("ascii"));
        }

        private int read() {
            while (bufLen == bufOffset) {
                bufOffset = 0;
                try {
                    bufLen = is.read(buf);
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
                if (bufLen == -1) {
                    return -1;
                }
            }
            return buf[bufOffset++];
        }

        public void skipBlank() {
            while (next >= 0 && next <= 32) {
                next = read();
            }
        }

        public int readInt() {
            int sign = 1;

            skipBlank();
            if (next == '+' || next == '-') {
                sign = next == '+' ? 1 : -1;
                next = read();
            }

            int val = 0;
            if (sign == 1) {
                while (next >= '0' && next <= '9') {
                    val = val * 10 + next - '0';
                    next = read();
                }
            } else {
                while (next >= '0' && next <= '9') {
                    val = val * 10 - next + '0';
                    next = read();
                }
            }

            return val;
        }

        public long readLong() {
            int sign = 1;

            skipBlank();
            if (next == '+' || next == '-') {
                sign = next == '+' ? 1 : -1;
                next = read();
            }

            long val = 0;
            if (sign == 1) {
                while (next >= '0' && next <= '9') {
                    val = val * 10 + next - '0';
                    next = read();
                }
            } else {
                while (next >= '0' && next <= '9') {
                    val = val * 10 - next + '0';
                    next = read();
                }
            }

            return val;
        }

        public double readDouble() {
            boolean sign = true;
            skipBlank();
            if (next == '+' || next == '-') {
                sign = next == '+';
                next = read();
            }

            long val = 0;
            while (next >= '0' && next <= '9') {
                val = val * 10 + next - '0';
                next = read();
            }
            if (next != '.') {
                return sign ? val : -val;
            }
            next = read();
            long radix = 1;
            long point = 0;
            while (next >= '0' && next <= '9') {
                point = point * 10 + next - '0';
                radix = radix * 10;
                next = read();
            }
            double result = val + (double) point / radix;
            return sign ? result : -result;
        }

        public String readString(StringBuilder builder) {
            skipBlank();

            while (next > 32) {
                builder.append((char) next);
                next = read();
            }

            return builder.toString();
        }

        public String readString() {
            defaultStringBuf.setLength(0);
            return readString(defaultStringBuf);
        }

        public int readLine(char[] data, int offset) {
            int originalOffset = offset;
            while (next != -1 && next != '\n') {
                data[offset++] = (char) next;
                next = read();
            }
            return offset - originalOffset;
        }

        public int readString(char[] data, int offset) {
            skipBlank();

            int originalOffset = offset;
            while (next > 32) {
                data[offset++] = (char) next;
                next = read();
            }

            return offset - originalOffset;
        }

        public int readString(byte[] data, int offset) {
            skipBlank();

            int originalOffset = offset;
            while (next > 32) {
                data[offset++] = (byte) next;
                next = read();
            }

            return offset - originalOffset;
        }

        public char readChar() {
            skipBlank();
            char c = (char) next;
            next = read();
            return c;
        }

        public void flush() {
            try {
                os.write(cache.toString().getBytes(charset));
                os.flush();
                cache.setLength(0);
            } catch (IOException e) {
                throw new RuntimeException(e);
            }
        }

        public boolean hasMore() {
            skipBlank();
            return next != -1;
        }
    }

    public static class Debug {
        private boolean allowDebug;

        public Debug(boolean allowDebug) {
            this.allowDebug = allowDebug;
        }

        public void assertTrue(boolean flag) {
            if (!allowDebug) {
                return;
            }
            if (!flag) {
                fail();
            }
        }

        public void fail() {
            throw new RuntimeException();
        }

        public void assertFalse(boolean flag) {
            if (!allowDebug) {
                return;
            }
            if (flag) {
                fail();
            }
        }

        private void outputName(String name) {
            System.out.print(name + " = ");
        }

        public void debug(String name, int x) {
            if (!allowDebug) {
                return;
            }

            outputName(name);
            System.out.println("" + x);
        }

        public void debug(String name, long x) {
            if (!allowDebug) {
                return;
            }
            outputName(name);
            System.out.println("" + x);
        }

        public void debug(String name, double x) {
            if (!allowDebug) {
                return;
            }
            outputName(name);
            System.out.println("" + x);
        }

        public void debug(String name, int[] x) {
            if (!allowDebug) {
                return;
            }
            outputName(name);
            System.out.println(Arrays.toString(x));
        }

        public void debug(String name, long[] x) {
            if (!allowDebug) {
                return;
            }
            outputName(name);
            System.out.println(Arrays.toString(x));
        }

        public void debug(String name, double[] x) {
            if (!allowDebug) {
                return;
            }
            outputName(name);
            System.out.println(Arrays.toString(x));
        }

        public void debug(String name, Object x) {
            if (!allowDebug) {
                return;
            }
            outputName(name);
            System.out.println("" + x);
        }

        public void debug(String name, Object... x) {
            if (!allowDebug) {
                return;
            }
            outputName(name);
            System.out.println(Arrays.deepToString(x));
        }
    }
}


import java.util.Scanner;

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

    long n = input.nextLong();
    long k = input.nextLong();

    long ans = Long.highestOneBit(n);
    System.out.println(k == 1 ? n : (ans - 1) | (ans));
  }
}


    import java.util.HashSet;
    import java.util.Scanner;
    import java.util.Set;

    public class Main {

        public static void main(String[] args) {

            Scanner sc = new Scanner(System.in);
            int n = sc.nextInt();
            String str = sc.next();
            StringBuilder sb = new StringBuilder(str);
            for (int i = 0; i < str.length(); i++)
                sb.setCharAt(i, Character.toLowerCase(str.charAt(i)));
            str = sb.toString();
            Set<Character> letters = new HashSet<Character>();
            for (int i = 0; i < n ; i++) {
                letters.add(str.charAt(i));
            }
            if(letters.size()==26)
                System.out.println("YES");
            else
                System.out.println("NO");
        }
    }


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

public class _v11 {

    public static void main(String args[]){

        PrintWriter out = new PrintWriter(System.out);
        Reader in = new Reader();
        long k = in.nextLong();
        long a = in.nextLong();
        long b = in.nextLong();
        if(a<b){
            long temp = a;
            a = b;
            b = temp;
        }
        long ans = a/k + b/k;

        if(ans == 0 || (a-(k*(a/k)) != 0 && b/k == 0)){
            ans = -1;
        }
        out.println(ans);
        out.flush();
        out.close();
    }
    static class Reader {

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

        public Reader() {
            this(System.in);
        }

        public Reader(InputStream is) {
            mIs = is;
        }

        public int read() {
            if (numChars == -1) {
                throw new InputMismatchException();

            }
            if (curChar >= numChars) {
                curChar = 0;
                try {
                    numChars = mIs.read(buf);
                } catch (IOException e) {
                    throw new InputMismatchException();
                }
                if (numChars <= 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 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();
        }

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

        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 boolean isSpaceChar(int c) {
            return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
        }

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

    }

}


import java.util.Scanner;

public class Codeforce1 {

    public static void main(String[] args) {
        Scanner reader = new Scanner(System.in);
        int n = reader.nextInt();

        int res=(int)n/3;
        if (n%3==1 || n%3==2){
            res=(res*2)+1;
        }
        else{
            res=res*2;
        }
        System.out.print(res);
    }
}


import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.Arrays;
import java.util.regex.Pattern;

public class Solution {

	private static boolean check(String s) {
		if (s.split("@").length != 2)
			return false;

		if (s.charAt(0) == '@' || s.charAt(s.length() - 1) == '@')
			return false;

		String username = s.split("@")[0];
		String remains = s.split("@")[1];

		if (remains.split("/").length > 2)
			return false;
		if (remains.charAt(remains.length() - 1) == '/')
			return false;

		String hostname = remains.split("/")[0];

		if (hostname.length() < 1 || hostname.length() > 32)
			return false;

		Pattern p = Pattern.compile("[A-Za-z0-9_]{1,16}");

		String[] temp_hp = hostname.split("\\.");

		int cnt = temp_hp.length + (hostname.charAt(0) == '.' ? 1 : 0)
				+ (hostname.charAt(hostname.length() - 1) == '.' ? 1 : 0);

		String[] host_parts = new String[cnt];
		Arrays.fill(host_parts, "");
		for (int i = 0; i < temp_hp.length; ++i)
			host_parts[i] = temp_hp[i];

		// System.err.println("hostname = " + hostname);
		// System.err.println("host_parts.length = " + host_parts.length);

		if (!p.matcher(username).matches())
			return false;

		for (String hp : host_parts)
			if (!p.matcher(hp).matches())
				return false;

		if (remains.split("/").length == 2) {
			String resourse = remains.split("/")[1];
			return p.matcher(resourse).matches();
		}

		return true;
	}

	public static void main(String[] args) throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		String s = br.readLine();
		if (check(s))
			System.out.println("YES");
		else
			System.out.println("NO");
	}

}


import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.math.BigInteger;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.PriorityQueue;
import java.util.Random;
import java.util.StringTokenizer;
/*
 4
1 3 2 0
 */
public class A {

	public static void main(String[] args) throws IOException {

		FastScanner sc = new FastScanner();
		int n = sc.nextInt();
		int arr[] = sc.readArray(n);
		int dp[][] = new int[n+1][3];
		if(arr[0] == 1 || arr[0] == 3) {
			dp[0][1] = 1;
		}
		if(arr[0] == 2 || arr[0] == 3) {
			dp[0][2] = 1;
		}
		for(int i=1; i<n; i++) {
			dp[i][0] = max(dp[i-1][0],max(dp[i-1][1],dp[i-1][2]));
			dp[i][1] = max(dp[i-1][0],dp[i-1][2]);
			dp[i][2] = max(dp[i-1][0],dp[i-1][1]);
			if(arr[i] == 1 || arr[i] == 3) {
				dp[i][1]++;
			}
			if(arr[i] == 2 || arr[i] == 3) {
				dp[i][2]++;
			}
		}
		int max = 0;
		max = max(dp[n-1][0],max(dp[n-1][1],dp[n-1][2]));
		System.out.println(n-max);

	}

	static class FastScanner {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		StringTokenizer st = new StringTokenizer("");

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

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

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

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

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

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

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

	static int ceil(int x, int y) {
		return (x % y == 0 ? x / y : (x / y + 1));
	}

	static long ceil(long x, long y) {
		return (x % y == 0 ? x / y : (x / y + 1));
	}

	static int max(int x, int y) {
		return Math.max(x, y);
	}

	static int min(int x, int y) {
		return Math.min(x, y);
	}

	static long max(long x, long y) {
		return Math.max(x, y);
	}

	static long min(long x, long y) {
		return Math.min(x, y);
	}

	static int min(int a[]) {
		int x = 1_000_000_00_9;
		for (int i = 0; i < a.length; i++)
			x = min(x, a[i]);
		return x;
	}

	static int max(int a[]) {
		int x = -1_000_000_00_9;
		for (int i = 0; i < a.length; i++)
			x = max(x, a[i]);
		return x;
	}

	static long min(long a[]) {
		long x = (long) 3e18;
		for (int i = 0; i < a.length; i++)
			x = min(x, a[i]);
		return x;
	}

	static long max(long a[]) {
		long x = -(long) 3e18;
		for (int i = 0; i < a.length; i++)
			x = max(x, a[i]);
		return x;
	}

	static int power(int x, int y) {
		int res = 1;
		while (y > 0) {
			if (y % 2 == 1)
				res = (res * x);
			y >>= 1;
			x = (x * x);
		}
		return res;
	}

	static long power(long x, long y) {
		long res = 1;
		while (y > 0) {
			if (y % 2 == 1)
				res = (res * x);
			y >>= 1;
			x = (x * x);
		}
		return res;
	}

	static void intsort(int[] a) {
		List<Integer> temp = new ArrayList<Integer>();
		for (int i = 0; i < a.length; i++)
			temp.add(a[i]);
		Collections.sort(temp);
		for (int i = 0; i < a.length; i++)
			a[i] = temp.get(i);
	}

	static void longsort(long[] a) {
		List<Long> temp = new ArrayList<Long>();
		for (int i = 0; i < a.length; i++)
			temp.add(a[i]);
		Collections.sort(temp);
		for (int i = 0; i < a.length; i++)
			a[i] = temp.get(i);
	}

	static void reverseintsort(int[] a) {
		List<Integer> temp = new ArrayList<Integer>();
		for (int i = 0; i < a.length; i++)
			temp.add(a[i]);
		Collections.sort(temp);
		Collections.reverseOrder();
		for (int i = 0; i < a.length; i++)
			a[i] = temp.get(i);
	}

	static void reverselongsort(long[] a) {
		List<Long> temp = new ArrayList<Long>();
		for (int i = 0; i < a.length; i++)
			temp.add(a[i]);
		Collections.sort(temp);
		Collections.reverseOrder();
		for (int i = 0; i < a.length; i++)
			a[i] = temp.get(i);
	}

	static class longpair implements Comparable<longpair> {
		long x, y;

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

		public int compareTo(longpair p) {
			return Long.compare(this.x, p.x);
		}
	}

	static class intpair implements Comparable<intpair> {
		int x, y;

		intpair(int x, int y) {
			this.x = x;
			this.y = y;
		}

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

		//		a = new pair [n];
		//		a[i] = new pair(coo,cost);

	}

	public static int gcd(int a, int b) {
		BigInteger b1 = BigInteger.valueOf(a);
		BigInteger b2 = BigInteger.valueOf(b);
		BigInteger gcd = b1.gcd(b2);
		return gcd.intValue();
	}

	public static long gcd(long a, long b) {
		BigInteger b1 = BigInteger.valueOf(a);
		BigInteger b2 = BigInteger.valueOf(b);
		BigInteger gcd = b1.gcd(b2);
		return gcd.longValue();
	}
}


import java.util.Scanner;

public class SimpleMolecules {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int a = sc.nextInt(), b = sc.nextInt(), c = sc.nextInt();
		int sum = a + b + c;
		if ((sum & 1) != 0)
			System.out.println("Impossible");
		else {
			sum >>= 1;
			int x = sum - a;
			int y = sum - b;
			int z = sum - c;
			if(x >= 0 && y >= 0 && z >= 0)
				System.out.printf("%d %d %d\n", z, x, y);
			else
				System.out.println("Impossible");
		}
	}

}