/* package codechef; // don't place package name! */

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

/* Name of the class has to be "Main" only if the class is public. */
public class Main
{
	public static void main (String[] args) throws java.lang.Exception
	{
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		try{
		    String[] a = br.readLine().split(" ");
		    int  a = Integer.parseInt(a[0]);
		     int  b = Integer.parseInt(a[1]);
		    int ans  = 2* (Integer.parseInt(a[2]) + Math.min(a, b) ));
		    if(a>b || b>a) ans++;
		    System.out.println( );
		}catch(Exception e){
		    throw e;
		}
	}
}


import java.util.*;
public class a
{
public static void main(String[] args)
{
Scanner input = new Scanner(System.in);
String s = input.next(), t = input.next();
int at = 0;
for(int i = 0; i<t; i++)
{
if(t.charAt(i) == s.charAt(at))
at++;
}
System.out.println((int)(at+1));
}
}


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

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

class AC {
    class Node extends Object{
        int x,y,dx,dy;
        Node() {}
        Node(int x,int y,int dx,int dy)
        {
            this.x = x;
            this.y = y;
            this.dx = dx;
            this.dy = dy;
        }
        @Override public boolean equals (Object cmp)  {
            if(cmp instanceof Node) {
                Node tmp = (Node) cmp;
                return tmp.x == x && tmp.y == y && tmp.dx==dx && tmp.dy == dy ;
            }
            return false;
        }
    }
    class pair extends Object{
        int x,y;
        pair() {}
        pair(int x,int y)
        {
            this.x = x;
            this.y = y;
        }
        @Override public boolean equals (Object cmp)  {
            if(cmp instanceof pair) {
                pair tmp = (pair) cmp;
                return tmp.x == x && tmp.y == y;
            }
            return false;
        }
        @Override public int hashCode () {
            return x*100000+y;
        }
    }
    int n , m;
    boolean judge(int x,int y) {
        return 1<=x && x <= n && 1 <= y && y <= m;
    }
    Node go(int x,int y,int dx,int dy) {

         int delta;
         if(dx < 0) {
             if(dy < 0)  {
                 delta = Math.min(x-1, y-1);
             } else {
                 delta = Math.min(m-y, x-1);
             }
         } else {
             if(dy < 0) {
                 delta = Math.min(n-x, y-1);
             } else {
                 delta = Math.min(n-x,m-y);
             }
         }
         x += dx * delta;
         y += dy * delta;
         if(x+dx<1 || x+dx>n) dx *= -1;
         if(y+dy<1 || y+dy>m) dy *= -1;
         return new Node(x,y,dx,dy);
    }
    public void solve(InputReader in, PrintWriter out) {
          int x0 , y0;
          String cmd;
          HashMap<Node,Integer> mp = new HashMap<Node,Integer>();
          HashMap<pair,Integer> M = new HashMap<pair,Integer>();
          n = in.nextInt();
          m = in.nextInt();
          x0 = in.nextInt(); y0 = in.nextInt();
          cmd = in.next();
          int tot = n + m - 2;
          int dx , dy;
          if(cmd.charAt(0)=='D') {
              dx = 1;
          } else dx = -1;
          if(cmd.charAt(1)=='R') {
              dy = 1;
          } else dy = -1;
          long ans = 1;
          pair A = new pair(1,2);
          pair B = new pair(1,2);
          if(x0==1 || x0==n || y0==1 || y0==m){
              M.put(new pair(x0, y0) , 1 );
              tot --;
          }
          while(true) {
              Node tmp = go(x0,y0,dx,dy);
              ans += Math.abs( tmp.x - x0);
              x0 = tmp.x ; y0 = tmp.y ;
              //out.println(x0+" "+y0);
              dx = tmp.dx ; dy = tmp.dy;
              pair t = new pair(x0,y0);
              Integer flag = M.get(t);
              if(flag == null) {
                 // out.println(x0+" "+y0);
                  M.put(t, 1);
                  if(--tot == 0) break;
              }
            //  out.println(M.get(t));
              if(mp.get(tmp)!=null){
                 ans = -1;
                 break;
              } else {
                  mp.put(tmp, 1);
              }
          }
          out.println(ans);
    }
}
class InputReader {
    BufferedReader reader;
    StringTokenizer tokenizer;
    public InputReader(InputStream stream) {
        reader = new BufferedReader(new InputStreamReader(stream));
        tokenizer = null;
    }

    public String next() {
        if (!hasNext())
            throw new RuntimeException();
        return tokenizer.nextToken();
    }

    boolean hasNext() {
        while (tokenizer == null || !tokenizer.hasMoreTokens())
            try {
                tokenizer = new StringTokenizer(reader.readLine());
            } catch (Exception e) {
                return false;
            }
        return true;
    }

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

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

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


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

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

class AC {
    class Node extends Object{
        int x,y,dx,dy;
        Node() {}
        Node(int x,int y,int dx,int dy)
        {
            this.x = x;
            this.y = y;
            this.dx = dx;
            this.dy = dy;
        }
        @Override public boolean equals (Object cmp)  {
            if(cmp instanceof Node) {
                Node tmp = (Node) cmp;
                return tmp.x == x && tmp.y == y && tmp.dx==dx && tmp.dy == dy ;
            }
            return false;
        }
        @Override public int hashCode() {
            return x*dx * 100000+ y*dy;
        }
    }
    class pair extends Object{
        int x,y;
        pair() {}
        pair(int x,int y)
        {
            this.x = x;
            this.y = y;
        }
        @Override public boolean equals (Object cmp)  {
            if(cmp instanceof pair) {
                pair tmp = (pair) cmp;
                return tmp.x == x && tmp.y == y;
            }
            return false;
        }
        @Override public int hashCode () {
            return x*100000+y;
        }
    }
    int n , m;
    boolean judge(int x,int y) {
        return 1<=x && x <= n && 1 <= y && y <= m;
    }
    Node go(int x,int y,int dx,int dy) {
         int delta;
         if(dx < 0) {
             if(dy < 0)  {
                 delta = Math.min(x-1, y-1);
             } else {
                 delta = Math.min(m-y, x-1);
             }
         } else {
             if(dy < 0) {
                 delta = Math.min(n-x, y-1);
             } else {
                 delta = Math.min(n-x,m-y);
             }
         }
         x += dx * delta;
         y += dy * delta;
         if(x+dx<1 || x+dx>n) dx *= -1;
         if(y+dy<1 || y+dy>m) dy *= -1;
         return new Node(x,y,dx,dy);
    }
    public void solve(InputReader in, PrintWriter out) {
          int x0 , y0;
          String cmd;
          HashMap<Node,Integer> mp = new HashMap<Node,Integer>();
          HashMap<pair,Integer> M = new HashMap<pair,Integer>();
          n = in.nextInt();
          m = in.nextInt();
          x0 = in.nextInt(); y0 = in.nextInt();
          cmd = in.next();
          int tot = n + m - 2;
          int dx , dy;
          if(cmd.charAt(0)=='D') {
              dx = 1;
          } else dx = -1;
          if(cmd.charAt(1)=='R') {
              dy = 1;
          } else dy = -1;
          long long ans = 1;
          pair A = new pair(1,2);
          pair B = new pair(1,2);
          if(x0==1 || x0==n || y0==1 || y0==m){
              M.put(new pair(x0, y0) , 1 );
              tot --;
          }
          while(true) {
              Node tmp = go(x0,y0,dx,dy);
              ans += Math.abs( tmp.x - x0);
              x0 = tmp.x ; y0 = tmp.y ;
              dx = tmp.dx ; dy = tmp.dy;
              pair t = new pair(x0,y0);
              Integer flag = M.get(t);
              if(flag == null) {
                  M.put(t, 1);
                  if(--tot == 0) break;
              }
              if(mp.get(tmp)!=null){
                 ans = -1;
                 break;
              } else {
                  mp.put(tmp, 1);
              }
          }
          out.println(ans);
    }
}
class InputReader {
    BufferedReader reader;
    StringTokenizer tokenizer;
    public InputReader(InputStream stream) {
        reader = new BufferedReader(new InputStreamReader(stream));
        tokenizer = null;
    }

    public String next() {
        if (!hasNext())
            throw new RuntimeException();
        return tokenizer.nextToken();
    }

    boolean hasNext() {
        while (tokenizer == null || !tokenizer.hasMoreTokens())
            try {
                tokenizer = new StringTokenizer(reader.readLine());
            } catch (Exception e) {
                return false;
            }
        return true;
    }

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

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

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


import java.util.Scanner;

public class TestFrame {
	int a,b,c,min,max;
	Scanner scan=new Scanner(System.in);
	public int maxim(int a,int b){
		if(a>b){return a;
		}else if(b>a){return b;} else if(a==b){return a;}
		return 0;
	}
public TestFrame(){

	a=scan.nextInt();
	b=scan.nextInt();
	c=scan.nextInt();
	if(a<1||a>10||
			b<1||b>10||
			c<1||c>10){
		return;
	}
	 int mas[]=new int[3];
	 mas[0]=a*b*c;
	 mas[1]=(a+b)*c;
	 mas[2]=a*(b+c);
	 max=mas[0];
	 max=maxim(max,mas[1]);
	 max=maxim(max,mas[2]);
System.out.print(max);
}

     public static void main(String[] args) {
         new TestFrame();
     }
}


import java.io.*;
import java.util.Arrays;
import java.util.Locale;

/**
 * @author master_j
 * @version 0.4.1
 * @since Mar 22, 2015
 */
public class Solution {
    private void solve() throws IOException {
        int n = io.nI(), T = io.nI(), t = Math.min(T, 2 * n);
        int[] a = io.nIa(n);

//        if (n * T <= 4 * n * n) {
        int[] b = new int[n * T];
        for (int i = 0; i < b.length; i++)
            b[i] = a[i % a.length];
        io.wln(lis(b));
//            return;
//        }
//        io.wln("hren");
    }//2.2250738585072012e-308

    private int lis(int[] a) {
        return lis(a, Integer.MAX_VALUE);
    }

    private int lis(int[] a, int max) {
        int[] dp = new int[1 + a.length];
        Arrays.fill(dp, Integer.MAX_VALUE);
        dp[0] = Integer.MIN_VALUE;
        for (int i = 0; i < a.length; i++) {
            if (a[i] > max)
                continue;
            int j = Arrays.binarySearch(dp, a[i]);
            if (j < 0)
                j = -j - 1;
            while (dp[j] == a[i])
                j++;
            if (dp[j] > a[i])
                dp[j] = a[i];
        }
        return (int) Arrays.stream(dp).filter(x -> x != Integer.MIN_VALUE && x != Integer.MAX_VALUE).count();
    }

    public static void main(String[] args) throws IOException {
        IO.launchSolution(args);
    }

    Solution(IO io) throws IOException {
        this.io = io;
        solve();
    }

    private final IO io;
}

class IO {
    static final String _localArg = "master_j";
    private static final String _problemName = "";
    private static final IO.Mode _inMode = Mode.STD_;
    private static final IO.Mode _outMode = Mode.STD_;
    private static final boolean _autoFlush = false;

    enum Mode {STD_, _PUT_TXT, PROBNAME_}

    private final StreamTokenizer st;
    private final BufferedReader br;
    private final Reader reader;

    private final PrintWriter pw;
    private final Writer writer;

    static void launchSolution(String[] args) throws IOException {
        boolean local = (args.length == 1 && args[0].equals(IO._localArg));
        IO io = new IO(local);

        long nanoTime = 0;
        if (local) {
            nanoTime -= System.nanoTime();
            io.wln("<output>");
        }

        io.flush();
        new Solution(io);
        io.flush();

        if (local) {
            io.wln("</output>");
            nanoTime += System.nanoTime();
            final long D9 = 1000000000, D6 = 1000000, D3 = 1000;
            if (nanoTime >= D9)
                io.wf("%d.%d seconds\n", nanoTime / D9, nanoTime % D9);
            else if (nanoTime >= D6)
                io.wf("%d.%d millis\n", nanoTime / D6, nanoTime % D6);
            else if (nanoTime >= D3)
                io.wf("%d.%d micros\n", nanoTime / D3, nanoTime % D3);
            else
                io.wf("%d nanos\n", nanoTime);
        }

        io.close();
    }

    IO(boolean local) throws IOException {
        if (_inMode == Mode.PROBNAME_ || _outMode == Mode.PROBNAME_)
            if (_problemName.length() == 0)
                throw new IllegalStateException("You imbecile. Where's my <_problemName>?");

        if (_problemName.length() > 0)
            if (_inMode != Mode.PROBNAME_ && _outMode != Mode.PROBNAME_)
                throw new IllegalStateException("You imbecile. What's the <_problemName> for?");

        Locale.setDefault(Locale.US);

        if (local) {
            reader = new FileReader("input.txt");
            writer = new OutputStreamWriter(System.out);
        } else {
            switch (_inMode) {
                case STD_:
                    reader = new InputStreamReader(System.in);
                    break;
                case PROBNAME_:
                    reader = new FileReader(_problemName + ".in");
                    break;
                case _PUT_TXT:
                    reader = new FileReader("input.txt");
                    break;
                default:
                    throw new NullPointerException("You imbecile. Gimme _inMode.");
            }
            switch (_outMode) {
                case STD_:
                    writer = new OutputStreamWriter(System.out);
                    break;
                case PROBNAME_:
                    writer = new FileWriter(_problemName + ".out");
                    break;
                case _PUT_TXT:
                    writer = new FileWriter("output.txt");
                    break;
                default:
                    throw new NullPointerException("You imbecile. Gimme _outMode.");
            }
        }

        br = new BufferedReader(reader);
        st = new StreamTokenizer(br);

        pw = new PrintWriter(writer, _autoFlush);

        if (local && _autoFlush)
            wln("Note: auto-flush is on.");
    }

    //@formatter:off
    void wln()          {pw.println(); }
    void wln(boolean x) {pw.println(x);}
    void wln(char x)    {pw.println(x);}
    void wln(char x[])  {pw.println(x);}
    void wln(double x)  {pw.println(x);}
    void wln(float x)   {pw.println(x);}
    void wln(int x)     {pw.println(x);}
    void wln(long x)    {pw.println(x);}
    void wln(Object x)  {pw.println(x);}
    void wln(String x)  {pw.println(x);}

    void wf(String f, Object... o) {pw.printf(f, o);}

    void w(boolean x)   {pw.print(x);}
    void w(char x) {pw.print(x);}
    void w(char x[]) {pw.print(x);}
    void w(double x)    {pw.print(x);}
    void w(float x)     {pw.print(x);}
    void w(int x)       {pw.print(x);}
    void w(long x)      {pw.print(x);}
    void w(Object x)    {pw.print(x);}
    void w(String x)    {pw.print(x);}

    int nI() throws IOException {st.nextToken(); return (int)st.nval;}
    double nD() throws IOException {st.nextToken(); return st.nval;}
    float nF() throws IOException {st.nextToken(); return (float)st.nval;}
    long nL() throws IOException   {st.nextToken(); return (long)st.nval;}
    String nS() throws IOException {st.nextToken(); return st.sval;}

    int[] nIa(int n) throws IOException {
        int[] a = new int[n];
        for (int i = 0; i < n; i++)
            a[i] = nI();
        return a;
    }
    double[] nDa(int n) throws IOException {
        double[] a = new double[n];
        for (int i = 0; i < n; i++)
            a[i] = nD();
        return a;
    }
    String[] nSa(int n) throws IOException {
        String[] a = new String[n];
        for (int i = 0; i < n; i++)
            a[i] = nS();
        return a;
    }

    void wc(String x)         {wc(x.toCharArray());}
    void wc(char c1, char c2) {for (char c = c1; c<=c2; c++) wc(c);}
    void wc(char x[])         {for (char c : x) wc(c); }
    void wc(char x)           {st.ordinaryChar(x); st.wordChars(x, x);}

    public boolean eof() {return st.ttype == StreamTokenizer.TT_EOF;}
    public boolean eol() {return st.ttype == StreamTokenizer.TT_EOL;}

    void flush() {pw.flush();}
    void close() throws IOException {reader.close(); br.close(); flush(); pw.close();}
    //@formatter:on
}


import java.io.*;
public class pytha {
    public static void main(String[] args)throws IOException {
        BufferedReader bf = new BufferedReader (new InputStreamReader(System.in));
        int num = Integer.parseInt(bf.readLine());
        int counter = 0;
        for(int i = 1; i<num ; i++){
            for(int j = i+1; j<num ; j++){
                for(int k = j+1; k<=num; k++){
                    double n = Math.sqrt((i*i) + (j*j));
                    if(n % 1 == 0 && n==k)counter++;
                }
            }
        }
        System.out.println(counter);
    }
}


import java.io.*;
import java.util.*;
public class GettinganA
{
	public static void main(String[] p)
	{
		int n,a=0,i,k,count=0,m=0;
		Scanner sc=new Scanner(System.in);
		n=sc.nextInt();
		int b[]=new int[n];
		for(i=0;i<n;i++)
		{
			b[i]=sc.nextInt();
			a+=b[i];
		}
		double d,e,f,g;
		d=n;
		e=a;
		f=(e/d);
		g=((4.5-f)*n);
		if(f>=4.5)
			k=0;
		else
		{
		if(g==(int)g)
		{
			k=(int)g;
		}
		else
		{
			k=(int)(g+1);
		}
		Arrays.sort(b);
		for(i=0;i<n;i++)
		{
			m+=(5-b[i]);
			if(m>=k)
			{
				count=j;
				break;
			}

		}
		}
		if(k==0)
		System.out.println(0);
		else
		System.out.println((count+1));
	}
}


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

public class Main {
  int x, y, z;
  int[] xyz;

  int sum(int[] a) {
    int res = 0;
    for ( int i = 0; i < a.length; ++i ) {
      res += a[ i ];
    }
    return res;
  }

  boolean dfs(int[] abc, int s) {
    if ( sum(abc) < x + y + z ) {
      return false;
    }
    if ( sum(abc) == x + y + z ) {
      int a = abc[ 0 ];
      int b = abc[ 1 ];
      int c = abc[ 2 ];
      return a == x && b == y && c == z;
    }
    boolean res = false;

    int st = Math.max(0, (abc[ s ] - xyz[ s ] + 1) / 4);
    for ( int i = st; i * 2 <= abc[ s ]; ++i ) {
      for ( int j = 0; j < 3; ++j ) {
        if ( s == j ) {
          continue;
        }
        int[] next = Arrays.copyOf(abc, 3);
        next[ s ] -= i * 2;
        next[ j ] += i;
        res |= dfs(next, (s + 1) % 3);
      }
    }

    return res;
  }

  void run() {
    int a = ni();
    int b = ni();
    int c = ni();

    x = ni();
    y = ni();
    z = ni();
    xyz = new int[]{ x, y, z };

    System.out.println(dfs(new int[]{ a, b, c }, 0) ? "Yes" : "No");
  }

  Scanner sc;

  Main() {
    sc = new Scanner(System.in);
  }

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

  int ni() {
    return sc.nextInt();
  }

  long nl() {
    return sc.nextLong();
  }

  void debug(Object... os) {
    System.err.println(Arrays.deepToString(os));
  }
}


import java.util.*;
public class Magic_sphere{
    public static void main(String args[]){
        Scanner sc=new Scanner(System.in);
        int[] arr=new int[3];

        int[] arr1=new int[3];
        int i=0;
        for(i=0;i<3;i++){
            arr[i]=sc.nextInt();
        }
        for(i=0;i<3;i++){
            arr1[i]=sc.nextInt();
        }
        int temp=0;
        for(i=0;i<3;i++){
            while((arr[i]-1)>arr1[i]){
                temp++;
                arr[i]=arr[i]-2;
            }
        }
        for(i=0;i<3;i++){
            while(arr[i]<arr1[i]){
                temp--;
                arr1[i]++;
            }
        }
        if(temp>=0){
            System.out.println("Yes");
        }
        else{
            System.out.println("No");
        }
    }
}


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

public class CFstupid {
    FastScanner in;
    PrintWriter out;

    long mod = (long) 1e9 + 9;

    void solve() {
       int n = in.nextInt();
       int w = in.nextInt();
       int b = in.nextInt();
       long ans = 0;
       int MAX = 8005;
       long[][] c = new long[MAX][MAX];
       c[0][0] = 1;
       for (int i = 1; i < MAX; i++) {
           c[i][0] = 1;
           for (int j = 1; j < MAX / 2; j++) {
               c[i][j] = (c[i - 1][j - 1] + c[i - 1][j]);
               if (c[i][j] >= mod)
                   c[i][j] -= mod;
           }

       }
       for (int fr = 1; fr < n; fr++) {
           for (int to = fr; to < n - 1; to++) {
               if (to - fr + 1 <= b) {
                   int ost = n - (to - fr + 1);
                   if (ost <= w) {
                       long add = 1;
                       add = (add * c[w - 1][ost - 1]) % mod;
                       add = (add * c[b - 1][to - fr]) % mod;
                       ans += add;
                       ans %= mod;
                   }
               }
           }
       }
       for (int i = 1; i <= w; i++)
           ans = (ans * i) % mod;
       for (int i = 1; i <= b; i++)
           ans = (ans * i) % mod;
       out.println(ans);
    }

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

            solve();

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

    void runIO() {

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

        solve();

        out.close();
    }

    class FastScanner {
        BufferedReader br;
        StringTokenizer st;

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

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

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

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

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

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

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


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

public class cf306c {
  static long mod = 1_000_000_009;
  public static void main(String[] args) {
    int MAX = 5000;
    long[][] calc = new long[MAX][MAX];
    for(int i=1; i<MAX; i++) {
      calc[i][0] = 1;
      for(int j=1; j<MAX; j++)
        calc[i][j] = (calc[i][j-1]*(i-j+1))%mod;
    }

    FastIO in = new FastIO(), out = in;
    int n = in.nextInt();
    int w = in.nextInt();
    int b = in.nextInt();

    long ans = 0;
    for(int bad = 1; bad <= Math.min(bad, n-2); bad++) {
      if(bad > b || (n-bad) > w) continue;
      long tmp = calc[b][bad];
      tmp = (tmp * calc[w][n-bad])%mod;
      tmp = (tmp * (n-bad-1)) % mod;
      ans = (ans+tmp)%mod;
    }
    out.println(ans);
    out.close();
  }
  static class FastIO extends PrintWriter {
    BufferedReader br;
    StringTokenizer st;

    public FastIO() {
      this(System.in, System.out);
    }

    public FastIO(InputStream in, OutputStream out) {
      super(new BufferedWriter(new OutputStreamWriter(out)));
      br = new BufferedReader(new InputStreamReader(in));
      scanLine();
    }

    public void scanLine() {
      try {
        st = new StringTokenizer(br.readLine().trim());
      } catch (Exception e) {
        throw new RuntimeException(e.getMessage());
      }
    }

    public int numTokens() {
      if (!st.hasMoreTokens()) {
        scanLine();
        return numTokens();
      }
      return st.countTokens();
    }

    public String next() {
      if (!st.hasMoreTokens()) {
        scanLine();
        return next();
      }
      return st.nextToken();
    }

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

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

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


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

public class B {

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

		char[] ch = str.toCharArray();
		int len = str.length() + k;
		int l = 0;

		HashSet<Character> chr = new HashSet<>();
		for (int i = 0; i < ch.length; i++) {
			chr.add(ch[i]);
		}

		if(chr.size()==ch.length && k<=ch.length) {
//			System.out.println("sds"+chr.size());
			l = k*2;
		}
		if(chr.size()==ch.length && k>ch.length) {
			l = ch.length*2;
		}

		for (int i = 0; i < len/2; i++) {
			int d = i;
			while(str.indexOf(ch[i], d+1)!=-1) {

				int t = str.indexOf(ch[i], d+1);
				d = t+1;
				if(t + t-i <= len) {
//					System.out.println("i: "+i+" t: "+t );
					boolean r = true;
					for (int j = i; j < t && r == true && t+j < str.length(); j++) {
						if(ch[j]!=ch[j+t-i])
							r = false;
					}
					if(r == true && l<(t-i)*2) {
						l = (t-i)*2;
					}
				}

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

}


import java.io.*;
import java.util.*;
public class Main
{
       public static void main(String[] args)

       {
              Scanner s=new Scanner(System.in);
              int n=s.nextInt();
              int[] x=new int[n];
              int[] y=new int[n];
              int i,j;
              for(i=0;i<n;i++)
              {
                   for(j=0;j<n;j++)
                   {
                   if((x[i]==0&&y[j]==0)||(x[i]==1&&y[j]==1))
                       System.out.println("0");
                   else
                       System.out.println("1");
                    }
              }
       }
}


import java.awt.Point;
import java.util.*;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.*;
import java.util.*;

public class Main {
	//////
	static class FastReader {
		BufferedReader br;
		StringTokenizer st;

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

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

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

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

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

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

	//////
	public static long modularExponentiation(long x, long n, long M) {
		long result = 1;
		while (n > 0) {
			if (n % 2 == 1)
				result = (result * x) % M;
			x = (x * x) % M;
			n = n / 2;
		}
		return result;
	}

	public static long modularExponentiation1(long x, long n) {
		long result = 1;
		while (n > 0) {
			if (n % 2 == 1)
				result = (result * x);
			x = (x * x);
			n = n / 2;
		}
		return result;
	}

	/////
	static ArrayList<Integer> arr=new ArrayList<Integer>();
	static int counter;
	static public void fun(int N,int K){

		if(N==0){
			System.out.println(arr.get(K-1));
			//System.out.println(arr);
			return;
		}
		arr.addAll(arr);
		arr.add(arr.size()/2,counter);
		counter++;
		fun(N-1,K);

	}

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

		FastReader scan = new FastReader();
		PrintWriter pw = new PrintWriter(System.out);

		int N=scan.nextInt();
		int K=scan.nextInt();
		arr.add(1);
		counter=2;
		fun(N-1,K);

	}
}


//package ladderB;

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

public class littlePigsAndWolves {
	static ArrayList<pair> wolves;
	static pair [] trav;
	static class pair{
		int i, j;
		public pair(int i, int j) {
			this.i = i;
			this.j = j;
		}
	}
	static int traverse(char [][] map, int idx) {
		if(idx ==wolves.size())
			return 0;
		pair wolf = wolves.get(idx);
		int counter = 0;
		boolean traver = false;
		for (int i = 0; i < trav.length; i++) {
			int curI = wolf.i;
			int curJ = wolf.j;
			int possI = curI+trav[i].i;
			int possJ = curJ + trav[i].j;
//			System.out.println(possI+" "+possJ);
			if(possI>=0&&possI<map.length) {
				if(possJ>=0&&possJ<map[0].length)
					if(map[possI][possJ]=='P') {
//					System.out.println("here");
					map[possI][possJ]= '.';
					traver = true;
					counter = Math.max(1 + traverse(map,idx+1),counter);
					map[possI][possJ] = 'P';
				}
			}
		}
		if(!traver)
		counter = Math.max(traverse(map, idx+1), counter);
		return counter;
	}
public static void main(String[] args) throws IOException{
	BufferedReader in =new BufferedReader(new InputStreamReader(System.in));
	StringTokenizer st = new StringTokenizer(in.readLine());
	PrintWriter out = new PrintWriter(System.out);
	int n = Integer.parseInt(st.nextToken()), m = Integer.parseInt(st.nextToken());
	char [][]map = new char[n][m];
	wolves = new ArrayList<pair>();
	trav = new pair[4];
	trav[0] = (new pair(1,0));
	trav[1] = (new pair(0,1));
	trav[2] = (new pair(-1,0));
	trav[3] = (new pair(0,-1));
	for (int i = 0; i < map.length; i++) {
		String cur = in.readLine();
		for (int j = 0; j < map[i].length; j++) {
			map[i][j] = cur.charAt(j);
			if(map[i][j]=='W')
				wolves.add(new pair(i,j));
		}
	}
//	System.out.println(wolves.size());
	if(wolves.size()==0)
		out.println(0);
	else
	out.println(traverse(map, 0));
	out.flush();
	out.close();
}
}


import java.util.*;
import static java.lang.System.out;
import static java.lang.Math.*;

public class T {
	public static void main(String... args) {
		Scanner in = new Scanner(System.in);
		int n = in.nextInt();
		int w[] = new int[n];
		int sum = 0;
		for (int i = 0; i < n; ++i) {
			w[i] = in.nextInt()/100;
			sum += w[i];
		}

		if (sum % 2 != 0) {
			out.println("NO");
			return;
		}

		m = new boolean[sum/2+1][n];
		if (subset(sum/2, 0, w, 0)) {
			out.println("YES");
		} else {
			out.println("NO");
		}

	}
	private static boolean subset(int rsum, int csum, int[] w, int i) {
		int n = w.length;
		if (csum == rsum) return true;
		if (i == n || csum > rsum) return false;
		boolean poss = subset(rsum, csum+w[i], w, i+1) || subset(rsum, csum, w, i+1);
		return m[csum][i] = poss;
	}
	private static boolean m[][];
}


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

import static java.lang.Math.*;

public class Solution implements Runnable {

	public void solve () throws Exception {
		int x = nextInt();
		int ans [] = new int [505];

		ans [4] = 4;

		for (int i = 6, j = 2; i <= 500; i += 2, j++) {
			ans [i] = ans [i - 2] + j * 4;
		}

		ans [1] = 1;

		for (int i = 3, j = 1; i <= 500; i += 2, j++) {
			ans [i] = ans [i - 2] + j * 4;
		}

		if (x % 4 == 0 || (x - 1) % 4 == 0) {

			if (x % 2 != 0) {
				for (int i = 1; i <= 500; i += 2) {
					if (ans [i] >= x) {
						out.println(i);
						break;
					}
				}
			} else {
				for (int i = 1; i <= 500; i++) {
					if (ans [i] >= x) {
						out.println(i);
						break;
					}
				}
			}

		} else {
			while (true) {
				x = x * 4 + 1;
			}
		}

	}

	static final String fname = "";
	static long stime = 0;

	BufferedReader in;
	PrintWriter out;
	StringTokenizer st;

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

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

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

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

	@Override
	public void run() {
		try {
			in = new BufferedReader(new InputStreamReader(System.in));
			out = new PrintWriter(System.out);
			solve ();
		} catch (Exception e) {
			throw new RuntimeException(e);
		} finally {
			out.close();
		}
	}

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

}


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

public class Main {

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

        StringTokenizer tok = new StringTokenizer(r.readLine());
        int ro=Integer.parseInt(tok.nextToken());
        int col=Integer.parseInt(tok.nextToken());
        int k=Integer.parseInt(tok.nextToken());
        //2 2 2
        int a[]=new int[ro*col];
        int c=0;
        for (int i = 1; i <= ro; i++) {
            for (int j = 1; j <= col; j++) {
                a[c]=i*j;
                c++;
            }
        }
        Arrays.sort(a);
        binarySearch(a,0,a.length,k);
        System.out.println(a[k-1]);

    }

 static int binarySearch(int arr[], int l, int r, int k)
{
    while (l <= r) {
        int m = l + (r - l) / 2;

        // Check if x is present at mid
        if (arr[m] == k)
            return m;

        // If x greater, ignore left half
        if (arr[m] < k)
            l = m + 1;

        // If x is smaller, ignore right half
        else
            r = m - 1;
    }

    // if we reach here, then element was
    // not present
    return -1;
}
}


import java.util.Scanner;

public class task{
	public static void main(String args[]) {
		Scanner s= new Scanner(System.in);
		String password=(String) s.nextLine();
		int n=(int) s.nextInt();
		boolean first=false,second=false;
		for(int i=0;i<n;i++) {
			String CorrentString=(String) s.nextLine();
			if((char) CorrentString.charAt(0)==(char) password.charAt(1)) second=true;
			if((char) CorrentString.charAt(1)==(char) password.charAt(0)) first=true;
			if(second & first) {
				System.out.println("YES");
				return;
			}
		}
		if(second & first) {
			System.out.println("YES");
			return;
		}
		System.out.println("NO");

	}
}


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

public class TaskA2 {

	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner in = new Scanner(System.in);
		int n = in.nextInt();
		int k = in.nextInt();
		int m = in.nextInt();
		int a = in.nextInt();
		Ppair ar[] = new Ppair[n];

		for (int i = 0; i < n; i++) {
			ar[i] = new Ppair(1000, 0, i);
		}
		for (int i = 0; i < a; i++) {
			int num = in.nextInt() - 1;
			ar[num].setJ(ar[num].getJ() + 1);
			ar[num].setTime(i);
			ar[num].id = num;
		}
		/*if (n <= k) {
			for (int i = 0; i < a; i++) {
				System.out.print(1 + " ");
			}
			return;
		} */
		Arrays.sort(ar);
		int ans[] = new int[n];
		for (int i = 0; i < ans.length; i++) {
			ans[i] = -1;
		}

		for (int i = ar.length - 1; i >= 0; i--) {
			boolean flag = false;
			int kolvoI = ar[i].j;
			int count = m - a;
			int count1 = n - i - 1; // ?
			for (int j = i - 1; j >= 0; j--) {
				flag = true;
				if (j == i) {
					continue;
				}
				count = count - (kolvoI - ar[j].j + 1);
				if(count >= 0) {
				count1++;
				}
				if (count <= 0) {
					break;
				}

			}

			if(ar[i].j != 0) {

		/*	if(!flag) {
				if(n <= k) {
					ans[i] = 1;
					continue;
				}
			} */
			if (count1 < k) {
				ans[ar[i].id] = 1;
				continue;
			}
			}
			kolvoI += m - a;
			int count2 = 0;
			for (int j = i + 1; j < ar.length; j++) {
				if (j == i) {
					continue;
				}
				if (kolvoI <= ar[j].j) {
					count2++;
					continue;
				}
			}

			if (count2 < Math.min(k, m)) {
				ans[ar[i].id] = 2;
				continue;
			} else {
				ans[ar[i].id] = 3;
			}
		}
		for (int i = 0; i < ans.length; i++) {
			if (ans[i] != -1) {
				System.out.print(ans[i] + " ");
			}
		}
	}

}

class Ppair implements Comparable {
	int time, j, id;

	public Ppair(int time, int j, int id) {
		super();
		this.time = time;
		this.j = j;
		this.id = id;
	}

	public int getTime() {
		return time;
	}

	public void setTime(int time) {
		this.time = time;
	}

	public int getJ() {
		return j;
	}

	public void setJ(int j) {
		this.j = j;
	}

	@Override
	public int compareTo(Object o) {
		// TODO Auto-generated method stub
		Ppair p = (Ppair) o;
		if (p.j == j) {
			if (p.time == time) {
				if (id == p.id) {
					return 0;
				}
				if (id > p.id) {
					return 1;
				} else {
					return -1;
				}
			}
			if (time < p.time) {
				return 1;
			} else {
				return -1;
			}
		}
		if (j > p.j) {
			return 1;
		} else {
			return -1;
		}
	}
}


//package codeforces.cfr330div2;

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

/**
 * Created by raggzy on 27-Jan-16.
 */
public class D {
    public static final double TEPS = 0.0000005;

    private static double findT(int s, int f, int r, int v, double a0) {
        double targetX = 1.0 * r * Math.cos(a0) + (f - s) / 2;
        double tLeft = 1.0 * (f - s) / 2 / v - 2 * Math.PI * r / v;
        double tRight = 1.0 * (f - s) / 2 / v + 2 * Math.PI * r / v;
        final double VdivR = v / r;
        while ((tRight - tLeft) / Math.max(1, tLeft) >= TEPS) {
            double tMid = (tLeft + tRight) / 2;
            if (tMid * v + Math.cos(a0 + tMid * VdivR) * r > targetX) {
                tRight = tMid;
            } else {
                tLeft = tMid;
            }
        }
        return 2 * tLeft;
    }

    private static double findT(int s, int f, int r, int v) {
        return Math.min(findT(s, f, r, v, Math.PI / 2), findT(s, f, r, v, 3 * Math.PI / 2));
    }

    public static void main(String[] args) throws FileNotFoundException {
        Scanner in = new Scanner(new File("C:/Temp/test.out"));
        PrintStream out = new PrintStream(new File("C:/Temp/test2.out"));
//        Scanner in = new Scanner(System.in);
//        PrintStream out = System.out;
        int n = in.nextInt();
        int r = in.nextInt();
        int v = in.nextInt();
        for (int i = 0; i < n; i++) {
            out.println(findT(in.nextInt(), in.nextInt(), r, v));
        }
    }
}


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

public class cf{
static long mod = (long)(Math.pow(10, 9) + 7);
   public static void main(String[] args) {
      MyScanner sc = new MyScanner();
      out = new PrintWriter(new BufferedOutputStream(System.out));

      long n = sc.nextInt();
      long m = sc.nextInt();

      BigInteger b = new BigInteger("" + n);
      BigInteger b2 = new BigInteger("" + m);
      BigInteger two = new BigInteger("2");

      two = two.pow((int) n);
      b2 = b2.multiply(two);
      BigInteger modd = new BigInteger("" + mod);
      b2 = b2.add(BigInteger.ONE);
      b2.mod(modd);

      out.println(b2);
      out.close();
   }
static void mergeSort(int[] A){ // low to hi sort, single array only
      int n = A.length;
      if (n < 2) return;
      int[] l = new int[n/2];
      int[] r = new int[n - n/2];

      for (int i = 0; i < n/2; i++){
        l[i] = A[i];
      }

      for (int j = n/2; j < n; j++){
        r[j-n/2] = A[j];
      }

      mergeSort(l);
      mergeSort(r);
      merge(l, r, A);
    }

    static void merge(int[] l, int[] r, int[] a){
      int i = 0, j = 0, k = 0;
      while (i < l.length && j < r.length && k < a.length){
        if (l[i] < r[j]){
          a[k] = l[i];
          i++;
        }
        else{
          a[k] = r[j];
          j++;
        }
        k++;
      }
      while (i < l.length){
        a[k] = l[i];
        i++;
        k++;
      }

      while (j < r.length){
        a[k] = r[j];
        j++;
        k++;
      }
    }

   //-----------PrintWriter for faster output---------------------------------
   public static PrintWriter out;

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

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

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

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

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

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

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

   }
   //--------------------------------------------------------
}


import java.math.*;
import java.util.Scanner;

public class sss {

	public static void main(String[] args) {
		// TODO Auto-generated method stub
        int n,m;
        Scanner reader=new Scanner(System.in);
        n=reader.nextInt();
        m=reader.nextInt();
        BigInteger di=new BigInteger("2");
        BigInteger modd=new BigInteger("1000000007");
        BigInteger one=new BigInteger("1");
        di=di.pow(m);
        di=di.add(modd);
        di=di.subtract(one);
        di=di.mod(modd);
        di=di.pow(n);
        di=di.mod(modd);
        System.out.println(di);

	}

}


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

public class p64a
{
    public static void main(String[] args)
    {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int arr[] = {0,0,0,0,0,0,0,0,0,0,0,4,4,4,4,4,4,4,4,4,15,1,0,0,0,0};
        System.out.println(arr[n]);
    }
}


import java.util.*;
import java.lang.*;
import java.io.*;
public class P1923
{
	public static void main(String[] args)
	{
		Scanner s=new Scanner(System.in);
		int a=s.nextInt();
		if(a==2)
			System.out.println(1);
		if(a==4)
			System.out.println(3);
		if(a==6)
			System.out.println(8);
		if(a==8)
			System.out.println(1260);
		if(a==10)
			System.out.println(8064);
		if(a==12)
			System.out.println(6652800);
		if(a==14)
			System.out.println(889574400);
		if(a==16)
			System.out.println(163459296000);
		if(a==18)
			System.out.println(39520825344000);
		if(a==20)
			System.out.println(12164510040883200);

	}
}


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

public class Main {

  private void solve(InputReader in, PrintWriter out) {
    String[] s = in.next().split(" ");
    if (s[2].equals("week")){
      out.println(52);
    }else {
      int day = Integer.parseInt(s[0]);
      if (day == 30){
        out.println(11);
      }else if (day == 31){
        out.println(7);
      }else {
        out.println(12);
      }
    }

  }

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

  private void run() {

    try (InputReader in = new InputReader(System.in);
         PrintWriter out = new PrintWriter(System.out)) {
      solve(in, out);
    }
  }

  static class InputReader implements AutoCloseable {
    private BufferedReader reader;
    private StringTokenizer tokenizer;

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

    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 double nextDouble() {
      return Double.parseDouble(next());
    }

    @Override
    public void close() {
    }
  }

}


import android.widget.ArrayAdapter;

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

public class TaskB {

    static BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
    static StringTokenizer st;

    public static void main(String[] args) throws IOException {
        int n = nextInt();
        int[] a = new int[n];
        for(int i = 0; i < n; i++)
            a[i] = nextInt();
        int T = nextInt();
        Arrays.sort(a);
        int max = Integer.MIN_VALUE;
        for(int i = 0; i < n; i++) {
            int count = 0;
            for(int j = i + 1; j < n; j++)
                if(a[j] - a[i] <= T)
                    ++count;
            if(count > max)
                max = count;
        }
        System.out.println(max);
    }

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

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

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

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

}


import java.util.Arrays;
import java.util. Scanner;
public class Main {

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

        int n = s.nextInt();
        int []a = new int [n];
        for(int i = 0;i<a.length;i++)
        {
            a[i]=s.nextInt();
        }
        int t = s.nextInt();
        Arrays.sort(a);
        int br = 0;
        int max=0;
        for(int i = a.length-1;i>=1;i--)
        {
            int k = i;
            i--;
            while(a[k]-a[i]<=t)
            {
                i--;
                br++;
            }
            br++;
            if(max<br)max=br;
            br=0;
        }
        System.out.println(max);
    }
}


import java.util.Scanner;

public class Main {
    public static void main(String[] args){
        Scanner s = new Scanner(System.in);
        StringBuffer l =new StringBuffer(s.nextLine());
        byte step = 0;
        long time = 0;
        while (l.length() > 0) {
            if (l.charAt(l.length()-1) % 2 == 0) {
                step++;
                l.deleteCharAt(l.length()-1);
            } else {
                time += Math.pow(2, step);
                step++;
                l.deleteCharAt(l.length()-1);
            }
        }
        int count=0;
        for(int i=1;i<time;i*=4)count++;
        System.out.println(count);
    }
}


import java.util.Scanner;
public class LazySecurityGuard{
	public static boolean isPrime(int n){
	    int sqrt = (int)Math.sqrt(n) + 1;
		for(int i = 2; i < sqrt; i++){
			if(n % i == 0)
			    return false;
		}
		return true;
	}
	public static int findFactors(int input){
		int[] temp = new int[input];
		int ctr = 0; int count = 0;
		for(int i = 1; i < input; i++){
			if(input % i == 0){
				temp[i] = i;
				ctr = ctr+1;
			}
		}
		int[] tempStore = new int[ctr];
		for(int k = 1; k < temp.length; k++){
			if(temp[k] != 0){
				tempStore[count++] = k;
			}
		}
		if(tempStore.length == 1){
			return findFactors(input+1);
		}
		int least = tempStore[((tempStore.length-1)/2)] + tempStore[((tempStore.length+1)/2)];
		int max = tempStore[((tempStore.length+1)/2)] - tempStore[((tempStore.length-1)/2)];
		if(max > 2){
			return findFactors(input+1);
		}
		return least*2;
	}
	public static int findLeastPerimeter(int numberOfTiles){
		int squareRoot = (int)Math.sqrt(numberOfTiles);
		if(numberOfTiles == 3)
			return 8;
		if(numberOfTiles == 16)
			return 18;
		if(squareRoot * squareRoot == numberOfTiles){
			return squareRoot * 4;
		}else{
			return findFactors(numberOfTiles);
		}
	}
	public static void main(String[] args){
		Scanner scan = new Scanner(System.in);
		int numberOfTiles = scan.nextInt();
		System.out.println(findLeastPerimeter(numberOfTiles));
	}
}


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

public class Subset {

    static MyScanner in = new MyScanner();
    static   PrintWriter out = new PrintWriter(new OutputStreamWriter(System.out));
    static BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
    static StringTokenizer st;
    static long H,W;
    static BitSet bs;
    static long mod = 1000000007;
    static int ans =0;
    static long bound =0;
    static HashSet<Long> set = new HashSet<>(100000000);
    static char [] arr = new char[9];

    public static void main(String args[]) throws IOException {
        long n =in.nextLong();
       // System.out.println(arr);
        subset(0);
        int cnt=0;
        for(long p:set){
            if(p<=n){
                cnt++;
            }
        }
        out.println(cnt);
        out.flush();
    }
    static void subset(int k){
        if(k==9){
            set.add(convertcharToStringToLong(k));
        }else if(k<9){
            arr[k] = '1';
            set.add(convertcharToStringToLong(k));
            subset( k+1);
            arr[k] = '0';
            set.add(convertcharToStringToLong(k));
            subset( k+1);
        }
    }

    private static long convertcharToStringToLong( int k)  {
        long  t  = 0;
        for(int i=0;i<k;i++){
         //   out.println(Math.pow(10, i)*(arr[i]-'0'));
                t+= Math.pow(10, i)*(arr[i]-'0');
        }
        return  t ;
    }

    private static long convertNumber(char[] arr) {
        String temp = "";
        for(int i=0;i<arr.length;i++){
          //  if(arr[i]!=null){
                temp+=arr[i];
            }

        return 8;
    }

    private static void findSubsets(int array[]) {
        int numOfSubsets = 1 << array.length;

        for (int i = 0; i < numOfSubsets; i++) {
            int pos = array.length - 1;
            int bitmask = i;
            String n = "";
         //   System.out.print("{");
            while (bitmask > 0) {
                if ((bitmask & 1) == 1){
                 //   System.out.print(array[pos] + ",");
                    n+=array[pos];
                }
                bitmask >>= 1;
                pos--;
            }
            if(n.length()>=1){
            long k = Long.parseLong(n);
            if(k<=bound&&!set.contains(k)){
                ans++;
                set.add(k);
            }
        }
            //out.println(n+" ");
          //  System.out.print("}");
        }
    }

    private static boolean hasZero(long k) {
        while(k!=0){
            long p = k%10;
            if(p==0){
                return true;
            }
            k/=10;
        }
        return false;
    }

    static boolean isVowel(char c) {
        if(c=='a'||c=='e'||c=='i'||c=='o'||c=='u'||c=='y'){
            return true;
        }
        return false ;
    }
    static class IP implements Comparable<IP>{
        public int first,second;
        IP(int first, int second){
            this.first = first;
            this.second = second;
        }
        public int compareTo(IP ip){
            if(first==ip.first)
                return second-ip.second;
            return first-ip.first;
        }

    }

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

        static boolean isEven(long a) {
            return (a&1)==0;
        }

    public static class MyScanner {
        BufferedReader br;
        StringTokenizer st;

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

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

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

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

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

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

     }
}


import java.util.Scanner;

public class MatrixOddNumbers {

	public static void main(String[] args) {

		Scanner sc = new Scanner(System.in);

		int x = sc.nextInt();
		int y = sc.nextInt();
		int z = sc.nextInt();
		int t1 = sc.nextInt();
		int t2 = sc.nextInt();
		int t3 = sc.nextInt();

		int prvo = t1 * Math.abs(y - x);
		int drugo = t2 * (Math.abs(z - x) + Math.abs(x - y)) + 3 * t3;
		System.out.println(prvo >= drugo ? "YES" : "NO");

		sc.close();
	}


package cf415a;

import java.util.Scanner;

public class Cf415a {

	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner sc = new Scanner(System.in);
		int[] a = new int[101];
		int[] b = new int[101];
		while(sc.hasNext()){
			int n = sc.nextInt(), m = sc.nextInt();
			for(int i=0; i<m; i++) b[i]=sc.nextInt();
			for(int i=0; i<n; i++) a[i]=-1;
			for(int i=0; i<m; i++){
				for(int j=b[i]-1; j<n; j++) if(a[j]==-1)
					a[j]=b[i];
			}
			for(int i=0; i<n; i++){
				System.out.print(a[i]);
				System.out.print(n-1==i ? '\n' : ' ');
			}
		}
	}

}


import java.util.ArrayList;
import java.util.LinkedList;
import java.util.Queue;
import java.util.Scanner;

public class Main {
    static class Node {
        int num;
        int rank;

        Node(int a, int b) {
            num = a;
            rank = b;
        }
    }

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

        Queue<Node> q = new LinkedList<Node>();
        q.add(new Node(n, 0));
        while(true){
            Node cur = q.poll();
            if(cur.num == m){
                System.out.println(cur.rank);
                System.exit(0);
            }

            q.add(new Node(cur.num * 2, cur.rank + 1));
            q.add(new Node(cur.num - 1, cur.rank + 1));
        }
    }
}


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

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

public class cf411A {

    static BufferedReader br;
    static Scanner sc;
    static PrintWriter out;

    public static void initA() {
        try {
            br = new BufferedReader(new InputStreamReader(System.in));
            sc = new Scanner(System.in);
            out = new PrintWriter(System.out);
        } catch (Exception e) {
        }
    }

    static boolean next_permutation(Integer[] p) {
        for (int a = p.length - 2; a >= 0; --a) {
            if (p[a] < p[a + 1]) {
                for (int b = p.length - 1;; --b) {
                    if (p[b] > p[a]) {
                        int t = p[a];
                        p[a] = p[b];
                        p[b] = t;
                        for (++a, b = p.length - 1; a < b; ++a, --b) {
                            t = p[a];
                            p[a] = p[b];
                            p[b] = t;
                        }
                        return true;
                    }
                }
            }
        }
        return false;
    }

    public static String getString() {
        try {
            return br.readLine();
        } catch (Exception e) {
        }
        return "";
    }

    public static Integer getInt() {
        try {
            return Integer.parseInt(br.readLine());
        } catch (Exception e) {
        }
        return 0;
    }

    public static Integer[] getIntArr() {
        try {
            StringTokenizer temp = new StringTokenizer(br.readLine());
            int n = temp.countTokens();
            Integer temp2[] = new Integer[n];
            for (int i = 0; i < n; i++) {
                temp2[i] = Integer.parseInt(temp.nextToken());
            }
            return temp2;
        } catch (Exception e) {
        }
        return null;
    }

    public static Long[] getLongArr() {
        try {
            StringTokenizer temp = new StringTokenizer(br.readLine());
            int n = temp.countTokens();
            Long temp2[] = new Long[n];
            for (int i = 0; i < n; i++) {
                temp2[i] = Long.parseLong(temp.nextToken());
            }
            return temp2;
        } catch (Exception e) {
        }
        return null;
    }

    public static String[] getStringArr() {
        try {
            StringTokenizer temp = new StringTokenizer(br.readLine());
            int n = temp.countTokens();
            String temp2[] = new String[n];
            for (int i = 0; i < n; i++) {
                temp2[i] = (temp.nextToken());
            }
            return temp2;
        } catch (Exception e) {
        }
        return null;
    }

    public static void print(Object a) {
        out.println(a);
    }

    public static void print(String s, Object... a) {
        out.printf(s, a);
    }

    public static int nextInt() {
        return sc.nextInt();
    }

    public static double nextDouble() {
        return sc.nextDouble();
    }

    public static void main(String[] ar) {
        initA();
        cf411A c = new cf411A();
        c.solve();
        out.flush();
    }

    void solve() {
        String ok = "Correct";
        String weak = "Too Weak";

        String in = getString();
        int digit = 0, small = 0, big = 0;
        for (int i = 0; i < in.length();i++) {
            if (in.charAt(i) >= '0' && in.charAt(i) <= '9') {
                digit++;
            }
            if (in.charAt(i) >= 'a' && in.charAt(i) <= 'z') {
                small++;
            }
            if (in.charAt(i) >= 'A' && in.charAt(i) <= 'Z') {
                big++;
            }
        }
        if(digit > 0 && small > 0 && big > 0 && in.length()>=5){
            print(ok);
        } else {
            print(weak);
        }
    }
}


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

public class Dp {

    public static void main(String args[]) {
        InputReader in = new InputReader(System.in);
        PrintWriter out = new PrintWriter(System.out);
        int t = 1;
        while (t-- > 0) {
            long l = in.nextLong();
            long r = in.nextLong();
            out.println(fuc(r) - fuc(l - 1));
        }
        out.close();
    }

    static long fuc(long r) {
        long val[] = new long[18];
        val[1] = 9;
        val[2] = 9;
        for (int i = 3; i < 18; i++) {
            val[i] = val[i - 1] * 10;
        }
        int dig = 0;
        long rr = r;
        ArrayList<Integer> aa = new ArrayList<Integer>();
        while (rr > 0) {
            dig++;
            aa.add((int) (rr % 10));
            rr = rr / 10;
        }
        if (dig <= 1) return r;
        long ans = 0;
        for (int i = 0; i < dig; i++) {
            ans += val[i];
        }
        int i = 0;
        int j = aa.size() - 1;
        Collections.reverse(aa);
        long curr = 0;

        curr = curr + (aa.get(i) - 1) * cal(aa, i + 1, j, 1, 0);
        curr = curr + cal(aa, i + 1, j, 0, aa.get(i));

        return ans + curr;
    }

    static long vc;

    static long cal(ArrayList<Integer> aa, int i, int j, int kk, long vv) {
        if (i == j) {
            if (vv <= aa.get(j))
                return 1L;
            else {
                return 0;
            }
        }
        long curr = 0;
        if (kk == 1) {
            curr = curr + 10 * cal(aa, i + 1, j, kk, vv);
        } else {
            curr = curr + (aa.get(i)) * cal(aa, i + 1, j, 1, 0);
            curr = curr + cal(aa, i + 1, j, 0, vv);
        }
        return curr;
    }

    static int top[];
    static int curr = 0;
    static int visited[];
    static ArrayList<Integer> adj[];

    static void dfs(int i) {
        if (visited[i] == 0) {
            visited[i] = 1;
            for (int j : adj[i]) {
                dfs(j);
            }
            top[curr] = i;
            curr++;
        }
    }

    static class InputReader {
        private final InputStream stream;
        private final byte[] buf = new byte[8192];
        private int curChar, snumChars;
        private SpaceCharFilter filter;

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

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

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

        public long nextLong() {
            int c = snext();
            while (isSpaceChar(c)) {
                c = snext();
            }
            int sgn = 1;
            if (c == '-') {
                sgn = -1;
                c = snext();
            }
            long res = 0;
            do {
                if (c < '0' || c > '9')
                    throw new InputMismatchException();
                res *= 10;
                res += c - '0';
                c = snext();
            } 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);
        }
    }
}


import java.util.*;

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

        BitSet bitSet = new BitSet(n);
        for (int i = 2; i * i < n; i++) {
            //System.out.println("KEKE " + i);
            if (!bitSet.get(i - 1)) {
                for (int k = 2; k * i - 1 < n; k++) {
                    //System.out.println("ELE " + (k * i - 1));
                    bitSet.set(k * i - 1);
                }
            }
        }

        //System.out.println(bitSet);

        int result = 0;
        int rest = 0;
        Map<Integer, Integer> map = new HashMap<>();
        map.put(6, 3);
        map.put(4, 2);
        for (int i = n - 1; i >= 0; ) {
            //System.out.println(i);
            if (map.containsKey(i + 1)) {
                result += map.get(i + 1);
                break;
            }
            if (!bitSet.get(i)) {
                //System.out.println("NEW REST " + i);
                result++;
                if (rest == 0) {
                    break;
                } else if (rest == 1) {
                    i--;
                    rest++;
                } else {
                    i = rest - 1;
                    rest = 0;
                }
            } else {
                rest++;
                i--;
            }
        }

        System.out.println(result);
    }
}


//package general_problems;

import java.util.Scanner;

public class GeraldisintoArt {

	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner scan = new Scanner (System.in);
		int array[]= new int [6];
		for(int i=0 ; i<array.length ; i++){
			array[i] = scan.nextInt();
		}
		boolean flag = false;
		for(int i=0 ; i<2 && flag==false ; i++){
			for (int j=2 ; j<4 && flag==false ; j++){
				for(int k=4 ; k<6 && flag==false ; k++){
					if(array[j]+array[k]<=array[i]){
						for(int h=0 ; h<2 && flag==false ; i++){
							if (h==i)continue ;
							for (int g=2 ; g<4 && flag==false ; j++){
								if (g==j)continue;
								for(int m=4 ; m<6 && flag==false ; k++){
										if (m==k)continue;
									if (array[g]<=array[h] && array[m]<=array[h]){
										flag = true;
										System.out.println("YES");
										break ;
									}
								}
							}
						}
					}
				}
			}
		}
		if (flag==false)System.out.println("NO");
	}

}


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

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

class TaskD {

    /////////////////////////////////////////////////////////////

   static double eps = Math.pow(10, -8);

    public void solve(int testNumber, FastScanner in, FastPrinter out) {
        int n = in.nextInt();
        int l = in.nextInt(), r = in.nextInt();
        Point[] points = new Point[n];
        double[] dp= new double[1<<n+10];

        for (int i = 0; i < dp.length; i++) {
            dp[i]=l;
        }
    //    dp[0]=l;
        for (int i = 0; i < n; i++) {
            points[i] = new Point(in.nextInt(), in.nextInt(), in.nextInt());
        }

//            if(iter%1000==0)
//            System.out.println(iter);
        for (int i = 1; i < 1<<n; i++) {
           int k=i;
            int pos=0;

            while(k>0){
                     if((k&1)==1){
                         int prev=i-(1<<pos);
                         double fin=dp[prev];
                 Point point = points[pos];

                 double alpha = Math.atan2(point.y, point.x - fin);

                 double theta = point.angle * Math.PI / 180.0;
                 if (alpha + theta + eps >= Math.PI) {
                     fin = r + 1;

                 }
                 else{
                 double d = Math.hypot(point.x - fin, point.y);
                 double add = d * Math.sin(theta) / Math.sin(Math.PI - theta - alpha);
                 //    System.out.println(add+" add");
                 fin += add;  }
               dp[i]=Math.max(dp[i],fin);
             }
            pos++;k>>=1;
            }
            dp[i]=Math.min(r,dp[i]);
        }
     //   System.out.println(dp[3]);
        out.println(dp[(1<<n)-1]-l);
    }
}

class Point implements Comparable<Point> {
    int x, y;
    double angle;

    Point(int x, int y, double angle) {
        this.x = x;
        this.y = y;
        this.angle = angle;
    }

    public int compareTo(Point o) {
        if (this.x < o.x) return -1;
        else if (this.x > o.x) return 1;
        else if (this.y > o.y) return 1;

        else if (this.y < o.y) return -1;
        else
            return 0;  //To change body of implemented methods use File | Settings | File Templates.
    }
}

class FastScanner extends BufferedReader {

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

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

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

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

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

    }

class FastPrinter extends PrintWriter {

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

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

}


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

    public class Presents {

    	static FastReader sc=new FastReader();

    	void run() {

            int n=sc.nextInt();
            int m=sc.nextInt();

            BigInteger b2=new BigInteger("2");
            BigInteger b1=new BigInteger("1");
            BigInteger bmod=new BigInteger("1000000007");

            BigInteger poss=b2.pow(m).subtract(b1).mod(bmod);
            BigInteger result=poss.pow(n).mod(bmod);

            System.out.println(result);

    	}

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

    	static class FastReader
        {
            BufferedReader br;
            StringTokenizer st;

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

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

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

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

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

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

    }


import java.util.Scanner;
import java.math.BigInteger;
public class Solution {
	public static void main (String[] args) {
		Scanner s=new Scanner(System.in);
		int n=s.nextInt();
		int m=s.nextInt();
		System.out.println(numWays(n,m));
	}
	public static BigInteger numWays(int n,int m)
	{
	    BigInteger temp1=new BigInteger("2").pow(m);
	    temp1=temp1.subtract(new BigInteger("1"));
	    BigInteger ans=temp1.modPow(new BigInteger(Integer.toString(n)),new BigInteger("1000000007"));
	    return ans;
	}
}


import java.io.*;
import java.math.BigInteger;
import java.util.*;
import java.util.stream.Collectors;
import java.util.stream.IntStream;
import java.util.stream.Stream;

public class Contest {

	public static int gcd(int n1, int n2)
    {
        if (n2 != 0)
            return gcd(n2, n1 % n2);
        else
            return n1;
    }

//////////////////

	static class pair {
        Integer x,y;
        pair (int x,int y){
            this.x=x;
            this.y=y;
        }
    }

//////////////////

	static class length implements Comparator<String>
	{
		public int compare(String a,String b)
		{
			return(a.length()-b.length());
		}
	}

//////////////////

	   static class FastReader
	   {
		   BufferedReader br;
		   StringTokenizer st;
		   public FastReader()
		   {
			   br = new BufferedReader(new InputStreamReader(System.in));
		   }

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

		   int nextInt()
		   {
			   return Integer.parseInt(next());
		   }
		   long nextLong()
		   {
			   return Long.parseLong(next());
		   }
		   double nextDouble()
	        {
	            return Double.parseDouble(next());
	        }

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

//////////////////////

	  public static long Divisors(long n)
	   {
	       // Note that this loop runs till square root
		   long sum=0;
	       for (int i=1; i*i<=(n); i++)
	       {
	           if (n%i == 0)
	           {
	               // If divisors are equal, print only one
	               if (n/i == i)
	               {
	                  // printf("%d ", i);
	            	   sum=sum+1;
	               }

	               else // Otherwise print both
	               {
	                   //printf("%d %d ", i, n/i);
	            	   sum=sum+2;
	               }
	           }
	       }
	       return(sum);
	   }

/////////////////////

	  public static long SmallestPrimeDivisor(long n)
	  {
	      // if divisible by 2
	      if (n % 2 == 0)
	          return 2;

	      // iterate from 3 to sqrt(n)
	      for (long i = 3; i * i <= n; i += 2) {
	          if (n % i == 0)
	              return i;
	      }

	      return n;
	  }

////////////////////

	   public static boolean isprime(long n)
	    {
	        int count=0;

	        for(long i=2;i*i<=n;i++)
	        {
	            if(n%i==0)
	            {
	                return(false);
	            }
	        }
	        return(true);
	    }

//////////////////////

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

			/*
			 FastReader in =new FastReader();
				//Scanner in=new Scanner(System.in);
			PrintWriter pw = new PrintWriter(System.out);
			//double x=2.0;
			BigInteger p = BigInteger.ONE;
			pw.print(p);
			pw.flush();
			pw.close();
			*/
			//Scanner in=new Scanner(System.in);
			 FastReader in =new FastReader();
			 PrintWriter pw = new PrintWriter(System.out);
			 int n=in.nextInt();
			 int m=in.nextInt();
			 BigInteger b1=new BigInteger("2");
			// BigInteger b2=new BigInteger(Integer.toString(m));
			// BigInteger b3=new BigInteger(Integer.toString(n));
			 BigInteger b2=b1.pow(m);
			 b2=b2.subtract(BigInteger.ONE);
			 BigInteger b3=b2.pow(n);
			 pw.println(b3.mod(new BigInteger("1000000007")));

	        pw.flush();
			pw.close();

	}

}


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

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

    static class BAliceAndTheListOfPresents {
        public void solve(int testNumber, InputReader in, PrintWriter out) {
            int n = in.nextInt();
            int m = in.nextInt();
            BigInteger bi = new BigInteger("2");
            out.println(bi.pow(m).subtract(new BigInteger("1")).pow(n));
        }

    }

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

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

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

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

    }
}


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

public class MainB {
    public static void main(String[] args) {
        MyScanner scanner = new MyScanner();

        int m = scanner.nextInt();
        int n = scanner.nextInt();
        BigInteger two = new BigInteger("2");
        System.out.println(two.pow(n).subtract(new BigInteger("1")).pow(m).mod(new BigInteger("1000000007")));

    }

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

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

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

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

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

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

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

    }
    // --------------------------------------------------------
}


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

public class Main{

    public static void main(String[] args)throws IOException{
    	br = new BufferedReader(new InputStreamReader(System.in));
    	PrintWriter out = new PrintWriter(System.out);
	String n = next();
	String m = next();
	BigInteger a = new BigInteger("1000000007");
	BigInteger d = new BigInteger("2");
	d = d.pow(Integer.parseInt(m));
	d = d.subtract(BigInteger.ONE);
	d = d.pow(Integer.parseInt(n));
	d = d.mod(a);
	out.println(d);
	out.close();
    }

    static BufferedReader br;
    static StringTokenizer st = new StringTokenizer("");
    static String next()throws IOException{
    	while(!st.hasMoreTokens()){
    	    st = new StringTokenizer(br.readLine());
    	}
    	return st.nextToken();
    }
    static int nextInt()throws IOException{
    	return Integer.parseInt(next());
    }
    static long nextLong()throws IOException{
	return Long.parseLong(next());
    }
}


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

public class B {

	static int n,t[],g[],MOD=(int)1e9+7,lg[];
	static int [][]memo;
	static int dp(int msk,int rem,int lastG) {
		if(rem==0)
			return 1;

		int ans=0;
		int currMsk=msk;
		while(currMsk>0) {
			int x=currMsk&-currMsk;
			int i=lg[x];
			currMsk-=x;
			if(rem>=t[i] && g[i]!=lastG)
				ans+=dp(msk&(~(1<<i)),rem-t[i],g[i]);
				if(ans>=MOD)
					ans-=MOD;
		}

		return ans;
	}
	public static void main(String[] args) throws IOException {
		Scanner sc = new Scanner();
		PrintWriter out = new PrintWriter(System.out);
		n=sc.nextInt();
		int T=sc.nextInt();
		t=new int [n];
		g=new int [n];
		lg=new int [1<<n];
		for(int i=0;i<n;i++)
			lg[1<<i]=i;
		for(int i=0;i<n;i++) {
			t[i]=sc.nextInt();
			g[i]=sc.nextInt()-1;
		}

		out.println(dp((1<<n)-1, T, 3));
		out.close();

	}

	static class Scanner {
		BufferedReader br;
		StringTokenizer st;

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

		Scanner(String fileName) throws FileNotFoundException {
			br = new BufferedReader(new FileReader(fileName));
		}

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

		String nextLine() throws IOException {
			return br.readLine();
		}

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

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

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

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

	}

}


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

public class B {

	static int n,t[],g[],MOD=(int)1e9+7;
	static int [][][]memo1,memo2[],memo3[];
	static int dp1(int idx,int remCnt,int remSum) {
		if(remCnt==0)
			return remSum==0?1:0;
		if(remSum==0 || idx==n)
			return 0;
		if(memo1[idx][remCnt][remSum]!=-1)
			return memo1[idx][remCnt][remSum];
		int ans=dp1(idx+1,remCnt,remSum);
		if(g[idx]==0 && t[idx]<=remSum)
		{
			ans+=dp1(idx+1,remCnt-1,remSum-t[idx]);
			if(ans>=MOD)
				ans-=MOD;
		}
		return memo1[idx][remCnt][remSum]=ans;
	}
	static int dp2(int idx,int remCnt1,int remCnt2,int remSum) {
		int all=remCnt1+remCnt2;
		if(all==0)
			return remSum==0?1:0;
		if(idx==n || remSum==0)
			return 0;
		if(memo2[idx][remCnt1][remCnt2][remSum]!=-1)
			return memo2[idx][remCnt1][remCnt2][remSum];
		int ans=dp2(idx+1,remCnt1,remCnt2,remSum);
		if(t[idx]<=remSum) {
			if(g[idx]==1 && remCnt1>0)
				ans+=dp2(idx+1,remCnt1-1,remCnt2,remSum-t[idx]);
			else if(g[idx]==2 && remCnt2>0)
				ans+=dp2(idx+1,remCnt1,remCnt2-1,remSum-t[idx]);

		}

		return memo2[idx][remCnt1][remCnt2][remSum]=ans;
	}
	private static int dp3(int cnt0, int cnt1, int cnt2,int last) {
		if(cnt0+cnt1+cnt2==0)
			return 1;
		if(memo3[last][cnt0][cnt1][cnt2]!=-1)
			return memo3[last][cnt0][cnt1][cnt2];
		long ans=0;
		if(cnt0>0 && last!=0)
			ans+=dp3(cnt0-1,cnt1,cnt2,0);
		if(cnt1>0 && last!=1)
			ans+=dp3(cnt0,cnt1-1,cnt2,1);
		if(cnt2>0 && last!=2)
			ans+=dp3(cnt0,cnt1,cnt2-1,2);
		return  memo3[last][cnt0][cnt1][cnt2]=(int) (ans%MOD);

	}
	public static void main(String[] args) throws IOException {
		Scanner sc = new Scanner();
		PrintWriter out = new PrintWriter(System.out);
		n=sc.nextInt();
		int []fac=new int [n+1];
		t=new int [n];
		g=new int [n];

		fac[0]=1;
		for(int i=1;i<=n;i++)
			fac[i]=(int) (i*1L*fac[i-1]%MOD);
		int T=sc.nextInt();
		memo1=new int [n][n+1][T+1];
		memo2=new int [n][n+1][n+1][T+1];
		memo3=new int [4][n+1][n+1][n+1];
		for(int i=0;i<n;i++) {
			t[i]=sc.nextInt();
			g[i]=sc.nextInt()-1;
			for(int j=0;j<=n;j++) {
				Arrays.fill(memo1[i][j], -1);
				for(int k=0;k<=n;k++)
					Arrays.fill(memo2[i][j][k], -1);
			}
		}
		for(int i=0;i<4;i++)
			for(int j=0;j<=n;j++)
				for(int k=0;k<=n;k++)
					Arrays.fill(memo3[i][j][k], -1);
		int ans=0;
		for(int cnt0=0;cnt0<=n;cnt0++)
			for(int sum0=0;sum0<=T;sum0++)
				for(int cnt1=0;cnt1<=n;cnt1++)
					for(int cnt2=0;cnt2<=n;cnt2++) {
						long ways= dp1(0,cnt0,sum0)*1L*dp2(0,cnt1,cnt2,T-sum0)%MOD;
						ways=ways*dp3(cnt0,cnt1,cnt2,3)%MOD;
						ways*=fac[cnt0];
						ways%=MOD;
						ways*=fac[cnt1];
						ways%=MOD;
						ways*=fac[cnt2];
						ways%=MOD;
						ans+=ways;
						if(ans>=MOD)
							ans-=MOD;
					}
		out.println(ans);
		out.close();

	}

	static class Scanner {
		BufferedReader br;
		StringTokenizer st;

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

		Scanner(String fileName) throws FileNotFoundException {
			br = new BufferedReader(new FileReader(fileName));
		}

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

		String nextLine() throws IOException {
			return br.readLine();
		}

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

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

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

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

	}

}


//package round581;
import java.io.ByteArrayInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.InputMismatchException;

public class E {
	InputStream is;
	PrintWriter out;
	String INPUT = "";

	void solve()
	{
		int mod = 998244853;
		int[][] fif = enumFIF(9000, mod);

		int n = ni(), m = ni();
		// (m,n)
		// m-n i
		// 2i-(m-n)=x-y
		// m+n = x+y
		long[] all = new long[n+2];
		for(int i = n+1;i >= 0 && i > n-m;i--){
			int x = (2*i-(m-n)+(m+n))/2;
			int y = ((m+n) - (2*i-(m-n)))/2;
			all[i] = C(m+n, n, mod, fif) - C(x+y, y, mod, fif);
		}
		long ans = 0;
		for(int i = n;i >= 0;i--){
			ans += (all[i+1] - all[i]) * i;
			ans %= mod;
		}
		if(ans < 0)ans += mod;
		out.println(ans);
	}

	public static int[][] enumFIF(int n, int mod) {
		int[] f = new int[n + 1];
		int[] invf = new int[n + 1];
		f[0] = 1;
		for (int i = 1; i <= n; i++) {
			f[i] = (int) ((long) f[i - 1] * i % mod);
		}
		long a = f[n];
		long b = mod;
		long p = 1, q = 0;
		while (b > 0) {
			long c = a / b;
			long d;
			d = a;
			a = b;
			b = d % b;
			d = p;
			p = q;
			q = d - c * q;
		}
		invf[n] = (int) (p < 0 ? p + mod : p);
		for (int i = n - 1; i >= 0; i--) {
			invf[i] = (int) ((long) invf[i + 1] * (i + 1) % mod);
		}
		return new int[][] { f, invf };
	}

	public static long C(int n, int r, int mod, int[][] fif) {
		if (n < 0 || r < 0 || r > n)
			return 0;
		return (long) fif[0][n] * fif[1][r] % mod * fif[1][n - r] % mod;
	}

	void run() throws Exception
	{
		is = oj ? System.in : new ByteArrayInputStream(INPUT.getBytes());
		out = new PrintWriter(System.out);

		long s = System.currentTimeMillis();
		solve();
		out.flush();
		tr(System.currentTimeMillis()-s+"ms");
	}

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

	private byte[] inbuf = new byte[1024];
	public int lenbuf = 0, ptrbuf = 0;

	private int readByte()
	{
		if(lenbuf == -1)throw new InputMismatchException();
		if(ptrbuf >= lenbuf){
			ptrbuf = 0;
			try { lenbuf = is.read(inbuf); } catch (IOException e) { throw new InputMismatchException(); }
			if(lenbuf <= 0)return -1;
		}
		return inbuf[ptrbuf++];
	}

	private boolean isSpaceChar(int c) { return !(c >= 33 && c <= 126); }
	private int skip() { int b; while((b = readByte()) != -1 && isSpaceChar(b)); return b; }

	private double nd() { return Double.parseDouble(ns()); }
	private char nc() { return (char)skip(); }

	private String ns()
	{
		int b = skip();
		StringBuilder sb = new StringBuilder();
		while(!(isSpaceChar(b))){ // when nextLine, (isSpaceChar(b) && b != ' ')
			sb.appendCodePoint(b);
			b = readByte();
		}
		return sb.toString();
	}

	private char[] ns(int n)
	{
		char[] buf = new char[n];
		int b = skip(), p = 0;
		while(p < n && !(isSpaceChar(b))){
			buf[p++] = (char)b;
			b = readByte();
		}
		return n == p ? buf : Arrays.copyOf(buf, p);
	}

	private char[][] nm(int n, int m)
	{
		char[][] map = new char[n][];
		for(int i = 0;i < n;i++)map[i] = ns(m);
		return map;
	}

	private int[] na(int n)
	{
		int[] a = new int[n];
		for(int i = 0;i < n;i++)a[i] = ni();
		return a;
	}

	private int ni()
	{
		int num = 0, b;
		boolean minus = false;
		while((b = readByte()) != -1 && !((b >= '0' && b <= '9') || b == '-'));
		if(b == '-'){
			minus = true;
			b = readByte();
		}

		while(true){
			if(b >= '0' && b <= '9'){
				num = num * 10 + (b - '0');
			}else{
				return minus ? -num : num;
			}
			b = readByte();
		}
	}

	private long nl()
	{
		long num = 0;
		int b;
		boolean minus = false;
		while((b = readByte()) != -1 && !((b >= '0' && b <= '9') || b == '-'));
		if(b == '-'){
			minus = true;
			b = readByte();
		}

		while(true){
			if(b >= '0' && b <= '9'){
				num = num * 10 + (b - '0');
			}else{
				return minus ? -num : num;
			}
			b = readByte();
		}
	}

	private boolean oj = System.getProperty("ONLINE_JUDGE") != null;
	private void tr(Object... o) { if(!oj)System.out.println(Arrays.deepToString(o)); }
}


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

public class CF_1204E {
    public static void main(String args[]) throws Exception {
        BufferedScanner in = new BufferedScanner(System.in);
        BufferedPrinter out = new BufferedPrinter(System.out);

        long MOD = 998244853;
        int n = in.nextInt(), m = in.nextInt();

        long[][] dp = new long[n + 1][m + 1];
        for (int i = 1; i <= n; i++) {
            dp[i][0] = i % MOD;
        }

        long[][] zs = new long[n + 1][m + 1];
        for (int i = 0; i <= m; i++) zs[0][i] = 1;

        for (int i = 1; i <= n; i++) {
            for (int j = 1; j <= i; j++) {
                zs[i][j] = zs[i][j - 1] + zs[i - 1][j];
            }
        }

        for (int i = 1; i <= n; i++) {
            for (int j = 1; j <= m; j++) {
                int tot = 0;
                dp[i][j] = zs[i][j] + dp[i][j - 1] + dp[i-1][j];
            }
        }
        out.println(dp[n][m]);

        out.close();
        in.close();
    }

    /**
     * My template below. FastIO and utility functions.
     * Minimized with https://codebeautify.org/javaviewer.
     */

    // @formatter:off
    static<T>ArrayList<ArrayList<T>>get2D(int n){ArrayList<ArrayList<T>>ret=new ArrayList<>();for(int i=0;i<n;i++)ret.add(new ArrayList<>());return ret;}
    static void force(boolean condition){if(!condition)throw new IllegalStateException();}
    static class BufferedPrinter{PrintWriter out;BufferedPrinter(OutputStream out){this(new OutputStreamWriter(out));}
    BufferedPrinter(Writer out){this.out=new PrintWriter(new BufferedWriter(out));}
    void print(Object...os){for(int i=0;i<os.length;i++){if(i!=0)out.print(' ');out.print(os[i]);}}
    void println(Object...os){print(os);out.println();}
    void close(){out.close();}
    void flush(){out.flush();}}
    static class BufferedScanner{private final InputStream in;private final byte[]buf=new byte[1<<13];int pos,count;BufferedScanner(InputStream in)throws IOException{this.in=in;}
    long nextLong()throws IOException{return Long.parseLong(next());}
    int[]nextN(int n)throws IOException{int[]ret=new int[n];for(int i=0;i<n;i++)ret[i]=this.nextInt();return ret;}
    long[]nextNL(int n)throws IOException{long[]ret=new long[n];for(int i=0;i<n;i++)ret[i]=this.nextLong();return ret;}
    private int read(){if(count==-1)err();try{if(pos>=count){pos=0;count=in.read(buf);if(count<=0)return-1;}}catch(IOException e){err();}
    return buf[pos++];}
    private static boolean isSpace(int c){return c==' '||c=='\n'||c=='\r'||c=='\t'||c==-1;}
    private int readSkipSpace(){int ret;do{ret=read();}while(isSpace(ret));return ret;}
    int nextInt(){int sign=1;int c=readSkipSpace();if(c=='-'){sign=-1;c=read();}
    int ret=0;do{if(c<'0'||c>'9')err();ret=ret*10+c-'0';c=read();}while(!isSpace(c));return sign*ret;}
    String next(){StringBuilder sb=new StringBuilder();int c=readSkipSpace();do{sb.append((char)c);c=read();}while(!isSpace(c));return sb.toString();}
    private void err(){throw new InputMismatchException();}
    void close()throws IOException{in.close();}}
    // @formatter:on
}


import java.util.Scanner;

public class Main{
     private static String Decoding(String input_line, Character [][]keyboard, String mudslide){
        String decod_line = "";
        int index = 0;
        for(int row_index = 0; row_index < keyboard.length; row_index++) {
            for (int col_index = 0; col_index < keyboard[row_index].length; col_index++) {
                if(index < input_line.length()) {
                    check_char = input_line.charAt(index);
                    check = keyboard[row_index][col_index].compareTo(check_char);
                    if (keyboard[row_index][col_index].compareTo(input_line.charAt(index)) == 0) {
                        if (mudslide.compareTo("R") == 0 && col_index != 0)
                            decode_line += keyboard[row_index][col_index - 1];
                        else if (mudslide.compareTo("R") == 0 && col_index == 0)
                            decode_line += keyboard[row_index][col_index];
                        else if (mudslide.compareTo("L") == 0 && col_index == keyboard[row_index].length - 1)
                            decode_line += keyboard[row_index][col_index];
                        else if (mudslide.compareTo("L") == 0 && col_index != keyboard[row_index].length - 1)
                            decode_line += keyboard[row_index][col_index + 1];
                        index++;
                        col_index = -1;
                        row_index = 0;
                    }
                }
            }
        }
        return decod_line;
    }

    public static void Solve() {
        Scanner scanner = new Scanner(System.in);
        String mudslide = scanner.nextLine();
        Character keyboard[][] = new Character[][]{{'q','w','e','r','t','y','u','i','o','p'},
                                                   {'a','s','d','f','g','h','j','k','l',';'},
                                                   {'z','x','c','v','b','n','m',',','.','/'}};
        System.out.println(Decoding(scanner.nextLine(), keyboard, mudslide));
    }

    public static void main(String[] args){
        Solve();
    }
}


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

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

        int n = Integer.parseInt(br.readLine());
    int arr[][] = new int[n-2][n-2];
    int num[] = new int[n];
    String s[] = br.readLine().split(" ");
    for(int i=0;i<n;i++)
    {
        num[i] = Integer.parseInt(s[i]);
    }

    ArrayList<Integer> aa = new ArrayList<Integer>();
    for(int j=0;j<n-2;j++)
    {
        int time=0;
        int max=0;
        for(int k=0;k<n-2;k++)
        {
            if(time==0)
            {
                arr[j][k] = num[k+2]-num[k];
                if(arr[j][k]>max)
                {
                    max = arr[j][k];
                }
                time=1;
            }else
            {
                    arr[j][k] = num[k+2]-num[k+1];
                    if(arr[j][k]>max)
                    {
                        max = arr[j][k];
                    }
            }
        }
        aa.add(max);
    }
    int ans = Collections.min(aa);
    System.out.println(ans);

    }

}