#include <iostream>
#include <cstdio>
using namespace std;
int main()
{
    int n;
    int a;
    int b=0;
	cin>>n;
	a=n;
	for (int i=1;i<=n;i++)
	{
		b+=4*(a-1);
		a--;
	}
	cout<<b+1;
	return 0;
}


#include <bits/stdc++.h>
using namespace std;
int main()
{
	long long t1,t2,x1,x2,t0,X,Y;
	cin>>t1>>t2>>x1>>x2>>t0;
	double t,T=1e100;
	while(x1>=0&&x2>=0)
	{
		t=(t1*x1+t2*x2*1.0)/(x1+x2);
	   	if(t<t0){x1--;continue;}//减冷水伐，提高温度
	   	if(t<T){T=t;X=x1;Y=x2;}
	    x2--;//减热水伐，降低温度
 	}
	cout<<X<<' '<<Y;
}//hellobig_tq


#include<iostream>
using namespace std;
int main()
{
int a;
cin>>a;
a=a*3;
a=a/2;
cout<<a;
}


using namespace std;
#include<string.h>
#include <sstream>
typedef long long int ll;
typedef long double ld;
#include <cmath>
#include <cstdio>
#include <vector>
#include <iostream>
#include <algorithm>
#include <iterator>
#include <unordered_map>
#include <map>
//#define N 4
//const ll INF = 0x3f3f3f3f;
//const ll LL_INF = 0x3f3f3f3f3f3f3f3f;
#include <queue>
#include <unordered_set>
#include <math.h>
#include <cstring>
#include <bitset>
#include <numeric>
#include <set>
#include <sstream>
#include <list>
#include <queue>
#define PI 3.14159265358979323846264338327950
#define mp make_pair
#define inf 1e9
#define M 1000000007
#define N 1000000

int main() {

	ios::sync_with_stdio(0);
	cin.tie(0);

	vector<ll> a(3);
	for (ll i = 0; i < 3; i++) {
		cin >> a[i];
	}
	sort(a.begin(), a.end());

	if (a[2] >= 2 * (a[0] + a[1])) {
		cout << (a[0]+a[1]) << endl;
	} else {
		cout << (a[0]+a[1]+a[2])/3 << endl;
	}

}


#include<bits/stdc++.h>
using namespace std;
#define int long long

int32_t main()
{
    int x,y,n;
    cin>>x>>y>>n;
    if(x==0 and y==0 and n==2)
        cout<<"Yes\n";
    else if((n-abs(x)-abs(y))%2==0 and (n-abs(x)-abs(y))>=0)
        cout<<"Yes\n";
    else
        cout<<"No\n";
    return 0;
}


#include<iostream>
#include<cstdio>
#include<string>
using namespace std;
string s;
int main(){
	cin>>s;
	int pre=-1;
	int ans=0;
	for(int i=0;i<s.length();i++){
		if(s[i]=='A'||s[i]=='E'||s[i]=='I'||s[i]=='O'||s[i]=='U'||s[i]=='Y'){
			ans=max(ans,i-pre);
//				printf("i:%d, pre:%d,ans:%d\n",i,pre,ans);
			pre=i;
		}
	}
	ans=max(int(s.length())-pre,ans);
	printf("%d\n",ans);
	return 0;
}


#include <iostream>

using namespace std;

int main()

{

    int N, val, numar = 0 , special = 0, specialmax = -1;

    cin >> N;

    while (N > 0)

    {

        cin >> val;

        if (val == 1)

        {

            numar = numar + 1;

            if (special > 0)

            {

                special = special - 1;

            }

        }

        else

        {

            special = special + 1;

            if (special > specialmax)

            {

                specialmax = special;

            }

        }
       N--;
    }

    cout << numar + specialmax ;

    return 0;

}


#include<iostream>
#include<stdio.h>
#include<cstring>
#include<cstdio>
#include<stdlib.h>
#include <queue>
#include<string>
#include<cstring>
#include<sstream>
#include<list>
#include<math.h>
#include<map>
#include<set>
#include<cstdlib>
#include<cctype>
#include<cmath>
#include<fstream>
#include<vector>
#include<algorithm>
#include<stack>
using namespace std;
#define SET(a) memset(a,-1,sizeof(a))
#define ALL(a) a.begin(),a.end()
#define CLR(a) memset(a,0,sizeof(a))
#define PB push_back
#define PI acos(-1.0)
#define max3(a,b,c) max(a,max(b,c))
#define min3(a,b,c) min(a,min(b,c))
#define READ freopen("input.txt", "r", stdin)
#define WRITE freopen("output.txt", "w", stdout)
#define LL long long
#define MOD 1000000007
#define MX 100010
#define pii pair<int,int>
#define mx 20005
#define INF 99999999

int main()
{
	LL n, m, x, y, i, j, sum, flag,k;
	char ch;
	string str;
	int test_case = 0, min = 999999999, first, last, a, b;
	//freopen ("d:/codejam_input/A-large-practice.out","w",stdout);

	while (cin>>n>>k)
	{
		sum = 0;
		for (i = 1; i <= n; i++) {
			sum = (i * (i + 1)) / 2 - (n-i);
			if (sum == k) {
				cout << n - i << endl;
				return 0;
			}
		}
	}
	return 0;
}


#include <iostream>
using namespace std;

int main()
{
  int ntests;
  cin >> ntests;
  for(int i=0; i<ntests; i++)
  {
    int query;
    cin >> query;
    if(query == 1)
      cout << 1 << '\n';
    else
    {
      int r = 1;
      for(int j=0; j<query; j++)
        r = r << 1;
      cout << r-1 << '\n';
    }
  }
  return 0;
}


#include <iostream>
#include <string>
#include <vector>

#define ull unsigned long long
using namespace std;

//map<char,int> prime_map;
//multimap<ull,string> dictionary;

ull potence( ull base, ull exp ){
    if (exp == 0) return 1;
    if (exp == 1) return base;
    ull half = potence(base, exp/2);
    return half*half*potence(base, exp%2);
}

int main() {
    ios_base::sync_with_stdio(0);
    int a, c;
    cin >> a >> c;
    ull exp = 0;
    ull result = 0;
    static ull base = 3;
    while ( !(a == 0 && c == 0) ){
          int b = (( c%base - a%base )+ base)%base;
          result += b*potence(base,exp++);
          a /= base;
          c /= base;
    }
    cout << result;
}


#include<bits/stdc++.h>
using namespace std;
int main()
{
    int n;
    cin>>n;
    long long a[n],i;
    for(i=0;i<n;i++)
    cin>>a[i];
    sort(a,a+n);
    long long s = a[n-1],curr = a[n-1];
    for(i=n-2;i>=0;i--)
    {
        if(a[i]<curr)
        {s+=max(a[i],0LL);curr=a[i];}
        else {curr--;s+=max(curr,0LL);}

    }
 cout<<s;
 return 0;
}


#include <iostream>
#include <cstdio>
#include <string>
#include <cmath>
#include <iomanip>
#include <ctime>
#include <climits>
#include <cstdlib>
#include <cstring>
#include <algorithm>
using namespace std;
typedef unsigned int UI;
typedef long long LL;
typedef unsigned long long ULL;
typedef long double LD;
const double PI = 3.14159265;
const double E = 2.71828182846;

int gcd(int a, int b);

int main()
{
	ios::sync_with_stdio(false);
	int n;
	int num[100];
	while (cin >> n)
	{
		for (int i=0; i<n; i++)
			cin >> num[i];
		int ans = 0;
		for (int i=0; i<n; i++)
			ans = gcd(ans, num[i]);
		cout << ans*n << endl;
	}
	return 0;
}

int gcd(int a, int b)
{
	return b ? gcd(b, a%b) : a;
}


#include<iostream>
#include<cstdio>
#include<cstring>
#include<string>
#include<cmath>
#include<queue>
#include<algorithm>
#include<vector>
#include<stack>
#define INF 0x3f3f3f3f
#define eps 1e-6
typedef long long ll;
const double pi=acos(-1.0);
using namespace std;
int main()
{
	int n;
	cin>>n;
	int ans=n/2+1;
    cout<<ans<<endl;
	return 0;
}


#include <iostream>
#include <cstdio>
#include <algorithm>
#include <cmath>
#include <iomanip>

using namespace std;

int x1[100000];

int main()
{
    long long a1,a2,b1,b2,k,s=0,l1,l2;
    cin >> a1 >> a2 >> b1 >> b2 >> k;

    l1=max(a1,b1);
    l2=min(a2,b2);

    s+=l2-l1+1;

    if (k>=l1 and k<=l2) s--;

    if (s<0) s=0;
    cout << s << endl;
}


#include <bits/stdc++.h>
using namespace std;

int main ()
{
	long long n;

	cin >> n;

	if (n % 2 == 0)
		cout << (n/2) << endl;
	else
		cout << (-(n+1))/2 << endl;

	return 0;
}


#include<iostream>
#include<cstring>
#include<cmath>
#include<algorithm>
#include<string>
using namespace std;
bool da(string x)
{
	for(int i=0;i<x.size();i++)
	{
		if(x[i]<'A'||x[i]>'Z')
			return false;
	}
	return true;
}
bool xiao(string x)
{
	if(x[0]<'a'||x[0]>'z') return false;
	for(int i=1;i<x.size();i++)
	{
		if(x[i]<'A'||x[i]>'Z')
			return false;
	}
	return true;
}
int main()
{
	string a;
	cin>>a;
	if(da(a)||xiao(a))
	{
		for(int i=0;i<a.size();i++)
		{
			if(a[i]>='a'&&a[i]<='z')
			{
				a[i]-=' ';
			}
			else
				a[i]+=' ';
		}
		cout<<a;
	}
	else
		cout<<a;
	return 0;
}


#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define INF 1e8
int pd[120][10010];
int vi,vf,tempo,d;

int go(int t, int v){
	//~ if(v > 100*d) return -INF;
	if(t == 1) 	return v==vi?v:-INF;

	int &ref = pd[t][v];
	if(ref != -1) return ref;
	ref = v+go(t-1,v);
	for(int i = 1 ; i <= d ; ++i){
		if(v-i>=0) ref = max(ref,v+go(t-1,v-i));
		ref = max(ref,v+go(t-1,v+i));
	}
	return ref;
}

int main(){
	//~ freopen("in","r",stdin);
	cin>>vi>>vf>>tempo>>d;
	memset(pd,-1,sizeof pd);
	cout << go(tempo,vf) << '\n';
	return 0;
}


#include <algorithm>
#include <iostream>
using namespace std;

int main() {
    int a[8], b[8];
    int as[8], bs[8];
    for (int i = 0; i < 8; i++) {
        cin >> a[i] >> b[i];
        as[i] = a[i];
        bs[i] = b[i];
    }
    sort(as, as + 8);
    sort(bs, bs + 8);

    int x[3], y[3];
    x[0] = as[0];
    x[1] = as[3];
    x[2] = as[7];

    y[0] = bs[0];
    y[1] = bs[3];
    y[2] = bs[7];
    if (!(x[0] < x[1] && x[1] < x[2] && y[0] < y[1] && y[1] < y[2])) {
        cout << "ugly";
        return 0;
    }

    for (int i = 0; i <= 2; i++) {
        for (int j = 0; j <= 2; j++) {
            if (i == 1 && j == 1) {
                continue;
            }
            bool found = false;
            for (int k = 0; k < 8; k++) {
                if (x[i] == a[k] && y[j] == b[k]) {
                    found = true;
                    break;
                }
            }

            if (!found) {
                cout << "ugly";
                return 0;
            }
        }
    }

    cout << "respectable";
    return 0;
}


#include <bits/stdc++.h>
using namespace std;
long long n,k,m;
long long dp[1005][10][100][2];
long long dfs(int L,int be,int mod,bool flag,int mul)
{
    long long ans=0;
    if(L==n)return flag&&be!=0;
    if(dp[L][be][mod][flag]!=-1)return dp[L][be][mod][flag];
    for(int i=0;i<=9;i++)
    {
        int next=(mul*i+mod)%k;
        ans=(ans+dfs(L+1,i,next,flag||(next==0&&i>0),mul*10%k))%m;
    }
    return dp[L][be][mod][flag]=ans;
}
int main()
{
    memset(dp,-1,sizeof(dp));
    cin>>n>>k>>m;
    cout<<dfs(0,0,0,0,1)<<endl;
    return 0;
}


#include<bits/stdc++.h>
using namespace std;

int main()
{
    int m,n;
    cin>>n>>m;
    if(n==1&&m==1)
    {
        cout<<1;
        return 0;
    }
    if(n%2!=0)
    {
        if(m<(n+1)/2)cout<<m+1;
        else cout<<m-1;
    }
    else
    {
        if(m<(double)(n+1)/2)cout<<m+1;
        else cout<<m-1;
    }
}


#include <iostream>

using namespace std;

typedef long long LL;
int main()
{
	ios::sync_with_stdio(false);
	LL m, b,max=0;
	cin >>m>>b;
	for(LL y=b,x=0;y>=0;y--,x+=m)
	{
		LL a=x*(x+1)/2*(y+1) + y*(y+1)/2*(x+1);
		if(max<a)
			max=a;
	}
	cout<<max<<endl;
	return 0;
}


#include<bits/stdc++.h>
using namespace std;
int main()
{
    int a,b,n;
    cin>>a>>b>>n;
    int k=n;
    for(int i=0;i<=k;i++)
    {
        if(i%2==0)
        {
            int d=__gcd(n,a);
            if(n!=0)
            {
                n=n-d;
            }
            else
            {
                cout<<"1";
                break;
            }

        }
        else
        {
            int d=__gcd(n,b);
            if(n!=0)
            {
                n=n-d;
            }
            else
            {
                cout<<"0";
                break;
            }
        }
    }
    return 0;
}


/// -Legolas_Otaku- ///
#include <bits/stdc++.h>
#define hentai ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL)
#define File freopen(".txt", "r", stdin);freopen(".txt", "w", stdout);
#define ll long long
#define Yeah for(;;)
using namespace std;

int main(){
	//File;
	hentai;

	string a,b;
	cin>>a>>b;
	if(a == b){
		cout<<b;
	}
	else{
		cout<<1;
	}
	return 0;
}


#include<bits/stdc++.h>
#define ll long long
using namespace std;
ll stat[100005];

int main()
{
    string a;
    cin>>a;
    ll r=0,b=0,y=0,g=0,kr=0,kb=0,ky=0,kg=0;

    for(int i=0;i<a.length();i++){
        if(a[i]=='R') r=i%4;
        if(a[i]=='G') g=i%4;
        if(a[i]=='B') b=i%4;
        if(a[i]=='Y') y=i%4;
    }
    for(int i=0;i<a.length();i++){
        if(a[i]=='!'){
            if(i%4==r) kr++;
            else if(i%4==g) kg++;
            else if(i%4==b) kb++;
            else ky++;
        }
    }
    cout << kr << " " << kb << " " << ky << " " << kg;
}


// -*- C++ -*-
// File: e.cpp
// Copyright (C) 2013
#include <algorithm>
#include <string>
#include <vector>
#include <queue>
#include <iostream>
#include <cmath>
#include <sstream>
#include <map>
#include <set>
#include <numeric>
#include <memory.h>
#include <cstdio>
#include <assert.h>

using namespace std;

#define pb push_back
#define INF 1011111111
#define FOR(i,a,b) for (int _n(b), i(a); i < _n; i++)
#define rep(i,n) FOR(i,0,n)
#define CL(a,v) memset((a),(v),sizeof(a))
#define mp make_pair
#define X first
#define Y second
#define all(c) (c).begin(), (c).end()
#define SORT(c) sort(all(c))

typedef long long ll;
typedef vector<int> VI;
typedef pair<int,int> pii;

/*** TEMPLATE CODE ENDS HERE */

int  p[1000100];
int st[1000100];

int main() {
#ifdef LOCAL_HOST
    freopen("input.txt","r",stdin);
    //freopen("output.txt","w",stdout);
#endif

    int n,m;
    cin >> n;
    rep(i,n) cin >> p[i];
    cin >> m;
    rep(i,m) {
        int j;
        cin >> j;
        p[j-1] *= -1;
    }

    reverse(p,p+n);
    int sz = 0;

    rep(i,n) {
        int v = p[i];
        if(v>0 && (sz==0 || st[sz-1] != v)) v = -v;
        p[i] = v;
        if(v>0)
            sz--;
        else
            st[sz++] = -v;
    }
    assert(sz>=0);

    if(sz>0) {
        cout << "NO\n";
    }
    else {
        reverse(p, p+n);
        cout << "YES\n";
        rep(i,n) cout << p[i] << " ";
        cout << endl;
    }

#ifdef LOCAL_HOST
    printf("TIME: %.3lf\n",double(clock())/CLOCKS_PER_SEC);
#endif

    return 0;
}


#include<iostream>
using namespace std;
int main(void)
{
	long long b = 0;
	long long n;
	cin >> n;
	while ((n % 10) == 0)
	{
		n /= 10;
	}
	long long x = n;
	while (x != 0)
	{
		int a = x % 10;
		b = b * 10 + a;
		x /= 10;

	}
	if (b == n) cout << "YES";
	else cout << "NO";
	return 0;
}


#include <iostream>
#include <cstring>
#include <algorithm>
#include <cstdio>
#include <ctime>
#include <vector>
#include <fstream>
#include <sstream>
#include <queue>
#include <cmath>
#include <set>
using namespace std;
#define L(s) (int)((s).size())
#define pb push_back
#define pii pair<int, int>
#define mp make_pair
#define x first
#define y second
#define inf 1000000000
#define all(s) (s).begin(), (s).end()
#define ll long long
#define VI vector<int>
#define ull unsigned ll
int x;
int main() {
	cin >> x;
	if (x == 1) { cout << "1\n"; return 0; } else
		if (x == 3) { cout << "5\n"; return 0; }
	for(int n = 3; ; ++n) {
		if (n % 2) {
			int val = n * n / 2 + 1;
			if (x % 4 == 0) val -= val % 4;
			if (val >= x) {
				cout << n << endl;
				return 0;
			}
		} else {
			int val = ((n / 2 - 1) * (n / 2  - 1) / 2 + (n / 2 - 1) % 2) * 4;
			if (val >= x) {
				cout << n << endl;
				return 0;
			}
		}
	}
}


#include <iostream>
#include <cstdio>
#include <string>
#include <cstring>
#include <algorithm>
#include <set>
#include <map>
#include <stack>
#include <vector>
#include <queue>
#include <cmath>
#include <cassert>
using namespace std;
typedef long long LL;

#define N 505
int n , K , Q = 1e9 + 7;
void add(int& A , int B) {
    A += B;
    if (A >= Q) {
        A -= Q;
    }
}
int f[2][N][N];
int power[N];
void work() {
    int i , j , k ;
    cin >> n >> K;
    power[0] = 1;
    for (i = 1 ; i <= n ; ++ i)
        power[i] = power[i - 1] << 1 , power[i] %= Q;
    int cur = 0 , nxt = 1;
    f[cur][0][0] = 1;
    for (i = 1 ; i <= n ; ++ i) {
        memset(f[nxt] , 0 , sizeof(f[nxt]));
        for (j = 0 ; j <= K ; ++ j) {
            for (k = 0 ; k < i ; ++ k) {
                if (!f[cur][j][k]) continue;
                add(f[nxt][j][k] , (int)((LL)f[cur][j][k] * power[k] % Q));
                if (j < K) {
                    add(f[nxt][j + 1][i] , (int)((LL)f[cur][j][k] * ((power[i] - power[k] + Q) % Q) % Q));
                }
            }
        }
        swap(cur , nxt);
    }
    int ans = 0;
    for (i = 0 ; i <= n ; ++ i)
        add(ans , f[cur][K][i]);
    printf("%d\n" , ans);
}

int main(){
    work();
    return 0;
}


#include<iostream>
#include<cstdio>
#include<cmath>
using namespace std;
long long t,x,s;
int main()
{
	cin>>t>>s>>x;
	if(((x-t)%s==0 && x-t>=0) || ((x-t-1)%s==0 && x-t>=0 && x-t-1!=0))
		cout<<"YES";
	else
		cout<<"NO";
	return 0;
}


#include <iostream>
int main(){std::cout<<"25\n";return 0;}
//3122


#include<bits/stdc++.h>
using namespace std;

typedef long long int ll;

int main(){
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);

    int x1, x2, y1, y2, x, y;
    cin>>x1>>y1>>x2>>y2;

    if(y2==y1){
        y1++;
    }

    if(x2==x1){
        x1++;
    }

    if(y2<y1){
        y=y2-1;

        if(x2<x1)
        x=x2-1;

        if(x2>x1)
        x=x2+1;
    }

    if(y2>y1){
        y=y2+1;

        if(x2<x1)
        x=x2-1;

        if(x2>x1)
        x=x2+1;
    }

    cout<<(abs(x-x1) + abs(y-y1)) * 2;
}


#include <iostream>
using namespace std;

int main() {
	string s;
	cin >> s;
	cout << 26 + 25 * s.length() << endl;
	return 0;
}


#include<iostream>
#include<vector>
#include<unordered_map>
#include<map>
#include<string>
#include<deque>
#include<queue>
#include<stack>
#include<set>
#include<math.h>
#include<algorithm>

using namespace std;

int nu_f[1000001]={0};
void Num_Factors()
{
	for (long long i=1 ; i<1000001;i++)
	{
	    for (long long j=i; j<1000001;j+=i)
	    {
	        nu_f[j]++;
	    }
	}
}

int main()
{

	int n, m, c;
	Num_Factors();
	cin >> n >> m >> c;
	long long res = 0;
	for (int i = 1; i <= n; i++)
	{
		for (int j = 1; j <= m; j++)
		{
			for (int k = 1; k <= c; k++)
			{
				res += nu_f[i*j*k];
				res%=1073741824;
			}
		}
	}
	cout << res;
	cout << endl;
//	system("pause");
	return 0;
}


#include<iostream>
#include<cstdio>
using namespace std;
int a,b,c,d,e,f;
int main()
{
	scanf("%d%d%d%d%d%d",&a,&b,&c,&d,&e,&f);
	if((b*d*f>a*c*e ||(!c && d)||(!a && b && d))&& d)
		puts("Ron");
	else
		puts("Hermione");
	return 0;
}


#include <iostream>
#include <bits/stdc++.h>
using namespace std;
int digits(int number)
{
    int digits;

    return digits;
}
int main()
{
    string numbers;
    string temp;
    int count=0;
    int te;
    int x=0;
    int k=0;
    cin>>x;
    for(int i=1; i<=x; i++)
    {
        //k = digits(i);
        te=i;
        if (te<0)
        {
            k=1;
        }
        while(te)
        {
            te/=10;
            k++;

        }

        count=i;
        for (int j = 0; j < k; j++)
        {
            temp += (char) ((count%10)+48);
            count=count/10;

        }
        k=0;
        reverse(temp.begin(), temp.end());

        numbers+=temp;
        temp="";
    }

    cout<<numbers[x-1]<<endl;

    return 0;
}


#include <bits/stdc++.h>

using namespace std;

const int MAX_N=10+5,MAX_C=10+5,MAX_R=10+5;
bool a[MAX_R][MAX_C];
int  x[MAX_N],y[MAX_N];

int main()
{
    int r,c;
    cin >> r >> c;
    int n,k;
    cin >> n >> k;
    for(int i=0;i<n;i++)
    {
        cin >> x[i];
        cin >> y[i];
    }
    //SOLVE
    for(int i=0;i<n;i++)
    {
        a[x[i]][y[i]]=1;
    }
    int ans=0;
    for(int i1=1;i1<=c;i1++)
    {
        for(int j1=i1;j1<=c;j1++)
        {
            for(int i=1;i<=r;i++)
            {
                for(int j=i;j<=r;j++)
                {
                    int x=0;
                    for(int g=i;g<=j;g++)
                    {
                        for(int u=i1;u<=j1;u++)
                        {
                            if(a[g][u]==1)
                            {
                                x++;
                            }
                        }
                    }
                    if(x>=k)
                    {
                        ans++;
                    }
                }
            }
        }
    }
    //OUTPUT
    cout << ans;
}


#include <bits/stdc++.h>
using namespace std;
int main()
{
    int n;
    cin >> n;
    int num = 0;
    int num_e = 0;
    string s;
    cin >> s;
    for(int i = 0; i < n; ++i)
    {
        if(s[i] == '8')
        {
            ++num_e;
        }
    }
    num = n / 11;
    if(num <= num_e)
    {
        cout << num << endl;
    }
    else
    {
        cout << num_e << endl;
    }
    return 0;
}


#include <iostream>
using namespace std;
int n;
int a[11][11];
int f[11][11];
int main(){
	cin>>n;
	for(int i=1;i<=n;i++){
		a[i][1]=1;a[1][i]=1;}
	for(int i=2;i<=n;i++)
	for(int j=2;j<=n;j++){
		a[i][j]=a[i-1][j]+a[i][j-1];
	}
	cout<<a[n][n]<<endl;
	return 0;
	}


#include <bits/stdc++.h>
using namespace std;
int main()
{
	long long n;
	cin >> n;
	if (n % 2 == 0 && n != 2) cout << "YES" << endl;
	else cout << "NO" << endl;
    return 0;
}


#include <bits/stdc++.h>
using namespace std;

int main (){
	//freopen("input.txt" , "r" , stdin);

	long long a ,b; scanf("%lld%lld",&a,&b);
	for ( long long i=1 ; i<=b ; i++){
		if ( a%i != i-1){
			cout<<"No"; return 0;
		}
	}
	cout<<"Yes";
}


#include<bits/stdc++.h>
using namespace std;
int main()
{
	int a,b;
	cin>>a;
	for(int i=1;i<=a;i++)
	{
		cin>>b;
		if(b==1||b==2||b==4||b==5||b==8||b==11)
		{
			cout<<"NO"<<endl;
		}
		else
		{
			cout<<"YES"<<endl;
		}
	}
}


#include<bits/stdc++.h>

using namespace std;

#define maxn 8000005
#define ll long long int
#define db(x) cout<<#x<<" -> "<<x<<endl
#define db2(x,y) cout<<#x<<" -> "<<x<<" , "<<#y<<" -> "<<y<<endl
#define db3(x,y,z) cout<<#x<<" -> "<<x<<" , "<<#y<<" -> "<<y<<" , "<<#z<<" -> "<<z<<endl
#define prt(x) for(auto it = x.begin(); it!=x.end(); it++) { cout<<*it<<" "; } cout<<endl
#define IN freopen("input.txt","r",stdin)

vector< pair <  int,  int  >   > vt;
ll power(ll a,ll n){
    ll ret = 1LL;
    for(int i=1; i<=n; i++){
        ret*=a;
    }
    return ret;
}

bool vis[maxn+5];

void seive(){
    for(int i=2; i*i<=maxn; i++){
        if(!vis[i]){
            for(int j=(2*i); j<=maxn; j+=i){
                vis[ j  ] = true;
            }
        }
    }
}

int main(){
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    ll n, b;
    seive();
   // IN;
    cin>>n>>b;
    ll ans = n+5000;
    ll t = b;
    vector< pair< ll , ll > > vt;
    for(ll i=2; 1LL * i * i <= b ; i++){
        bool flag = false;
        if( b % i ){ continue; }
     //   if ( vis[ i ] ) { flag = true; }
     //   if( !flag ){
            ll c = 0;
            while( b % i == 0 ){
                b/=i;
                c++;
            }
            vt.push_back({1LL*i,1LL*c});
       // }
    }
    if( b > 1){
        vt.push_back({b,1LL});
    }
    for(auto it: vt){
        ll x = it.first;
        ll y = it.second;
        unsigned ll t = 1ULL * x;
        ll res = 0LL;
        while( t <= n ){
            res+=(n/t);
            if( x > (n/t) ) { break; }
            t*=1ULL*x;
          //  db3(t,res,n/t);
        }
        res/=y;
        ans = min(ans,res);
    }
    cout<<ans<<endl;
    return 0;
}


#include<iostream>
using namespace std;

int main()
{
	int r,g,b,i;
	int ans=29;
	cin>>r>>g>>b;

	while(1)
	{
		for(i=1;i<=3;i++)
		{
			if(r<=0&&g<=0&&b<=0)
				break;
			ans++;
			if(i==1)
				r-=2;
			if(i==2)
				g-=2;
			if(i==3)
				b-=2;
		}
		if(r<=0&&g<=0&&b<=0)
			break;
	}

	cout<<ans<<endl;
	return 0;

}


#include<bits/stdc++.h>

using namespace std;

int main()
{
    long long int d1,d2,d3,sum,d;
    cin>>d1>>d2>>d3;
    sum=d1+d2+d3;
    d=2*(d1+d2);
    if(sum>=d)
        cout<<d;
    else if(2*(d1+d3)<=d2)
        cout<<2*(d1+d3);
    else if(d<=d3)
        cout<<d;
    else if(2*(d2+d3)<=d1)
        cout<<2*(d2+d3);
    else if(2*(d1+d3)<=sum)
        cout<<2*(d1+d3);
    else if(2*(d2+d3)<=sum)
        cout<<2*(d2+d3);
    else
        cout<<sum;
}


#include<iostream>
#include<string>
#include<algorithm>
using namespace std;
int main()
{
    string s;
    char arr[100]={0};
    int j=0;
    cin>>s;
    sort(s.begin(),s.end());
    for(int i=0;i<s.length();i++)
    {
        if(s[i]!='+')
        {
            arr[j]=s[i];
            arr[++j]='+';
            j++;

        }
    }
    arr[j-1]='\0';
    cout<<arr;
    return 0;
}


#pragma GCC optimize("Ofast", "O3", "unroll-loops", "omit-frame-pointer", "inline")
#pragma GCC target("sse", "sse2", "sse3", "ssse3", "sse4", "popcnt", "abm", "mmx", "avx")
#pragma GCC option("tune = native", "arch = native", "no-zero-upper")
#pragma comment(linker, "/stack:200000000")

#include <bits/stdc++.h>

typedef bool bo;
typedef short sh;
typedef long long ll;
typedef unsigned long long ull;
typedef double de;
typedef long double lde;
typedef char ch;

#define spd ios::sync_with_stdio(false); cin.tie(0); cout.tie(0)
#define file(x, y) freopen((x), "rt", stdin); freopen((y), "wt", stdout)
#define pr pair
#define str string
#define vec vector
#define vint vec <int>
#define vll vec <ll>
#define vull vec <ull>
#define vlde vec <lde>
#define vch vec <ch>
#define vstr vec <str>
#define vbo vec <bo>
#define ph push
#define phf push_front
#define phb push_back
#define ins insert
#define sub substr
#define re reverse
#define bn begin()
#define ed end()
#define rbn rbegin()
#define red rend()
#define se size()
#define ey empty()
#define tp top()
#define pp pop()
#define ft front()
#define ppf pop_front()
#define bk back()
#define ppb pop_back()
#define cr clear()
#define ee erase
#define rse resize
#define te true
#define fe false
#define st first
#define nd second
#define antihype signed main()
#define all(x) (x).bn, (x).ed
#define allc(x) (x).bn, (x).ed, cmp
#define rall(x) (x).rbn, (x).red
#define rallc(x) (x).rbn, (x).red, cmp
#define coutf(x) cout << fixed << setprecision(x)
#define gle(x) getline(cin, (x))
#define loop(i, n) (int i = 0; i < (n); ++i)
#define rloop(i, n) (int i = (n - 1); i > -1; --i)
#define loopll(i, n) (ll i = 0; i < (n); ++i)
#define rloopll(i, n) (ll i = (n - 1); i > -1; --i)
#define incloop(i, x, y) (int i = (x); i < (y); ++i)
#define decloop(i, x, y) (int i = (x); i > (y); --i)
#define incloopll(i, x, y) (ll i = (x); i < (y); ++i)
#define decloopll(i, x, y) (ll i = (x); i > (y); --i)
#define steploop(i, x, y, z) (int i = (x); i < (y); i += (z))
#define steploopll(i, x, y, z) (ll i = (x); i < (y); i += (z))
#define loopst(i, n) (size_t i = 0; i < (n); ++i)
#define cinvint(v, n) vint v(n); for loopst(i, n) cin >> v[i]
#define cinvll(v, n) vll v(n); for loopst(i, n) cin >> v[i]
#define cinvull(v, n) vull v(n); for loopst(i, n) cin >> v[i]
#define cinvlde(v, n) vlde v(n); for loopst(i, n) cin >> v[i]
#define cinvch(v, n) vch v(n); for loopst(i, n) cin >> v[i]
#define cinvstr(v, n) vstr v(n); for loopst(i, n) cin >> v[i]
#define sqr(a) (a) * (a)

using namespace std;

antihype {
	spd;
	//file("input.in", "output.out");
	int v[60] = { 0, 2, 0, 4, 0, 8, 0, 16, 0, 32, 0, 64, 0, 128, 0, 256, 0, 512, 0, 1024, 0, 2048, 0, 4096, 0, 8192, 0, 16384, 0, 32768, 0, 65536, 0, 131072, 0, 262144, 0, 524288, 0, 1048576, 0, 2097152, 0, 4194304, 0, 8388608, 0, 16777216, 0, 33554432, 0, 67108864, 0, 134217728, 0, 268435456, 0, 536870912, 0, 1073741824 }, n;
	cin >> n;
	cout << v[n - 1];
	return 0;
}


#include <bits/stdc++.h>
#define ll unsigned long long
#define pi 3.1415926535897932384626433832795
#define fin(a,n)  for(ll i=0;i<n;i++) cin>>a[i];
#define fout(a,n)  for(ll i=0;i<n;i++) cout<<a[i]<<" ";
ll N = 1000000007;
using namespace std;

int main()
{
	ios_base::sync_with_stdio(false);
	cin.tie(NULL); cout.tie(NULL);
	int n,m,ans=0,prev=0;
	cin>>n>>m;
	while(n)
	{
		ans += n;
		int tmp = (n+prev)%m;
		n = (n+(prev))/m;
		prev = tmp;
	}
	cout<<ans<<'\n';
	return 0;
}


#include <iostream>
#include <cstdio>
#include <cstring>
#include <algorithm>
#include <cmath>
#define F(i,a,b) for(int i=a;i<=b;i++)
#define D(i,a,b) for(int i=a;i>=b;i--)
#define LL long long
#define INF 0X3F3F3F3F
#define MINF 999999999999999999
#define MAXN 110
using namespace std;
int n;
int res;
int main()
{
	cin>>n;
	if(n)
		res+=n/100,n%=100;
//	cout<<n<<' '<<res<<endl;
	if(n)
		res+=n/20,n%=20;
//	cout<<n<<' '<<res<<endl;
	if(n)
		res+=n/10,n%=10;
//	cout<<n<<' '<<res<<endl;
	if(n)
		res+=n/5,n%=5;
//	cout<<n<<' '<<res<<endl;
	if(n)
		res+=n;
//	cout<<n<<' '<<res<<endl;
	cout<<res;
}


#include<iostream>
#include<cstring>
#include<cstdio>
#include<algorithm>
#include<stack>

using namespace std;

int main()
{
    int a,b;
	while(scanf("%d%d",&a,&b)!=EOF)
	{
	    int c,d,e,f;
		scanf("%d%d%d%d",&c,&d,&e,&f);
		int flag = 0;
		if(c+e<=a && max(d,f)<=b)
			flag = 1;
		if(c+f<=a && max(d,e)<=b)
			flag = 1;
		if(d+e<=a && max(c,f)<=b)
			flag = 1;
		if(d+f<=a && max(c,e)<=b)
			flag = 1;
		if(c+e<=b && max(d,f)<=a)
			flag = 1;
		if(c+f<=b && max(d,e)<=a)
			flag = 1;
		if(d+e<=b && max(c,f)<=a)
			flag = 1;
		if(d+f<=b && max(c,e)<=a)
			flag = 1;
		if(flag)
			cout<<"YES"<<endl;
		else
			cout<<"NO"<<endl;
	}
	return 0;
}


#include<bits/stdc++.h>
using namespace std;
int main()
{
    char a[110];
    long long b=0,s=0,c=0,nb,ns,nc,pb,ps,pc,r,sum=0,i=0,t;
    cin>>a>>nb>>ns>>nc>>pb>>ps>>pc>>r;
    while(a[i]!='\0')
    {
        switch(a[i])
        {
            case 'B':b+=1;break;
            case 'S':s+=1;break;
            case 'C':c+=1;break;
        }
        i++;
    }
    while(1)
    {
        if(nb>=b&&ns>=s&&nc>=c)
        {
            sum+=1;
            nb-=b;
            ns-=s;
            nc-=c;
        }
        else
        {
            if(nb<b) {r-=(b-nb)*pb;nb=b;}
            if(ns<s) {r-=(s-ns)*ps;ns=s;}
            if(nc<c) {r-=(c-nc)*pc;nc=c;}
            nb-=b;ns-=s;nc-=c;
            if(r<0) break;
            else sum+=1;
        }
        if((nb==0||b==0)&&(nc==0||c==0)&&(ns==0||s==0))
        {
            sum+=r/(b*pb+s*ps+c*pc);
            break;
        }
    }
    cout<<sum;
}


#include <bits/stdc++.h>
#define ll long long
#define endl '\n'
using namespace std;

int main(){

	ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
	int buy[35], sell[35];
	int n, m, r, ans = 0;
	int *minBuy, *maxSell;

	scanf("%d %d %d", &n, &m, &r);
	for(int i = 0; i < n; i++) scanf("%d",&buy[i]);
	for(int i = 0; i < m; i++) scanf("%d",&sell[i]);

	minBuy = min_element(buy, buy+n);
	maxSell = max_element(sell, sell+m);

	if(*minBuy < *maxSell){
			ans = r / (*minBuy);
			r = r % (*minBuy);
			r = r + ans *(*maxSell);
	}

	printf("%d\n",r);

	return 0;
}


#include <stdio.h>
#include <string>
#include <cstring>
#include <stdlib.h>
#include <math.h>
#include <algorithm>
#include <vector>
#include <set>
#include <map>
#include <queue>
#include <stack>
#include <list>
#include <iterator>
#include <assert.h>
#pragma warning(disable:4996)

typedef long long ll;
#define MIN(a, b) ((a)>(b)? (b): (a))
#define MAX(a, b) ((a)<(b)? (b): (a))
#define LINF 9223300000000000000
#define INF 2140000000
const long long MOD = 1000000007;
using namespace std;

const int max_comb=300;
vector<ll> fac(max_comb+1); //n! (mod M)
vector<ll> ifac(max_comb+1); //k!^(-1) (mod M)

ll mpow(ll x, ll n){ //x^n(mod M)
    ll ans = 1;
    while(n != 0){
        if(n&1) ans = ans*x % MOD;
        x = x*x % MOD;
        n = n >> 1;
    }
    return ans;
}

ll minv(ll x){
    return mpow( x, MOD-2 );
}

ll comb(int a, int b){     // C(a,b) = a! * b!^(-1) * (a-b)^(-1)
    if(a == 0 && b == 0)return 1;
    if(a < b || a < 0)return 0;
    ll tmp = ifac[a-b]* ifac[b] % MOD;
    return tmp * fac[a] % MOD;
}

ll perm(int a, int b){     // P(a,b) = a! * (a-b)!^(-1)
    if(b == 0)return 1;
    if(a < b || a < 0)return 0;
    ll tmp = ifac[a-b] % MOD;
    return tmp * fac[a] % MOD;
}

void pre_comb()
{
    fac[0] = 1;
    ifac[0] = 1;
    for(int i = 0; i<max_comb; i++){
        fac[i+1] = fac[i]*(i+1) % MOD; // n!(mod M)
        ifac[i+1] = ifac[i]*minv(i+1) % MOD; // k!^(-1) (mod M)
    }
    return;
}

int main(int argc, char* argv[])
{
    int n,k;
    scanf("%d%d", &n, &k);

    pre_comb();
    ll ans=0;
    int i,j;
    for(i=0; i<=n; i++) {
        for(j=0; j<=n; j++) {
            ll ans0 = comb(n,i) * comb(n,j) %MOD;
            ans0 = ans0 * mpow(k, (n-i)*(n-j)) %MOD;
            ans0 = ans0 * mpow(k-1, n*n-(n-i)*(n-j)) %MOD;
            if((i+j)%2==0) {
                ans = (ans +ans0)%MOD;
            }
            else {
                ans = (ans -ans0+MOD)%MOD;
            }
        }
    }
    printf("%lld\n", ans);

    return 0;
}


#include<iostream>
#include<math.h>
#include<algorithm>
using namespace std;
int main(){
int w1,h1,w2,h2,a,b,c,x;
cin>>w1>>h1>>w2>>h2;
a=(w1*2)+(h1*2);
b=(w2*2)+(h2*2);
x=min(w1,w2);
c=a+b-(x*2);
cout<<4+c;
return 0;
}


#include<bits/stdc++.h>
using namespace std;
int main()
{
	int n,k;
	cin>>n>>k;
	int z;
	z=240-k;
	int j=1;
	int sum=0;
	while(z>=0)
	{
		z=z-(j*5);
		sum++;
		j++;
	}
	if(sum==n)
	{
		cout<<sum-1<<endl;
		return 0;
	}
	if(sum<n)
	{
		cout<<sum-1<<endl;
		return 0;
	}
	if(sum>n)
	{
		cout<<n<<endl;
		return 0;
	}
    return 0;
}


#include<iostream>
using namespace std;
int main()
{
	int k, l, m, n, d, count = 0;
	cin >> k >> l >> m >> n >> d;
	for (unsigned int i = 1; i <=d; i++)
	{
		if (i%k&&i%l&&i%m&&i%n)
			count++;
	}
	cout << d - count<<endl;
	return 0;
}


#include <stdio.h>
#include<string.h>
#include<algorithm>
#include<iostream>
using namespace std;
int main()
{
int hh1,hh2,mm1,mm2,hh,mm;
while(cin>>hh1)
{
    getchar();
    cin>>mm1;
    getchar();
    cin>>hh2;
    getchar();
    cin>>mm2;
    getchar();

    mm=mm1-mm2;
    if(mm<0)
        {
            mm+=60;
            hh1--;
        }
        hh=hh1-hh2;
        if(hh<0)
            hh+=24;
        if(hh/10)
       cout<<hh;
       else
        cout<<"0"<<hh;
       cout<<":";
       if(mm/10)
        cout<<mm;
       else
        cout<<"0"<<mm;
       cout<<endl;
}
return 0;
}


#include <iostream>
#include <cmath>
using namespace std;
int prime(int n);
int next(int n);
int main() {
    int num1,num2;
    cin >> num1 >> num2;
    if (num2== next(num1))
        cout << "YES";
    else
        cout << "NO";
    return 0;
}
int prime(int n) {
    for (int i = 2; i <= n/2; i++)
        if (n%i==0)
            return 0;
    return 1;
}
int next(int n) {
    for (n++; prime(n)==0; n++);
    return n;
}


#include <iostream>
using namespace std;
void swap (int &x,int &y){
    int temp=x;
x=y;
y=temp;
}

int main(){
    int n,c;
    cin>>n>>c;
    int *day= new int[n];
    for (int j=0;j<n;j++){
    cin>>day[j];}

    int *prob=new int[n];
    int u=0;
    for (int i=0;i<n;i++){
        if (i+1<n&&day[i]- day[i+1]>=0&&day[i]- day[i+1]>=c){

          prob[u] =day[i]-day[i+1]-c;

         u++;

        }

    }

    if (u==0){
        cout <<0;}
    else {

        for (int l=u;l>0;l--){
        for (int k=0;k<l-1;k++){
            if (prob[k]<prob[k+1]){
            swap(prob[k],prob[k+1]);

            }
        }}
        cout <<prob[0];
    }

return 0;
}


#define _CRT_SECURE_NO_WARNINGS
#include<iostream>
#include<algorithm>
#include<vector>
#include<set>
#include<map>
#include<unordered_map>
#include<queue>
#include<stack>
#include<iterator>
#include<cmath>
#include<string>
#include<sstream>
#include<cstring>
#include<ctype.h>
#include<iomanip>
#include<bitset>
#include<stdio.h>
#include<fstream>
#include<stdlib.h>
#include<math.h>
#include<numeric>
using namespace std;

#define all(v)         v.begin(),v.end()
#define sz(V)        ((ll)((v).size()))
#define pp(x)               push_back(x)
#define ck(a)               (a<1 || a>9)
#define lop(i,n)    for(ll i=0;i<n;i++)
#define loop(i,f,l) for(ll i=f;i<l;i++)
#define READ(s)   freopen(s, "r", stdin)
#define WRITE(s) freopen(s, "w", stdout)
#define scl(n)          scanf("%lld",&n)
#define sc(n)             scanf("%d",&n)
#define INF                   1000000000
#define PI             3.141592653589793
#define print(v)      lop(i, v.size()) cout<<v[i]<<" ";
#define read(v)   lop(i, v.size()) cin>>v[i];
typedef string            ss;
typedef long long         ll;
typedef pair <ll, ll>   ii;
typedef pair<string, ll> si;
typedef pair<ll, string> is;
typedef pair<char, ll>  chi;
typedef vector<ii>       vii;
typedef vector<ll>       vi;
typedef vector<vi>       vvi;
typedef vector<string>    vs;
typedef vector<ll>       vll;
//READ("input.txt");WRITE("output.txt");
ll gcd(ll a, ll b) { return (b == 0 ? a : gcd(b, a % b)); }
ll lcm(ll a, ll b){ return ((a*b) / gcd(a, b)); }
ll pw(ll b, ll p){ if (!p) return 1; ll sq = pw(b, p / 2); sq *= sq; if (p % 2) sq *= b; return sq; }
ll sd(ll x){ return x<10 ? x : x % 10 + sd(x / 10); }
double sq(double x){ lop(i, x)if ((double)i*i > x) return (i - 1); return double(1); }

int main()
{
    ll x1 = 0, x2 = 0, x3 = 0, y1 = 0, y2 = 0, y3 = 0;
    vector < vector<int>> v(3, vector<int>(3));
    int k = 0;
    lop(i, 3)
    {

        ll t; cin >> t;
        v[k][i] = t;
        x1 += t;
        if (i == 1)
            y2 += t;
        if (i == 2)
            y3 += t;
    }
    k++;
    lop(i, 3)
    {
        ll t; cin >> t;
        v[k][i] = t;
        x2 += t;
        if (i == 0)
            y1 += t;
        if (i == 2)
            y3 += t;
    }
    k++;
    lop(i, 3)
    {
        ll t; cin >> t;
        v[k][i] = t;
        x3 += t;
        if (i == 0)
            y1 += t;
        if (i == 1)
            y2 += t;
    }
    ll temp = max(max(max(x1, x2), x3), max(max(y1, y2), y3));
    if (temp - x1 == 0 || temp - x2 == 0 || temp - x3 == 0)
        temp++;
    ll  ans1 = temp - x1;
    ll ans2 = temp - x2;
    ll ans3 = temp - x3;
    while (ans1 + ans2 + ans3 != temp)
    {
        temp++;
        ans1 = temp - x1;
        ans2 = temp - x2;
        ans3 = temp - x3;

    }
    cout << ans1 << " " << v[0][1] << " " << v[0][2] << endl;
    cout << v[1][0] << " " << ans2 << " " << v[1][2] << endl;
    cout << v[2][0] << " " << v[2][1] << " " << ans3 << endl;
}


 #include <iostream>
 using namespace std;
 int main()
 {
     long long a,k2=0,k3=0;
     cin>>a;
     for (;;)
     {
         if ((a%10)==4) k2++;
         if ((a%10)==7) k3++;
         if (a<=10) break;
         a=a/10;
    }
        if (k2+k3==7 || k2+k3==4)
        cout<<"YES";
        else cout<<"NO";
        return 0;
 }


#include<cstdio>
#include<cmath>
#include<cstring>
#include<string>
#include<vector>
#include<map>
#include<algorithm>
#include <stdlib.h>
#include <functional>
#include <set>
#include <iostream>
#include <queue>
#include <stack>
#include <list>
using namespace std;

int main()
{
    double ha,ma;
    int h,m;
    char c;
    scanf("%d%c%d",&h,&c,&m);
    h=h%12;
/*  if(h > 12)
        ha=(h*15.0);
    else*/
        ha=(h*30.0);
    //if(ha == 360  || ha == 180)
    //  ha=0;

/*  if(h > 12)
        ha+=(m*0.245);
    else */
        ha+=(m*0.5);
    ma=(6.0*m);
    printf("%.1lf %.lf\n",ha,ma);
    return 0;
}


#include<iostream>
#include<cstdio>
#include<cmath>
#include<vector>
using namespace std;
int n,m;
int main()
{
    int ans=0;
    scanf("%d %d",&n,&m);
    if(n==1 || m==1)
    {
        printf("%d\n",max(n,m));
        return 0;
    }
    if(n==2 && m==2)
    {
        printf("4\n");
        return 0;
    }
    if(n>2 && m>2)
    {
        printf("%d\n",(n*m+1)/2);
        return 0;
    }
    if(n==2)
    {
        ans=m/4;
        ans*=4;
        m%=4;
        if(m>=2)
            ans+=4;
        else if(m==1)
            ans+=2;
        printf("%d\n",ans);
        return 0;
    }
    if(m==2)
    {
        ans=n/4;
        ans*=4;
        n%=4;
        if(n>=2)
            ans+=4;
        else if(n==1)
            ans+=2;
        printf("%d\n",ans);
        return 0;
    }
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
#define ll long long
int main()
{
    ll n,k;
    cin>>n>>k;
    ll rounding= powl(10,k);
    int cntfive=0;
    ll temp=n;
    if(n%rounding==0)
    {
        cout<<n<<endl;
        return 0;
    }
    while(temp%5==0)
    {
        temp/=5;
        cntfive++;
    }

    int needfive =0;
    if(k>cntfive)
        needfive=k-cntfive;
    //cout<<needfive<<endl;
    temp = 1;
    while(needfive--)
        temp*=5;
    ll value=n*temp;
    //cout<<value<<endl;
    ll maxtwo=n;
    ll two=1;
    while(true)
    {
        temp=value*two;
        if(temp%rounding==0)
        {
            cout<<temp<<endl;
            break;
        }
        //cout<<value<<" "<<two<<" "<<value*two<<endl;
        two*=2;
    }
    //cout<<value<<" "<<two<<endl;
}


#include<iostream>
#include<string>
#include<sstream>
using namespace std;
bool isdistict(string x)
{
    for (int i = 0; i < x.length(); i++)
    {
        for (int j = i + 1; j < x.length(); j++)
        {
            if (x[i] == x[j])return false;
        }
    }
    return true;
}
int main()
{
    int n;
    cin >> n;
    while (true)
    {
        n = n + 1;
        stringstream ss;
        ss << n;
        string x = ss.str();

        if (isdistict(x))
        {
            cout << n;
            break;
        }
    }
}


#include<iostream>
using namespace std;
int main(){
int k,n,a[100],i;
cin>>n>>k;
for(i=0;i<n;i++)
cin>>a[i];
for(i=0;i<n;i++){
	if(a[i]<a[k-1]||a[i]==0)
	break;
}
cout<<i<<endl;
return 0;
}


#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
ll INF=1000000000010;
char oper[10];
ll func2(ll a,ll b) {
	if(oper[2]=='+') return a+b;
	return a*b;
}
ll func3(ll a,ll b,ll c) {
	ll ans=INF;
	if(oper[1]=='+') {
		ans=min(ans,func2(a+b,c));
		ans=min(ans,func2(b+c,a));
		ans=min(ans,func2(a+c,b));
	}
	else {
		ans=min(ans,func2(a*b,c));
		ans=min(ans,func2(b*c,a));
		ans=min(ans,func2(a*c,b));
	}
	return ans;
}
ll func4(ll a,ll b,ll c,ll d) {
	ll ans=INF;
	if(oper[0]=='+') {
		ans=min(ans,func3(a+b,c,d));
		ans=min(ans,func3(b+c,a,d));
		ans=min(ans,func3(a+c,b,d));
		ans=min(ans,func3(a+d,c,b));
		ans=min(ans,func3(b+d,a,c));
		ans=min(ans,func3(c+d,a,b));
	}
	else {
		ans=min(ans,func3(a*b,c,d));
		ans=min(ans,func3(b*c,a,d));
		ans=min(ans,func3(a*c,b,d));
		ans=min(ans,func3(a*d,b,c));
		ans=min(ans,func3(b*d,a,c));
		ans=min(ans,func3(c*d,a,b));
	}
	return ans;
}
int main() {
	ll a,b,c,d;
	cin>>a>>b>>c>>d;
	for(int i=0;i<3;i++) cin>>oper[i];
	ll ans=func4(a,b,c,d);
	cout<<ans<<endl;
	return 0;
}


#include<bits/stdc++.h>
#define watch(x) cout << (#x) << " is " << (x) << endl
typedef long long ll;
using namespace std;
int main() {
    ll n, L;
    cin >> n >> L;
    vector<ll> cost(34, 4e18);
    for(int i = 0; i < n; i++)
        cin >> cost[i];
    for(int i = 1; i < 34; i++) {
        cost[i] = min(cost[i], cost[i-1]*2);
    }
    auto compute = [&] (ll x) {
        ll idx = 0, res = 0;
        while(x > 0) {
            if (x % 2 == 1)
                res += cost[idx];
            x /= 2;
            idx += 1;
        }
        return res;
    };
    ll L2 = L;
    ll ans = compute(L2);
    while(L2 <= max(L*2, 1LL<<(n+1))) {
        L2 += L2 & (-L2);
        // cout << "res " << compute(L2)
        ans = min(ans, compute(L2));

    }
    cout << ans << endl;
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
int main()
{
    int maxa=0,n,a;
    cin>>n;
    while(n--)
    {
        cin>>a;
        maxa=max(maxa,a);
    }
    if(maxa<25) cout<<0;
    else cout<<maxa-25;
    return 0;
}


/*************FORHAD-SUST-BD*****************/

#include <iostream>
#include <string>
#include <map>
#include <queue>
#include <stack>
#include <algorithm>
#include <list>
#include <set>
#include <cmath>
#include <cstring>
#include <stdio.h>
#include <string.h>
#include <sstream>
#include <stdlib.h>
#include <vector>
#include <iomanip>

using namespace std;

#ifdef __GNUC__
typedef long long ll;typedef unsigned long long ull;
#else
typedef __int64 ll;  typedef unsigned __int64 ull;
#endif

#define INF 1<<28
#define SIZE 100
#define PI 2*acos(0)
#define REP(i,n) for (i=0;i<n;i++)
#define REPE(i,n) for (i=0;i<=n;i++)
#define REV(i,n) for (i=n;i>=0;i--)
#define FOR(i,p,k) for (i=p; i<k;i++)
#define FORE(i,a,b) for (int i=a; i<=b; i++)
#define FOREACH(it,x) for(__typeof((x).begin()) it=(x.begin()); it!=(x).end(); ++it)

#define bug(x)    cout<< "->" <<#x<<": "<<x<<endl
#define Sort(x) sort(x.begin(),x.end())
#define Reverse(x) reverse(x.begin(),x.end())
#define MP(a,b) make_pair(a,b)
#define Clear(x,with) memset(x,with,sizeof(x))
#define Copy(c,r)   memcpy(c,r,sizeof(r))
#define SZ(x) (int)x.size()
#define length(x) (int)x.length()
#define All(x) x.begin(),x.end()
#define pb push_back
#define popcount(i) __builtin_popcount(i)
#define gcd(a,b)    __gcd(a,b)
#define fs first
#define sc second
#define two(X) (1<<(X))
#define twoL(X) (((ll)(1))<<(X))
#define setBit(mask,i) (mask|two(i))
#define contain(S,X) (((S)&two(X))!=0)
#define containL(S,X) (((S)&twoL(X))!=0)
#define maximum(v) *max_element(All(v))
#define minimum(v) *min_element(All(v))
#define CS c_str()
#define CL clear()
#define findx(a,x) (find(All(a),x)-a.begin())
#define ERR 1e-7
#define Unique(v) sort((v).begin(),(v).end()),v.erase(unique(v.begin(),v.end()),v.end())

typedef pair<int,int> pii;
typedef pair<double,double> pdd;
typedef vector<int> vi;
typedef vector<double>vd;
typedef vector<ll>vll;
typedef vector<string> vs;
typedef vector<vi>vvi;
typedef vector<vll>vvll;
typedef vector<vd>vvd;
typedef vector<pii>vpii;
typedef map<string,int> msi;
typedef map<int,int>mii;
typedef map<pii,int>mpi;

template<class T> inline T euclide(T a,T b,T &x,T &y)
{if(a<0){T d=euclide(-a,b,x,y);x=-x;return d;}
if(b<0){T d=euclide(a,-b,x,y);y=-y;return d;}
if(b==0){x=1;y=0;return a;}else{T d=euclide(b,a%b,x,y);T t=x;x=y;y=t-(a/b)*y;return d;}}
template<class T> inline void checkmin(T &a,T b){if(b<a) a=b;}
template<class T> inline void checkmax(T &a,T b){if(b>a) a=b;}
template<class T> T Abs(T x) {return x > 0 ? x : -x;}
template<class T> inline T sqr(T x){return x*x;}
template<class T> inline bool isPrime(T n){if(n<=1)return false;for (T i=2;i*i<=n;i++) if (n%i==0) return false;return true;}
template<class T> inline T Mod(T n,T m) {return (n%m+m)%m;} //For Positive Negative No.
template<class T> string toString(T n){ostringstream oss;oss<<n;oss.flush();return oss.str();}
int toInt(string s){int r=0;istringstream sin(s);sin>>r;return r;}
ll toLl(string s){ll r=0;istringstream sin(s); sin>>r; return r;}
template<class T> void debug(const T& e){cout<<e<<endl;}
template<class T1,class T2> void debug(const T1& e1,const T2& e2){cout<<e1<<"\t"<<e2<<endl;}
template<class T1,class T2,class T3> void debug(const T1& e1,const T2& e2,const T3& e3){cout<<e1<<"\t"<<e2<<"\t"<<e3<<endl;}
template<class T1,class T2,class T3,class T4> void debug(const T1& e1,const T2& e2,const T3& e3,const T4& e4){cout<<e1<<"\t"<<e2<<"\t"<<e3<<"\t"<<e4<<endl;}
template<class T1,class T2,class T3,class T4,class T5> void debug(const T1& e1,const T2& e2,const T3& e3,const T4& e4,const T5& e5){cout<<e1<<"\t"<<e2<<"\t"<<e3<<"\t"<<e4<<"\t"<<e5<<endl;}
template<class T> void debug(vector<T>& e){int i;REP(i,SZ(e)) cout<<e[i]<<" ";cout<<endl;}
template<class T> void debug(vector< basic_string<T> >& e){int i,j;REP(i,SZ(e)) {REP(j,SZ(e[i])) cout<<e[i][j];cout<<endl;} cout<<endl;}
template<class T> void debug(vector< vector<T> >& e,int row,int col){int i,j;REP(i,row) {REP(j,col) cout<<e[i][j]<<"\t";cout<<endl;} cout<<endl;}
template<class T> void debug(T e[SIZE][SIZE],int row,int col){int i,j;REP(i,row) {REP(j,col) cout<<e[i][j]<<" ";cout<<endl;}}
template<class T> void debug(T e[],int row){int i;REP(i,row) cout<<e[i]<<" ";cout<<endl;}

//compute b^p
ll Pow(int B,int P){    ll R=1; while(P>0)  {if(P%2==1) R=(R*B);P/=2;B=(B*B);}return R;}
//compute b^p%m
int BigMod(ll B,ll P,ll M){ ll R=1; while(P>0)  {if(P%2==1){R=(R*B)%M;}P/=2;B=(B*B)%M;} return (int)R;}
/*calculates (a*b)%c taking into account that a*b might overflow */
ll mulmod(ll a,ll b,ll c){ ll x = 0,y=a%c; while(b>0){ if(b%2 == 1){x=(x+y)%c;} y=(y*2)%c;b/= 2;}return x%c;}
//print a number in binary format with n length
void binprint(int mask,int n){int i;string s="";do{s+=(mask%2+'0');mask/=2;}while(mask);Reverse(s);s=string(max(n-SZ(s),0),'0')+s;for(i=SZ(s)-n;i<SZ(s);i++) printf("%c",s[i]);printf("\n");}

//struct pq{    int cost,node;bool operator<(const pq &b)const{return cost>b.cost;}};// Min Priority Queue
//bool comp(pq a,pq b){    return a.cost < b.cost;}   //Asc Sort by cost

//int month[]={31,28,31,30,31,30,31,31,30,31,30,31};  //Not Leap Year

//int dx[]={1,0,-1,0};int dy[]={0,1,0,-1}; //4 Direction
//int dx[]={1,1,0,-1,-1,-1,0,1};int dy[]={0,1,1,1,0,-1,-1,-1};//8 direction
//int dx[]={2,1,-1,-2,-2,-1,1,2};int dy[]={1,2,2,1,-1,-2,-2,-1};//Knight Direction
//int dx[]={2,1,-1,-2,-1,1};int dy[]={0,1,1,0,-1,-1}; //Hexagonal Direction

int convert(int num,int base)
{
    //debug(num);
    string str="";

    while(num)
    {
        str+=num%base+'0';
        num/=base;
    }
    Reverse(str);
    //debug(str,num);
    return toInt(str);
}

int main()
{
    //freopen("A.in","r",stdin);
    //freopen("A.out","w",stdout);

    int i,j,test,Case=1,k;

    while(scanf("%d",&k)==1)
    {
        FOR(i,1,k)
        {
            FOR(j,1,k)
                printf("%d ",convert(i*j,k));
            printf("\n");
        }
    }

    return 0;
}


#include <cstdio>
#include <string>

using std::string;

string n;
int len, sum, temp;

void solve(){
	n.assign(len, '0');
	temp = sum;
	sum -= 1;
	n[0] = '1';
	for(int i = len - 1; i >= 0 && sum >= 0; --i){
		if(sum >= 9){
			sum -= 9;
			n[i] += 9;
		}else{
			n[i] += sum;
			sum = 0;
		}
	}
	printf("%s ", n.c_str());

	n.assign(len, '0');
	sum = temp;
	for(int i = 0; i < len && sum >= 0; ++i){
		if(sum >= 9){
			sum -= 9;
			n[i] += 9;
		}else{
			n[i] += sum;
			sum = 0;
		}
	}
	printf("%s\n", n.c_str());

	return ;
}

int main(int argc, char const *argv[])
{
	// freopen("input.in", "r", stdin);

	scanf("%d %d", &len, &sum);

	if(sum == 0 && len == 1)
		printf("0 0\n");
	else if(sum < 1 || sum > 9 * len)
		printf("-1 -1\n");
	else
		solve();

	return 0;
}


#include<bits/stdc++.h>
using namespace std;
typedef long long int ll;

int main(){
	ll l,r,x,y,k;cin>>l>>r>>x>>y>>k;
	for(ll i=x;i<=y;++i){
		long long int ch=i*k;
		if(l<=ch and ch<=r){
			cout<<"YES";
			return 0;
		}
	}
	cout<<"NO";

	return 0;
}


#include <bits/stdc++.h>
#define int long long
#define all(x) (x).begin(), (x).end()
#define sz(x) (int)((x).size())
#define f first
#define s second
#define pii pair<int, int>

using namespace std;

void solve(){
    int n, m;
    cin >> n >> m;
    vector<vector<int>> grt(n), grr(n);
    for(int i = 0; i < m; ++i){
        int a, b;
        cin >> a >> b;
        a--; b--;
        grt[a].push_back(b);
        grr[b].push_back(a);
    }
    int k;
    cin>> k;
    vector<int> p(k);
    for(int i = 0; i < k; ++i) {cin >> p[i]; p[i]--;}
    reverse(all(p));
    vector<int> dist(n, 1e9);
    queue<int> q;
    q.push(p[0]);
    dist[p[0]] = 0;
    while(!q.empty()){
        int v = q.front();
        q.pop();
        for(int u : grr[v]) {
            if(dist[u] == 1e9){
                dist[u] = dist[v] + 1;
                q.push(u);
            }
        }
    }
    int minans = 0, maxans = 0;
    for(int i = 1; i < k; ++i){
        int md = 1e9;
        for(int j : grt[p[i]]){
            if(j == p[i - 1]) continue;
            md = min(md, dist[j] + 1);
        }
        int d = dist[p[i - 1]] + 1;
        if(md < d) minans++, maxans++;
        if(md == d) maxans++;

    }
    cout << minans << ' ' << maxans;
}

signed main(){
    ios::sync_with_stdio(0); cin.tie(0);
    //freopen("input.txt", "r", stdin);
    int t;
    t = 1;
    while(t--) solve();
    return 0;
}


#include <iostream>;
using namespace std;

int main(){
    int a,b,c,x,y,z;

    cin>>x>>y>>z;
    a = (x+y-z)/2;
    b = (y+z-x)/2;
    c = (x+z-y)/2;
	if(a==0 &&b==0 &&c==0)
		{
			cout<<"Impossible"<<endl;
			exit(0);
	}

    if (a>=0 && b>=0 && c>=0 && (x+y+z) %2==0)
                               cout<<a<<' '<<b<<' '<<c<<endl;
    else cout<<"Impossible"<<endl;
    return 0;
}


#include <bits/stdc++.h>

using namespace std;

typedef long long ll;

const int mod=1000000007;

ll fp(ll num,int pow){
    if (!pow)
        return 1;
    if (pow&1)
        return (fp((num*num)%mod,pow/2)*num)%mod;
    return fp((num*num)%mod,pow/2);
}

int main()
{
    string s;
    cin>>s;
    ll ans=0,tmp;
    for (int i=0;i<s.size();i++){
        if (s[i]=='1'){
            tmp=fp(2,s.size()-i-1);
            ans+=(((fp(2,i)*tmp)%mod)*tmp)%mod;
            ans%=mod;
        }
    }
    cout<<ans;

    return 0;
}


#define _CRT_SECURE_NO_WARNINGS
#include<iostream>
#include<sstream>
#include<vector>
#include<algorithm>
#include<set>
#include<fstream>
#include<map>
#include<string>
#include<stdio.h>
#include<bitset>
#include<queue>
#include<iomanip>
#include<cmath>

using namespace std;

void ff()
{
	std::ios_base::sync_with_stdio(0);
	cin.tie(NULL); cout.tie(NULL);
}

//#pragma warning (disable : 4996)
void in_out_txt()
{
	freopen("jumping.in", "r", stdin);
	//freopen("dup.txt", "w", stdout);
}

int main(){

	ff();
	long long x,y,z,low,mid,high,left,right,temp;
	cin>>y>>x;
	z=(x*(x-1))/2+1;
	if(y==1)
	{
		cout<<0;
		return 0;
	}
	if(y==1||y>z)
		cout<<-1;
	else{
		low=1,high=x-1;

		while(low<high){
			mid=(low+high)/2;
			left=(mid*(mid+1))/2+1;
			right=(x*(x-1))/2+1;
			temp=x-mid-1;
			right-=(temp*(temp+1))/2;

			if(y>=right)
				low=mid;
			else
				high=mid;
			if(low==high-1){
				if(y>right&&mid==low){
					mid=high;
					low=high;
				}
				else if(mid==high){

					mid=low;
					left=(mid*(mid+1))/2+1;
					right=(x*(x-1))/2+1;
					temp=x-mid-1;
					right-=(temp*(temp+1))/2;

					if(y>right)
						low=high;

				}

				break;
			}

		}
		cout<<low;

	}

	return 0;
}


#include <bits/stdc++.h>
using namespace std;

#define int long long

signed main(){
	cin.tie(nullptr)->sync_with_stdio(false);
	int x,y,m;cin>>x>>y>>m;
	if(x>=m||y>=m){
		cout<<0<<"\n";
		return 0;
	}
	if(x<=0&&y<=0){
		cout<<-1<<"\n";
		return 0;
	}
	int ans=0;
	//fix the negative number x
	if(x<0||y<0){
		if(y<x)swap(x,y);
		int ad=abs(x)/y;
		x+=y*ad;
		ans+=ad;
	}
	while(x<m&&y<m){
		if(x<y)x=x+y;
		else y=x+y;
		ans++;
		//cerr<<x<<" "<<y<<"\n";
	}
	cout<<ans<<"\n";
}


#define _CRT_SECURE_NO_WARNINGS

#include <cstdlib>
#include <cstring>
#include <cstdio>
#include <ctime>
#include <cmath>
#include <cstdlib>
#include <algorithm>
#include <iomanip>
#include <iostream>
#include <sstream>
#include <string>
#include <vector>
#include <queue>
#include <deque>
#include <stack>
#include <map>
#include <list>
#include <set>
#include <tuple>
#include<iterator>
#include<numeric>
#include <utility>
#include <cctype>
using namespace std;

typedef long long ll;

const int INF = 1 << 30;
const int N = (int)1e6;
const int MODULO = (int)1e9 + 7;

void task() {
    int hy, ay, dy, hm, am, dm, h, d, a;
    scanf("%d %d %d", &hy, &ay, &dy);
    scanf("%d %d %d", &hm, &am, &dm);
    scanf("%d %d %d", &h, &a, &d);
    int ans = (int)1e6;
    for (int ia = ay; ia <= hm + dm; ++ia) {
        for (int id = dy; id <= am; ++id) {
            if (ia <= dm) {
                continue;
            }
            int cnt = hm / (ia - dm) + (hm % (ia - dm) != 0);
            int need = (id >= am ? 0 : max(0, (am - id)*cnt - hy + 1));
            int t_ans = need*h + (ia - ay)*a + (id - dy)*d;
            ans = min(ans, t_ans);
            //cout << ia << ' ' << id << ' ' << cnt << ' ' << need << ' ' << t_ans << endl;
        }
    }
    if (ans == (int)1e6){
        if (ay > hm + dm){
            if (am - dy >= hy) {
                ans = (am - dy - hy + 1)*min(h, d);
            } else
                ans = 0;
        } else {//dy > am
            if (ay - dm <= 0)
                ans = (dm - ay + 1)*a;
            else
                ans = 0;
        }
    }
    printf("%d", ans);
}

int main() {
    /*
    ios_base::sync_with_stdio(0);
    freopen("input.txt", "w", stdout);
    cout << 20000 << endl;
    //code here

    for (int i = 0; i < 20000; ++i) {
    cout << 10 << ' '<< 1000 << endl;
    }
    return 0;
    // */
#ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
#else
    //freopen("rmq.in", "r", stdin);
    //freopen("rmq.out", "w", stdout);
#endif

    task();

#ifndef ONLINE_JUDGE
    cout << "\n---------------------\n";
    cout << clock() * 1000 / CLOCKS_PER_SEC << "ms";
#endif

    return 0;
}


#include <bits/stdc++.h>
using namespace std;
#define N 15
int a[N],b[N];
int main()
{
    int n,m;
    cin>>n>>m;
    int i,j;
    for (i=0;i<n;i++)
    {
        cin>>a[i];
    }
    for (i=0;i<m;i++)
    {
        cin>>b[i];
    }
    for (i=0;i<n;i++)
    {
        for (j=0;j<m;j++)
        {
            if (a[i]==b[j])
            {
                cout<<a[i]<<' ';
            }
        }
    }
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
int main()
{
	int t;
	cin>>t;
	while(t--)
	{
		int a,b=1;
		cin>>a;
		for(int i=2;i<=sqrt(a);i++)
		{
			if(a%i==0)
			{
				b=a/i;
				break;
			}
		}
		cout<<b<<' '<<a-b<<endl;
	}
}


#include <iostream>
#include <math.h>

using namespace std;

int n, t, k, d;
int main(){

    cin >> n >> t >> k >> d;

    int c1 = ceil((double) n/k);
    double c2 = d/t;

    if(c1 - c2 > 1){
        cout << "YES" << endl;
    } else {
        cout << "NO" << endl;
    }

    return 0;
}


#include <iostream>
#include <cmath>
using namespace std;

int main()
{
    int n;
    double t1 = 0 , k , a[105] , x;
    cin >> n >> k;
    for(int i=0;i<n;i++){
        cin >> a[i];
        t1 +=a[i];
    }
    t1 /= n;
    x = 2 * n *(k - t1 - 0.5);
    if(x > 0)
        cout << x << endl;
    else
        cout << '0';
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
int main(){
	int n;
	cin>>n;
	string str;
	cin>>str;
	int ans1=0,ans2=0,len=0;

	for(int i=0;i<n;i++){
		if(str[i]=='_'){
			ans1=max(ans1,len);
			len=0;
		}else if(str[i]=='('){
			ans1=max(ans1,len);
			len=0;
			bool f=false;
			i++;
			while(str[i]!=')'){
				if(str[i]=='_'){
					ans2+=f;
					f=false;
				}else{
					f=true;
				}
				i++;
			}
			ans2+=f;
		}else{
			len++;
		}
	}
	ans1=max(ans1,len);
	cout<<ans1<<" "<<ans2;
	return 0;
}


#include<bits/stdc++.h>
#define int long long
using namespace std;
const int N=54;
const int mod=1e9+7;
int f[N][N],g[N][N],nf[N][N],inv[N];
int binpow(int x,int y){
	int tich=1;
	while(y){
		if(y&1){
			tich*=x;
			tich%=mod;
		}
		x*=x;
		x%=mod;
		y>>=1;
	}
	return tich;
}
signed main(){
	ios::sync_with_stdio(0);
	cin.tie(0);
	int n,i,j,k,l,m,x,cnt,mul;
	cin>>n>>m;
	inv[0]=1;
	for(i=1;i<=n;i++){
		inv[i]=binpow(i,mod-2);
	}
	memset(f,0,sizeof(f));
	memset(g,0,sizeof(g));
	f[0][1]=1;
	for(i=1;i<=n;i++){
		for(j=1;j<=i;j++){
			for(k=0;k<i;k++){
				l=i-1-k;
				for(x=j;x<=l+1;x++){
					g[i][j]+=f[k][j]*f[l][x];
					g[i][j]%=mod;
				}
				for(x=j+1;x<=k+1;x++){
					g[i][j]+=f[k][x]*f[l][j];
					g[i][j]%=mod;
				}
			}
			memset(nf,0,sizeof(nf));
			for(k=0;k<=n;k++){
				for(l=1;l<=k+1;l++){
					mul=1;
					for(cnt=1;k+cnt*i<=n;cnt++){
						mul=(mul*inv[cnt])%mod;
						mul=(mul*(g[i][j]+cnt-1))%mod;
						nf[k+cnt*i][l+cnt*j]+=mul*f[k][l];
						nf[k+cnt*i][l+cnt*j]%=mod;
					}
				}
			}
			for(k=0;k<=n;k++){
				for(l=1;l<=k+1;l++){
					f[k][l]+=nf[k][l];
					if(f[k][l]>=mod){
						f[k][l]-=mod;
					}
				}
			}
		}
	}
//	for(i=1;i<=n;i++){
//		for(j=1;j<=i+1;j++){
//			cout<<i<<' '<<j<<" VAL:"<<f[i][j]<<endl;
//		}
//	}
	cout<<f[n][m];
}


#include <iostream>
#include <cstdio>
#include <vector>
#include <algorithm>
#define ld long double
using namespace std;

const int MAXN = 5001;
const long long MODULE = 1000 * 1000 * 1000 + 7;
const int N	= 7;
const int M = 1 << N;
long long f1[M][M], fc[M][M], nfc[M][M];
long long f[M], f2[M];
const int LG = 17;
int msk;

void merg(long long a[M][M], long long b[M][M])
{
	for (int i = 0; i < msk; i++)
	{
		for (int j = 0; j < msk; j++)
		{
			fc[i][j] = 0;
			for (int l = 0; l < msk; l++)
			{
				fc[i][j] = (fc[i][j] + a[i][l] * b[l][j]) % MODULE;
			}
		}
	}
}

void copyf()
{
	for (int j = 0; j < msk; j++)
	{
		for (int l = 0; l < msk; l++)
		{
			nfc[j][l] = fc[j][l];
		}
	}
}

int main()
{
	for (int i = 0; i < M; i++) f[i] = 0;
	f[0] = 1;
	msk = 1;
	for (int i = 1; i <= N; i++)
	{
		int w;
		cin >> w;
		for (int j = 0; j < msk; j++)
		{
			f[j + msk] = f[j];
			f[j] = 0;
		}
		msk *= 2;
		for (int j = 0; j < msk; j++)
		{
			for (int l = 0; l < msk; l++)
			{
				long long n0 = 0, n1 = 1;
				for (int k = 0; k < i; k++)
				{
					long long v0 = n0 + n1, v1 = n0;
					if (((j & (1 << k)) == 0) || ((l & (1 << k)) == 0)) v1 += n1;
					n0 = v0, n1 = v1;
				}
				f1[j][l] = n1;
			}
		}
		for (int j = 0; j < msk; j++)
		{
			for (int l = 0; l < msk; l++)
			{
				fc[j][l] = 0;
			}
			fc[j][j] = 1;
		}
		for (int pp = LG; pp >= 0; pp--)
		{
			copyf();
			merg(nfc, nfc);
			if ((1 << pp) & w)
			{
				copyf();
				merg(nfc, f1);
			}
		}
		for (int j = 0; j < msk; j++)
		{
			f2[j] = 0;
			for (int l = 0; l < msk; l++)
			{
				f2[j] = (f2[j] + f[l] * fc[l][j]) % MODULE;
			}
		}
		for (int j = 0; j < msk; j++) f[j] = f2[j];
	}
	cout << f[(1 << N) - 1] << endl;
	return 0;
}


#include <iostream>
#include <set>
using namespace std;

int main()
{
	int n ;
	string s ;
	cin >> n ;
	getline(cin,s);
	int week[] = {52,52,52,52,53,53,52} ;
	if(s == " of week")
		cout << week[n-1] << endl ;
	else
	{
		if(n == 30)
			cout << 11<<endl ;
		else if(n == 31)
			cout << 7<<endl ;
		else
			cout << 12 << endl ;
	}
	return 0 ;
}


// nlather (Nishant Raj Lather)
// Chrollo_Lucifer

#include <bits/stdc++.h>
#include<ext/pb_ds/assoc_container.hpp>
#include<ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
using namespace std;
template <typename T>
using ordered_set = tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;
mt19937_64 rng(chrono::steady_clock::now().time_since_epoch().count());
#define rnd(x, y) uniform_int_distribution<ll>(x, y)(rng)
struct custom_hash {
    static uint64_t splitmix64(uint64_t x) {
        // http://xorshift.di.unimi.it/splitmix64.c
        x += 0x9e3779b97f4a7c15;
        x = (x ^ (x >> 30)) * 0xbf58476d1ce4e5b9;
        x = (x ^ (x >> 27)) * 0x94d049bb133111eb;
        return x ^ (x >> 31);
    }
    size_t operator()(uint64_t x) const {
        static const uint64_t FIXED_RANDOM = chrono::steady_clock::now().time_since_epoch().count();
        return splitmix64(x + FIXED_RANDOM);
    }
};
#define boost ios_base::sync_with_stdio(false);cin.tie(nullptr);
#define rep(i, x, n) for(ll i = x; i < n; i++)
#define rrep(i, x, n) for(ll i = x; i >= n; i--)
#define all(v) v.begin(),v.end()
#define rall(v) v.rbegin(),v.rend()
#define ff first
#define ss second
#define pb push_back
#define eb emplace_back
#define e emplace
#define mp make_pair
#define debug(this) cout<<"> "<<#this<<" : "<<this<<"\n"
typedef long long int ll;
typedef long double ld;
typedef pair< ll, ll > pii;
typedef vector< ll > vi;
typedef vector< vi > vvi;
const ll MOD = 1e9+7;
ld PI=3.1415926535897932384626;
ld EPS = 1e-9;
#define endl '\n'

int main() {
	boost;
	ll n, x, y;
	cin >> n;
	ll mx = -1, my = -1, mnx = 100, mny = 100;
	vector<pii> cord;
	map<ll, ll> x_cord, y_cord;
	rep(i, 0, (4*n+1)) {
		cin >> x >> y;
		cord.eb(x, y);
		if(++y_cord[y] > 1) my = max(my, y), mny = min(mny, y);
		if(++x_cord[x] > 1) mnx = min(mnx, x), mx = max(mx, x);
	}
	for(pii &p : cord) {
		if(p.ff > mx or p.ff < mnx or p.ss > my or p.ss < mny or (p.ff != mnx and p.ff != mx and p.ss != mny and p.ss != my)) {
			cout << p.ff << " " << p.ss << endl;
			return 0;
		}
	}
}


#include <iostream>
#include <vector>

using namespace std;

int main() {
	int n;
	cin >> n;
	int first,last;
	for(int i=0;i<n;i++)
	{
		int x;
		cin >> x;
		if(i==0)
			first=x;
		if(i==n-1)
			last=x;
	}
	if((first%2)*(last%2)*(n%2)!=0)
		cout << "Yes" << endl;
	else
		cout << "No" << endl;
    return 0;
}


#include <bits/stdc++.h>
using namespace std;
set<string>st;
string str;
int k;
vector<string>perm;
/*for combinations */

void fun(string s,int pos)
{
  if(s.size()==2&&st.count(s)==0)
  return;

    int i=pos,c,flag=0;

    if(s.size()==k)
    {
        perm.push_back(s);return;
    }

  for(c=1;c<=str.size();c++)
  {

      fun(s+str[i],(i+1)%str.size());

              i++;
              i=i%str.size();
     }
}

int main() {

	str="abcdef";
	cin>>k;
	string temp;
	int n,i;
	string s1,s2;
	map<string,string>mp;
	map<string,string>::iterator it;

	cin>>n;
	for(i=1;i<=n;i++)
	{
	    cin>>s1>>s2;
	    st.insert(s1);
	    mp[s1]=s2;
	}
		 fun(temp,0);

string s3;
int count=0;

    for(i=0;i<perm.size();i++)
    {
        s3=perm[i];
        string s(s3,0,2);

        while(mp.count(s)==1)
    {

         s3.replace(0,2,mp[s]);
         s.clear();
         s+=s3[0];
         s+=s3[1];
    }
  if(s3=="a")
  count++;
    }

cout<<count;
	return 0;
}


#include<bits/stdc++.h>
using namespace std;

typedef long double db;
const db eps=1e-12;

struct Point
{
    db x,y;
    Point(){}
    Point(db _x,db _y):x(_x),y(_y){}
    Point operator + (const Point &t)const
    {
        return Point(x+t.x,y+t.y);
    }
    Point operator - (const Point &t)const
    {
        return Point(x-t.x,y-t.y);
    }
    Point operator * (const db &t)const
    {
        return Point(x*t,y*t);
    }
    Point operator / (const db &t)const
    {
        return Point(x/t,y/t);
    }
    bool operator < (const Point &t)const
    {
        return fabs(x-t.x)<eps ? y<t.y : x<t.x;
    }
    bool operator == (const Point &t)const
    {
        return fabs(x-t.x)<eps && fabs(y-t.y)<eps;
    }
    db len()const
    {
        return sqrt(x*x+y*y);
    }
    Point rot90()const
    {
        return Point(-y,x);
    }
};

struct Circle
{
    Point o;
    db r;
    Circle(){}
    Circle(Point _o,db _r):o(_o),r(_r){}
    friend vector<Point> operator & (const Circle &c1,const Circle &c2)
    {
        db d=(c1.o-c2.o).len();
        if(d>c1.r+c2.r+eps || d<fabs(c1.r-c2.r)-eps)
            return vector<Point>();
        db dt=(c1.r*c1.r-c2.r*c2.r)/d,d1=(d+dt)/2;
        Point dir=(c2.o-c1.o)/d,pcrs=c1.o+dir*d1;
        dt=sqrt(max(0.0L,c1.r*c1.r-d1*d1)),dir=dir.rot90();
        return vector<Point>{pcrs+dir*dt,pcrs-dir*dt};
    }
}p[5];

struct DSU
{
    int fa[5];
    void init(int n)
    {
        for(int i=1;i<=n;i++)
            fa[i]=i;
    }
    int find(int x)
    {
        return fa[x]==x ? x : fa[x]=find(fa[x]);
    }
    void merge(int x,int y)
    {
        x=find(x),y=find(y);
        if(x!=y)fa[x]=y;
    }
}dsu;

int main()
{
    int n;
    scanf("%d",&n);
    for(int i=1;i<=n;i++)
        cin>>p[i].o.x>>p[i].o.y>>p[i].r;
    vector<Point> all;
    dsu.init(n);
    int e=0;
    for(int i=1;i<=n;i++)
    {
        vector<Point> pat;
        for(int j=1;j<=n;j++)if(i!=j)
        {
            vector<Point> tmp=p[i]&p[j];
            if(!tmp.empty())dsu.merge(i,j);
            for(int k=0;k<(int)tmp.size();k++)
                all.push_back(tmp[k]),pat.push_back(tmp[k]);
        }
        sort(pat.begin(),pat.end());
        e+=unique(pat.begin(),pat.end())-pat.begin();
    }
    sort(all.begin(),all.end());
    int v=unique(all.begin(),all.end())-all.begin(),c=0;
    for(int i=1;i<=n;i++)
        c+=(dsu.find(i)==i);
    cout<<e-v+c+1<<endl;
    return 0;
}


#include <bits/stdc++.h>
#include <bitset>
using namespace std;
// priority_queue< ii, vector<ii>, greater<ii> > pq;  pq.push pq.pop pq.top;
// priority_queue por default ordena decrescente

#define INF 0x3f3f3f3f
#define LINF 0x3f3f3f3f3f3f3f3fLL
#define NVI -1
#define db if(0)
#define pb push_back
#define EPS 1e-9
#define fst first
#define scd second
#define mp make_pair
#define fr(a,b,c) for(int a=b;a<c;a++)

typedef unsigned long long ull;
typedef long long ll;
typedef vector <int> vi;
typedef vector <ll> vll;
typedef vector<vector<int > > vvi;
typedef pair<int,int> ii;
typedef vector<ii> vii;
typedef vector<vii> vvii;
typedef vector<vector<pair<int, int> > > ve;
typedef pair<double,double> dd;

int n,cols[110], lines[110];
int res[110];

int main() {
	scanf("%d", &n);
	fr(i,0,n) {
		res[i]=0;
		scanf("%d", &cols[i]);
		fr(j,0,cols[i]) lines[j]++;
	}
	/*fr(i,0,n) {
		fr(j,0,)
	}*/
	int i = 0;
	while(lines[i] > 0) {
		int col = n-1;
		fr(j,0,lines[i]) {
			res[col--]++;
		}
		i++;
	}
	cout << res[0];
	fr(i,1,n) cout << " " << res[i];
	cout << "\n";
}
// 1445694154702


#define _CRT_SECURE_NO_WARNINGS 1
#include<iostream>
#include<algorithm>
#include<string>
#include<cstring>
#include<cmath>
#include<iomanip>
#include<sstream>
#include<vector>
#include<map>
#include<set>
#include<stack>
#include<queue>

using namespace std;
int gcd(int x, int y)
{
    for (int i = min(x, y); i >= 1;i--)
    if (x%i == 0 && y%i == 0)
        return i;
}

int main()
{
    int n,sum=0;
    cin >> n;

    for (int i = 1; i < n;i++)
    if (gcd(n - 1, i) == 1) sum++;

    cout << sum;

    return 0;
}


#include <bits/stdc++.h>
using namespace std;
int main()
{
	int y,w;
	scanf("%d%d",&y,&w);
	switch(max(y,w))
	{
		case 1:printf("1/1");break;
		case 2:printf("5/6");break;
		case 3:printf("2/3");break;
		case 4:printf("1/2");break;
		case 5:printf("1/3");break;
		case 6:printf("1/6");break;
		default:break;
	}
	return 0;
}


#include<bits/stdc++.h>
using namespace std;int n;
int main(){cin>>n;cout<<(2*n+1)/3;}


#include <iostream>
#include <vector>
#include <cmath>
#include <algorithm>
#include <set>
#include <stack>
#include <map>
using namespace std;
#define lli long long int
#define v vector<lli>
#define vv vector<v>
#define p pair<lli,lli>
#define arrayinput int n; int m; cin>>n>>m; v arr (n+1,-1); for (int i=0; i<n; i++){int temp; cin>>temp;arr[i]=temp;}
int z=1000000007;
int main() {
	lli n,m;
	cin>>m>>n;
	lli count=0;
	if (n>m)
		swap(n,m);
	if (n==1)
	{
		if (m%6==1)
			cout<<(m-1);
		else if (m%6==2)
			cout<<(m-2);
		else if (m%6==3)
			cout<<(m-3);
		else if (m%6==4)
			cout<<(m-2);
		else if (m%6==5)
			cout<<(m-1);
		else cout<<m;
	}
	else if (n%2==0 && m%2==0)
	{
		if (n==2 && m==2)
			cout<<0;
		else
			cout<<(m*n);
	}
	else if ((n+m)&1)
	{
		if (n%2!=0)
			swap(n,m);
		if (m!=3 && m!=7)
			cout<<(m*n);
		if (m==3)
		{
			if (n==2)
				cout<<4;
			else cout<<(m*n);

		}
		if (m==7)
		{
			if (n==2)
				cout<<12;
			else
				cout<<(m*n);
		}
	}
	else
		cout<<(m*n-1);
	return 0;
}


#include <iostream>
#include <string>
#include <vector>
#include <sstream>
#include <algorithm>
#include <cmath>
#define ull unsigned long long int
#define ll long long int
using namespace std;

int main()
{
	ll n,m;
	cin>>n>>m;//try distributing one each to all partitions first etc etc for the minimum case;
	ll z=n;
	//int x=n-(int)ceil(n*1.0/m)*(m-1);

	ll s=n%m*(n/m+1)*(n/m)/2+(m-n%m)*(n/m)*(n/m-1)/2;

	cout<<s<<" "<<(z-m+1)*(z-m)/2<<endl;
	return 0;
}


#include <bits/stdc++.h>

#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>

#define sf scanf
#define pf printf
#define pb push_back
#define mp make_pair
#define PI ( acos(-1.0) )
#define IN freopen("hard1.txt","r",stdin)
#define OUT freopen("hard1.txt","w",stdout)
#define FOR(i,a,b) for(i=a ; i<=b ; i++)
#define DBG pf("Hi\n")
#define i64 long long int
#define eps (1e-8)
#define xx first
#define yy second
#define ln 17
#define off 1000005
#define FastIO  ios_base::sync_with_stdio(false); cin.tie(NULL)

using namespace __gnu_pbds;
using namespace std ;

typedef tree< i64, null_type, less<i64>, rb_tree_tag, tree_order_statistics_node_update> ordered_set;
typedef pair<i64, i64> pii ;

#define INC 0
#define DEC 1
#define maxn 200005
#define INF 1000000000

int yes[505][505] ;
vector <int> g[maxn] ;
int b[maxn] ;

bool check(vector <int>v)
{
    for(int i=0 ; i<v.size() ; i++)
    {
        for(int j=i+1 ; j<v.size() ; j++)
        {
            if(!yes[ v[i] ][ v[j] ]) return false ;
        }
    }
    return true ;
}

int main()
{
    FastIO ;

    int n , m ;

    cin>>n>>m ;

    for(int i=1 ; i<=m ; i++)
    {
        int u , v ;
        cin>>u>>v ;
//        scanf("%d %d",&u,&v) ;
        g[u].pb(v) ; g[v].pb(u) ;
        yes[u][v] = 1 ; yes[v][u] = 1 ;
    }

    for(int i=1 ; i<=n ; i++)
    {
        if( g[i].size() == n-1 ) b[i] = 1 ;
    }

    vector <int> a ;

    for(int i=1 ; i<=n ; i++)
    {
        if( b[i] != 1 )
        {
            a.pb(i) ;
            b[i] = -1 ;
            for(int j=0 ; j<g[i].size() ; j++)
            {
                if( b[ g[i][j] ] == 1 ) continue ;
                a.pb(g[i][j]) ;
                b[ g[i][j] ] = -1 ;
            }
            break ;
        }
    }

    vector <int> c ;
    for(int i=1 ; i<=n ; i++)
    {
        if( b[i]==0 ) c.pb(i) ;
    }

    bool flag = 1 ;
    for(int i=0 ; i<a.size() ; i++)
    {
        for(int j=0 ; j<c.size() ; j++)
        {
            if( yes[ a[i] ][ c[j] ] ) flag = 0 ;
        }
    }

    if( !check(a) || !check(c) || !flag )
    {
        cout<<"No"<<endl ;
        return 0 ;
    }
    string ans = "" ;
    for(int i=1 ; i<=n ; i++)
    {
        ans += 'x' ;
        if(b[i]==1) ans[i-1] = 'b' ;
        else if(b[i]==-1) ans[i-1] = 'a' ;
        else ans[i-1] = 'c' ;
    }

    cout<<"Yes"<<endl ;
    cout<<ans<<endl;

//    printf("Yes\n%s\n",ans) ;

    return 0 ;
}


                  /********* MY GOD - _/\_ ARUNAJAY _/\_ ********/

#include<bits/stdc++.h>
using namespace std;

#define sz(c) (c).size()
#define pb push_back
#define all(c) (c).begin(), (c).end()
#define tr(c, i) for(__typeof((c).begin()) i = (c).begin(); i != (c).end(); i++)
#define present(c, x) ((c).find(x) != (c).end())
#define cpresent(c, x) (find(all(c), x) != (c).end())
#define REP(i, n) for(int i = 0; i < (n); i++)
#define REPD(i, n) for(int i = (n)-1; i >= 0; i--)
#define For(i, a, b) for(int i = (a); i <= (b); i++)
#define Ford(i, a, b) for(int i = (a); i >= (b); i--)
#define mp make_pair
#define ll long long
#define ull unsigned long long
#define modulo 1000000007
#define boostio std::ios::sync_with_stdio(false);cin.tie(NULL);
#define tt int n;cin>>n;while(n--)

int main()
{
boostio;

vector<ll> v1;
ll n;

cin>>n;
if(n==0)
    cout<<1<<endl;
else
{
    ll k=n*(n+1)/2;
    cout<<6*k+1<<endl;
}

return 0;
}


#include <iostream>
#include <string>
#include <map>
#include <vector>
#include <set>
#include <queue>
#include <algorithm>
#include <iterator>
#define ll long long
using namespace std;

int main()
{
	int x, y, z, a, b, c;
	cin >> x >> y >> z >> a >> b >> c;
	a -= x, x = 0;
	while (y)
	{
		if (a > 0)
			a--;
		else if (b)
			b--;
		else
			break;
		y--;
	}
	while (z)
	{
		if (a > 0)
			a--;
		else if (b)
			b--;
		else if (c)
			c--;
		else
			break;
		z--;
	}
	if (a >= 0 && b >= 0 && c >= 0 && !x && !y && !z)
		cout << "YES";
	else
		cout << "NO";
	return 0;
}


#include <bits/stdc++.h>
using namespace std;
const double PI = acos(-1.0);
struct Complex{
    double x,y;
    Complex(double _x = 0.0,double _y = 0.0){
        x = _x;
        y = _y;
    }
    Complex operator-(const Complex &b)const{
        return Complex(x - b.x,y - b.y);
    }
    Complex operator+(const Complex &b)const{
        return Complex(x + b.x,y + b.y);
    }
    Complex operator*(const Complex &b)const{
        return Complex(x*b.x - y*b.y,x*b.y + y*b.x);
    }
};
void change(Complex y[],int len){
    int i,j,k;
    for(int i = 1,j = len/2;i<len-1;i++){
        if(i < j)    swap(y[i],y[j]);
        k = len/2;
        while(j >= k){
            j = j - k;
            k = k/2;
        }
        if(j < k)    j+=k;
    }
}
void fft(Complex y[],int len,int on){
    change(y,len);
    for(int h = 2;h <= len;h<<=1){
        Complex wn(cos(on*2*PI/h),sin(on*2*PI/h));
        for(int j = 0;j < len;j += h){
            Complex w(1,0);
            for(int k = j;k < j + h/2;k++){
                Complex u = y[k];
                Complex t = w*y[k + h/2];
                y[k] = u + t;
                y[k + h/2] = u - t;
                w = w*wn;
            }
        }
    }
    if(on == -1){
        for(int i = 0;i < len;i++){
            y[i].x /= len;
        }
    }
}
class BigInt
{
#define Value(x, nega) ((nega) ? -(x) : (x))
#define At(vec, index) ((index) < vec.size() ? vec[(index)] : 0)
    static int absComp(const BigInt &lhs, const BigInt &rhs)
    {
        if (lhs.size() != rhs.size())
            return lhs.size() < rhs.size() ? -1 : 1;
        for (int i = lhs.size() - 1; i >= 0; --i)
            if (lhs[i] != rhs[i])
                return lhs[i] < rhs[i] ? -1 : 1;
        return 0;
    }
    using Long = long long;
    const static int Exp = 9;
    const static Long Mod = 1000000000;
    mutable std::vector<Long> val;
    mutable bool nega = false;
    void trim() const
    {
        while (val.size() && val.back() == 0)
            val.pop_back();
        if (val.empty())
            nega = false;
    }
    int size() const { return val.size(); }
    Long &operator[](int index) const { return val[index]; }
    Long &back() const { return val.back(); }
    BigInt(int size, bool nega) : val(size), nega(nega) {}
    BigInt(const std::vector<Long> &val, bool nega) : val(val), nega(nega) {}

public:
    friend std::ostream &operator<<(std::ostream &os, const BigInt &n)
    {
        if (n.size())
        {
            if (n.nega)
                putchar('-');
            for (int i = n.size() - 1; i >= 0; --i)
            {
                if (i == n.size() - 1)
                    printf("%lld", n[i]);
                else
                    printf("%0*lld", n.Exp, n[i]);
            }
        }
        else
            putchar('0');
        return os;
    }
    friend BigInt operator+(const BigInt &lhs, const BigInt &rhs)
    {
        BigInt ret(lhs);
        return ret += rhs;
    }
    friend BigInt operator-(const BigInt &lhs, const BigInt &rhs)
    {
        BigInt ret(lhs);
        return ret -= rhs;
    }
    BigInt(Long x = 0)
    {
        if (x < 0)
            x = -x, nega = true;
        while (x >= Mod)
            val.push_back(x % Mod), x /= Mod;
        if (x)
            val.push_back(x);
    }
    BigInt(const char *s)
    {
        int bound = 0, pos;
        if (s[0] == '-')
            nega = true, bound = 1;
        Long cur = 0, pow = 1;
        for (pos = strlen(s) - 1; pos >= Exp + bound - 1; pos -= Exp, val.push_back(cur), cur = 0, pow = 1)
            for (int i = pos; i > pos - Exp; --i)
                cur += (s[i] - '0') * pow, pow *= 10;
        for (cur = 0, pow = 1; pos >= bound; --pos)
            cur += (s[pos] - '0') * pow, pow *= 10;
        if (cur)
            val.push_back(cur);
    }
    BigInt &operator=(const char *s){
        BigInt n(s);
        *this = n;
        return n;
    }
    BigInt &operator=(const Long x){
        BigInt n(x);
        *this = n;
        return n;
    }
    friend std::istream &operator>>(std::istream &is, BigInt &n){
        string s;
        is >> s;
        n=(char*)s.data();
        return is;
    }
    BigInt &operator+=(const BigInt &rhs)
    {
        const int cap = std::max(size(), rhs.size()) + 1;
        val.resize(cap);
        int carry = 0;
        for (int i = 0; i < cap - 1; ++i)
        {
            val[i] = Value(val[i], nega) + Value(At(rhs, i), rhs.nega) + carry, carry = 0;
            if (val[i] >= Mod)
                val[i] -= Mod, carry = 1;
            else if (val[i] < 0)
                val[i] += Mod, carry = -1;
        }
        if ((val.back() = carry) == -1) //assert(val.back() == 1 or 0 or -1)
        {
            nega = true, val.pop_back();
            bool tailZero = true;
            for (int i = 0; i < cap - 1; ++i)
            {
                if (tailZero && val[i])
                    val[i] = Mod - val[i], tailZero = false;
                else
                    val[i] = Mod - 1 - val[i];
            }
        }
        trim();
        return *this;
    }
    friend BigInt operator-(const BigInt &rhs)
    {
        BigInt ret(rhs);
        ret.nega ^= 1;
        return ret;
    }
    BigInt &operator-=(const BigInt &rhs)
    {
        rhs.nega ^= 1;
        *this += rhs;
        rhs.nega ^= 1;
        return *this;
    }
    friend BigInt operator*(const BigInt &lhs, const BigInt &rhs)
    {
        int len=1;
        BigInt ll=lhs,rr=rhs;
        ll.nega = lhs.nega ^ rhs.nega;
        while(len<2*lhs.size()||len<2*rhs.size())len<<=1;
        ll.val.resize(len),rr.val.resize(len);
        Complex x1[len],x2[len];
        for(int i=0;i<len;i++){
            Complex nx(ll[i],0.0),ny(rr[i],0.0);
            x1[i]=nx;
            x2[i]=ny;
        }
        fft(x1,len,1);
        fft(x2,len,1);
        for(int i = 0 ; i < len; i++)
            x1[i] = x1[i] * x2[i];
        fft( x1 , len , -1 );
        for(int i = 0 ; i < len; i++)
            ll[i] = int( x1[i].x + 0.5 );
        for(int i = 0 ; i < len; i++){
            ll[i+1]+=ll[i]/Mod;
            ll[i]%=Mod;
        }
        ll.trim();
        return ll;
    }
    friend BigInt operator*(const BigInt &lhs, const Long &x){
        BigInt ret=lhs;
        bool negat = ( x < 0 );
        Long xx = (negat) ? -x : x;
        ret.nega ^= negat;
        ret.val.push_back(0);
        ret.val.push_back(0);
        for(int i = 0; i < ret.size(); i++)
            ret[i]*=xx;
        for(int i = 0; i < ret.size(); i++){
            ret[i+1]+=ret[i]/Mod;
            ret[i] %= Mod;
        }
        ret.trim();
        return ret;
    }
    BigInt &operator*=(const BigInt &rhs) { return *this = *this * rhs; }
    BigInt &operator*=(const Long &x) { return *this = *this * x; }
    friend BigInt operator/(const BigInt &lhs, const BigInt &rhs)
    {
        static std::vector<BigInt> powTwo{BigInt(1)};
        static std::vector<BigInt> estimate;
        estimate.clear();
        if (absComp(lhs, rhs) < 0)
            return BigInt();
        BigInt cur = rhs;
        int cmp;
        while ((cmp = absComp(cur, lhs)) <= 0)
        {
            estimate.push_back(cur), cur += cur;
            if (estimate.size() >= powTwo.size())
                powTwo.push_back(powTwo.back() + powTwo.back());
        }
        if (cmp == 0)
            return BigInt(powTwo.back().val, lhs.nega ^ rhs.nega);
        BigInt ret = powTwo[estimate.size() - 1];
        cur = estimate[estimate.size() - 1];
        for (int i = estimate.size() - 1; i >= 0 && cmp != 0; --i)
            if ((cmp = absComp(cur + estimate[i], lhs)) <= 0)
                cur += estimate[i], ret += powTwo[i];
        ret.nega = lhs.nega ^ rhs.nega;
        return ret;
    }
    friend BigInt operator/(const BigInt &num,const Long &x){
        bool negat = ( x < 0 );
        Long xx = (negat) ? -x : x;
        BigInt ret;
        Long k = 0;
        ret.val.resize( num.size() );
        ret.nega = (num.nega ^ negat);
        for(int i = num.size() - 1 ;i >= 0; i--){
            ret[i] = ( k * Mod + num[i]) / xx;
            k = ( k * Mod + num[i]) % xx;
        }
        ret.trim();
        return ret;
    }
    bool operator==(const BigInt &rhs) const
    {
        return nega == rhs.nega && val == rhs.val;
    }
    bool operator!=(const BigInt &rhs) const { return nega != rhs.nega || val != rhs.val; }
    bool operator>=(const BigInt &rhs) const { return !(*this < rhs); }
    bool operator>(const BigInt &rhs) const { return !(*this <= rhs); }
    bool operator<=(const BigInt &rhs) const
    {
        if (nega && !rhs.nega)
            return true;
        if (!nega && rhs.nega)
            return false;
        int cmp = absComp(*this, rhs);
        return nega ? cmp >= 0 : cmp <= 0;
    }
    bool operator<(const BigInt &rhs) const
    {
        if (nega && !rhs.nega)
            return true;
        if (!nega && rhs.nega)
            return false;
        return (absComp(*this, rhs) < 0) ^ nega;
    }
    void swap(const BigInt &rhs) const
    {
        std::swap(val, rhs.val);
        std::swap(nega, rhs.nega);
    }
};
BigInt one[105][10],sb,len[105];
int i,j,k;

struct dian{
	BigInt id;
	int dis,len;
	bool operator<(const dian x)const{return dis>x.dis;}
}d,tmp1,tmp2,tmp3;
char ch[55];

map<BigInt,bool>mp;
priority_queue<dian> q;

int main(){
	len[1]="1";
	for(i=1;i<=9;i++){one[1][i]=one[1][i-1]+"1";}
	for(i=2;i<=66;i++){
		len[i]=len[i-1]*10;
		for(j=1;j<=9;j++){
			one[i][j]=one[i-1][j]*10+one[1][j];
		}
	}
	cin>>ch+1;
	d.id=ch+1;
	d.len=strlen(ch+1);
	q.push(d);
	while(1){
		d=q.top();q.pop();
		if(mp[d.id]){continue;}
		else{mp[d.id]=1;}
		for(i=1;i<=55;i++){
			if(i==55){goto aaa;}
			if(d.id<len[i]){d.len=i-1;break;}
		}
		//cout<<d.id<<' '<<d.len<<' '<<d.dis<<endl;
		if(d.len==0){cout<<d.dis;return 0;}
		for(i=1;i<=9;i++){
			tmp3.id=one[d.len+1][1]-d.id;
			tmp3.dis=d.dis+d.len+1;
			q.push(tmp3);
			if(one[d.len][i]>=d.id){
				if(i==1){
					tmp1.id=one[d.len][i]-d.id;
					tmp1.dis=d.dis+d.len*i;
					q.push(tmp1);
					if(one[d.len][i]!=d.id){
						tmp2.id=d.id-one[d.len-1][9];
						tmp2.dis=d.dis+(d.len-1)*(9);
						q.push(tmp2);
					}
				}
				else{
					tmp1.id=one[d.len][i]-d.id;
					tmp1.dis=d.dis+d.len*i;
					q.push(tmp1);
					if(one[d.len][i]!=d.id){
						tmp2.id=d.id-one[d.len][i-1];
						tmp2.dis=d.dis+d.len*(i-1);
						q.push(tmp2);
					}
				}
				break;
			}
		}
		aaa:;
	}
}


#include <iostream>
#include <vector>
#include <set>
#include <queue>
#include <set>
#include <string>
#include <map>
#include <algorithm>
using namespace std;

const int MAXN = 1e5 + 113;

int a[1000 + 113];

signed main()
{
	int sum = 0;
	for (int i = 1; i <= 6; ++i)
	{
		cin >> a[i];
		sum += a[i];
	}
	for (int i = 1; i <= 6; ++i)
	{
		for (int j = i+1; j <= 6; ++j)
		{
			for (int k = j+1; k <= 6; ++k)
			{
				if ((a[i] + a[j] + a[k]) * 2 == sum)
				{
					cout << "YES";
					return 0;
				}
			}
		}
	}

	cout << "NO";
	//system("pause");
	return 0;

}


/*bismillah ->                                                                                << Suirkhanov Meyirlan >>
  GL HF

                                                                                42

    bless my code =)
                                                                                NEVER FOLLOW YOUR RULES :D HAHAHAHA
*/

///scanf ("%d%d", &x, &y);
///printf("%d", &a)

#include <bits/stdc++.h>

#define fast ios_base::sync_with_stdio();   cin.tie(0);   cout.tie(0);
#define randoperation srand(time(0));
#define pii pair < int , int >
#define pll pair < ll, ll >
#define pb push_back
#define mp make_pair
#define fi first
#define se second
#define fast ios_base::sync_with_stdio();   cin.tie(0);   cout.tie(0);
#define randoperation srand(time(0));

using namespace std;

typedef long long ll;
typedef long double ld;
typedef unsigned long long ull;

const ll N = 1e3 + 8;
const ld pi = 3.14159265359;
const int INF = 1e9 + 1;
const double eps = 1e-9;

int  ax, ay, bx, by, cx, cy;

void fail(){
  printf("No");
  exit(0);
}

ll dist(int x1, int y1, int x2, int y2){
  return (x1 - x2) * 1ll * (x1 - x2) + (y1 - y2) * 1ll * (y1 - y2);
}

int main(){

  //freopen("inevit.in", "r", stdin);
  //freopen("inevit.out", "w", stdout);

  fast
  randoperation;

  ///           ||
  ///start here \/

  cin >> ax >> ay >> bx >> by >> cx >> cy;

  ld ab = dist(ax, ay, bx, by);
  ld bc = dist(bx, by, cx, cy);
  ld ca = dist(cx, cy, ax, ay);

  if(ab != bc){
    fail();
  }

  if(sqrt(ab) + sqrt(bc) <= sqrt(ca)){
    fail();
  }

  if(sqrt(ab) + sqrt(ca) <= sqrt(bc)){
    fail();
  }

  if(sqrt(bc) + sqrt(ca) <= sqrt(ab)){
    fail();
  }
//
  printf("Yes");
  return 0;
}


#include <bits/stdc++.h>
#define ll long long
using namespace std;
int main()
{
	ll x,t,a,b,d1,d2;
	cin>>x>>t>>a>>b>>d1>>d2;
	ll y=0;
	for (int i = 0; i < t; ++i)
	{
		for (int j = 0; j < t; ++j)
		{
			if((a-i*d1+b-j*d2)==x || b-j*d2==x || a-i*d1==x || x==0)
			{
				y=1;
				break;
			}
		}
		if(y==1)
			break;
	}
	if(y==1)
		cout<<"YES\n";
	else
		cout<<"NO\n";
	return 0;
}


#include<bits/stdc++.h>

using namespace std;
#define ll long long
#define ull unsigned long long
#define ld long double
#define fi first
#define se second
#define pb push_back
#define mp make_pair

//vector<list<int>> v;
//ll a[200005],b[200005];
//int a[200005],b[200005];
//ll a[1001005];
//pair<int,int> a[1000005];
//vector<int> l;
//pair<int,int>p;
//pair<ll,int> a[500005];
//vector<int> adj[100005];
//unordered_set<int> s;

bool comp(const int a,const int b){
    return a<b;
}

bool RelativelyPrime (int a, int b) {
   return (a<b) ? RelativelyPrime(b,a) : !(a%b) ? (b==1) : RelativelyPrime (b, a%b);
}

ll mod= 998244353;

ll ar[5005][5005];
int main() {
   ios_base::sync_with_stdio(false);
     cin.tie(NULL);
    //freopen("input.txt","r",stdin);
    int a,b,c;
    cin>>a>>b>>c;
    for(int i=0;i<=5000;i++){
    	for(int j=0;j<=5000;j++){
    		if(i==0||j==0)ar[i][j]=1;
    		else ar[i][j]=(ar[i-1][j]+j*ar[i-1][j-1])%mod;
    	}
    }
    ll sum=(((ar[a][c]*ar[a][b])%mod)*ar[b][c])%mod;
    cout<<sum;

    return 0;
}


#include <bits/stdc++.h>

#define f(i, a, b, c) for(int i = a ; i < b ; i += c)
#define fr(i, a, b, c) for(int i = a ; i >= b ; i -= c)
#define fit(it, v) for(auto it = v.begin() ; it != v.end() ; ++it)
#define frit(it, v) for(auto it = v.rbegin() ; it != v.rend() ; ++it)
#define all(v) v.begin(), v.end()
#define allr(v) v.rbegin(), v.rend()
#define lli long long int
#define pb push_back
#define eb emplace_back
#define mp make_pair
#define NL '\n'

using namespace std;

typedef vector< int > vi;
typedef vector< vi > vvi;
typedef vector< lli > vli;
typedef pair< int, int > ii;
typedef vector< ii > vii;
typedef vector< char > vc;
typedef vector< string > vs;
typedef vector< bool > vb;
typedef set< int > si;
typedef set< ii > sii;

int main(){
	ios_base::sync_with_stdio(false);
	cin.tie(nullptr);

	#ifdef LOCAL_TEST
		ifstream h("in");
		ofstream g("out");
		clock_t z = clock();
	#else
		#define h cin
		#define g cout
	#endif//LOCAL_TEST

	int n;
	h >> n;
	vector< vli > v(n, vli (4));
	lli x1 = INT_MAX, x2 = 0, y1 = INT_MAX, y2 = 0;
	f(i, 0, n, 1){
		h >> v[i][0] >> v[i][1] >> v[i][2] >> v[i][3];
		x1 = min(x1, v[i][0]);
		x2 = max(x2, v[i][2]);
		y1 = min(y1, v[i][1]);
		y2 = max(y2, v[i][3]);
	}
	lli area = (y2 - y1) * (x2 - x1), sum = 0;
	f(i, 0, n, 1)
		sum += (v[i][2] - v[i][0]) * (v[i][3] - v[i][1]);
	g << (x2 - x1 == y2 - y1 && area == sum ? "YES" : "NO");

	#ifdef LOCAL_TEST
		cerr << "Time taken is: " << double(clock() - z) / CLOCKS_PER_SEC << NL;
		h.close();
		g.close();
	#endif//LOCAL_TEST
}


#include <cstdio>

using namespace std;

const int N = 2002;

double dp [N][N];

int main () {
    int n, t, T, i, j;
    double p, ans = 0.0;

 /*   freopen ("D.in", "r", stdin);
    freopen ("D.out", "w", stdout);*/

    scanf ("%d%lf%d", &n, &p, &t);

    dp [1][1] = p;
    dp [1][0] = (1 - p);
    for (i = 1; i <= t; i ++) {
        for (j = 0; j < n; j ++) {
            dp [i + 1][j + 1] += dp [i][j] * p;
            dp [i + 1][j] += dp [i][j] * (1 - p);
        }
        dp [i + 1][j] += dp [i][j];
    }

    for (i = 1; i <= n; i ++)
        ans = ans + dp [t][i] * i;
    printf ("%lf\n", ans);
    return 0;
}


#include<bits/stdc++.h>
#include <string>
#include <iostream>
using namespace std;
#define int long long
#define FAST ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
#define double      long double
#define pb          push_back
#define pf          push_front
#define ft	first
#define sd	second

const int mod = 1e9+7;
const int inf=1e18;
//	freopen("input.txt", "r", stdin);
//	freopen("output.txt", "w", stdout);
bool isprime(int tot){
	if(tot==1) return false;
	for(int i = 2;i*i<=tot;i++){
		if(tot%i==0) return false;
	}
	return true;
}

int lcm(int a,int b){
	return (a*b)/__gcd(a,b);
}

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

}

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

struct node{
	int x,y;
};
int dp[1000005];

signed main(){
    FAST
	int n;
	cin>>n;

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

	int sum=0;
	for(int i=2;i<=n;i++){
		sum = (sum + dp[i-1])%998244353;
		dp[i] = (dp[i] + sum)%998244353;
	}
	cout<<dp[n]%998244353<<endl;
}


#include <bits/stdc++.h>
using namespace std;
int uz,topac,sayac,flag;
char A[200];
int main()
{
	scanf("%s",A);
	uz=strlen(A);
	if(uz<5)
	{
		printf("Too weak");
		return 0;
	}
	for(int i=0;i<=uz-1;i++)
	{
		if(A[i]>=48 && A[i]<=57)
		{
			flag++;
		}
		if(A[i]>=65 && A[i]<=90)
		{
			sayac++;
		}
		if(A[i]>=97 && A[i]<=122)
		{
			topac++;
		}
	}
	if(sayac>=1 && topac>=1 && flag>=1)
	{
		printf("Correct");
		return 0;
	}
	else
	{
		printf("Too weak");
		return 0;
	}
	return 0;
}


#include<bits/stdc++.h>
using namespace std;
//Optimisations
#pragma GCC target ("avx2")
#pragma GCC optimization ("unroll-loops")
#pragma GCC optimize("O2")
//shortcuts for functions
#define pb push_back
#define mp make_pair
#define ff first
#define ss second
#define endl "\n"
#define all(v) v.begin(),v.end()
#define rall(v) v.rbegin(),v.rend()
#define th(n) cout<<n<<endl
#define gc getchar_unlocked
#define ms(s, n) memset(s, n, sizeof(s))
#define prec(n) fixed<<setprecision(n)
#define n_l '\n'
// make it python
#define gcd __gcd
#define append push_back
#define str to_string
#define upper(s) transform(s.begin(),s.end(),s.begin(),::toupper)
#define lower(s) transform(s.begin(),s.end(),s.begin(),::tolower)
#define print(arr) for(auto el: arr) cout<<el<<" ";cout<<endl
// utility functions shortcuts
#define max3(a,b,c) max(a,max(b,c))
#define min3(a,b,c) min(a,min(b,c))
#define sswap(a,b) {a=a^b;b=a^b;a=a^b;}
#define swap(a,b) {auto temp=a; a=b; b=temp;}
#define init(dp) memset(dp,-1,sizeof(dp));
#define set0(dp) memset(dp,0,sizeof(dp));
#define bits(x) __builtin_popcount(x)
#define SORT(v) sort(all(v))
#define endl "\n"
#define forr(i,n) for(ll i=0;i<n;i++)
#define formatrix(i,n) for(ll i=0;i<n;i++, cout<<"\n")
#define eof (scanf("%d" ,&n))!=EOF
// declaration shortcuts
#define vll vector<ll>
#define vvl vector<vector<ll>>
#define vpll vector<pair<ll,ll> >
#define pll pair<ll,ll>
#define ppl pair<ll,pp>
#define ull unsigned long long
#define ll long long
#define mll map< ll, ll >
#define sll set< ll >
#define ini(a, v)       memset(a, v, sizeof(a))
// Constants
constexpr int dx[] = {-1, 0, 1, 0, 1, 1, -1, -1};
constexpr int dy[] = {0, -1, 0, 1, 1, -1, 1, -1};
constexpr ll INF = 1999999999999999997;
constexpr int inf= INT_MAX;
constexpr int MAXSIZE = int(1e6)+5;
constexpr auto PI  = 3.14159265358979323846L;
constexpr auto oo  = numeric_limits<int>::max() / 2 - 2;
constexpr auto eps = 1e-6;
constexpr auto mod = 1000000007;
constexpr auto MOD = 1000000007;
constexpr auto MOD9 = 1000000009;
constexpr auto maxn = 100006;
// Debugging
// For reference: https://codeforces.com/blog/entry/65311
#define dbg(...) cout << "[" << #__VA_ARGS__ << "]: "; cout << to_string(__VA_ARGS__) << endl
template <typename T, size_t N> int SIZE(const T (&t)[N]){ return N; } template<typename T> int SIZE(const T &t){ return t.size(); } string to_string(string s, int x1=0, int x2=1e9){ return '"' + ((x1 < s.size()) ? s.substr(x1, x2-x1+1) : "") + '"'; } string to_string(const char* s) { return to_string((string) s); } string to_string(bool b) { return (b ? "true" : "false"); } string to_string(char c){ return string({c}); } template<size_t N> string to_string(bitset<N> &b, int x1=0, int x2=1e9){ string t = ""; for(int __iii__ = min(x1,SIZE(b)),  __jjj__ = min(x2, SIZE(b)-1); __iii__ <= __jjj__; ++__iii__){ t += b[__iii__] + '0'; } return '"' + t + '"'; } template <typename A, typename... C> string to_string(A (&v), int x1=0, int x2=1e9, C... coords); int l_v_l_v_l = 0, t_a_b_s = 0; template <typename A, typename B> string to_string(pair<A, B> &p) { l_v_l_v_l++; string res = "(" + to_string(p.first) + ", " + to_string(p.second) + ")"; l_v_l_v_l--; return res; } template <typename A, typename... C> string to_string(A (&v), int x1, int x2, C... coords) { int rnk = rank<A>::value; string tab(t_a_b_s, ' '); string res = ""; bool first = true; if(l_v_l_v_l == 0) res += n_l; res += tab + "["; x1 = min(x1, SIZE(v)), x2 = min(x2, SIZE(v)); auto l = begin(v); advance(l, x1); auto r = l; advance(r, (x2-x1) + (x2 < SIZE(v))); for (auto e = l; e != r; e = next(e)) { if (!first) { res += ", "; } first = false; l_v_l_v_l++; if(e != l){ if(rnk > 1) { res += n_l; t_a_b_s = l_v_l_v_l; }; } else{ t_a_b_s = 0; } res += to_string(*e, coords...); l_v_l_v_l--; } res += "]"; if(l_v_l_v_l == 0) res += n_l; return res; } void dbgs(){;} template<typename Heads, typename... Tails> void dbgs(Heads H, Tails... T){ cout << to_string(H) << " | "; dbgs(T...); }
#define dbgm(...) cout << "[" << #__VA_ARGS__ << "]: "; dbgs(__VA_ARGS__); cout << endl;
#define n_l '\n'
void fastio(){
ios_base::sync_with_stdio(false);
cin.tie(NULL);
}
int main(){fastio();
    ll a,b,c;
    cin>>a>>b>>c;
    ll low=0,high=1e9;
    ll ans=0;
    while(low<=high){
        ll mid = (low+high)/2;
        ll flag=0;

            if(b*mid+c*(b-a)<0){
                flag=1;
            }

        if(flag!=1){
            ans=mid;
            high=mid-1;
        }else{
            low=mid+1;
        }
    }
    cout<<ans;
}


#include <bits/stdc++.h>
#define lli long long int
using namespace std;

int main(void)
{
    lli a , b , c, mod;
    int cnt = 1;

    cin >> a >> b >> c;

    while( true && cnt <= 1e6)
    {
        if( a < b)
        {
            a *= 10;
        }

        mod = a % b;
        a /= b;

        if( a % 10 == c)
        {
            cout << cnt << endl;
            return 0;
        }

        cnt++;
        a = mod;
    }

    cout << -1 << endl;
    /*long double a,b;
    int i = 0, occ = 0;
    int check = 0;
    char c;
    long double ans = 0.0;
    string s;

    cin >> a >> b >> c;

    ans = a/b;
    stringstream ss;
    ss << fixed << setprecision( 20 ) << ans;
    s = ss.str();

    for(i = 0; i < s.length() - 1; i++)
    {
        if(s[i] == '.')
        {
            check = 1;
        }
        if(s[i] == c & check == 1)
        {
            occ = i - 1;
            break;
        }
        else
        {
            occ = -1;
        }
    }

    cout << occ << endl;*/
}


#include<iostream>
#include<cmath>

using namespace std;
int main()
{
	long long int x,y;
	int a,b,c,i,sum,k=0,v[80];
	cin>>a>>b>>c;
	for(i=1;i<=81;i+=1)
	{
		x=b*pow((double)i,a)+c;
		if(x>=0&&x<1000000000)
		{
			sum=0;
			y=x;
			while(x)
			{
				sum+=x%10;
				x/=10;
			}
			if(sum==i)
				v[k++]=y;
		}
	}
	/*if(c==0)
		cout<<k+1<<endl<<"0 ";
	else*/
		cout<<k<<endl;
	for(i=0;i<k;i++)
		cout<<v[i]<<" ";
	return 0;
}