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

int main(){
  int A,B,C;
  cin >> A >> B >> C;
  if(A>B){
    cout << "Takahashi" << endl;
  }else if(A<B){
    cout << "Aoki" << endl;
  }else{
    if(C==0) cout << "Aoki" << endl;
    else cout << "Takahashi" << endl;
  }
}

#include <bits/stdc++.h>

using namespace std ;
int a , b , c , d ;
int main (){

	cin >> a >> b >> c>> d ;
	if(a*b<=d && d <=a*c){
		cout << "No";
	}
	else{
		cout << "Yes";
	}
	}


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

const ll INF = 1e18;

ll dp[55][2];

int main(){
  int n; cin >> n;
  ll X; cin >> X;
  vector<ll> a(n);
  for(int i = 0; i < n; i++) cin >> a[i];
  vector<ll> x(n);
  for(int i = n-1; i>=0; i--){
    x[i] = X / a[i];
    X %= a[i];
  }
  dp[0][0] = 1;
  vector<ll> t(n);
  for(int i = 0; i < n-1; i++) t[i] = a[i+1]/a[i];
  t[n-1] = INF;
  for(int i = 0; i < n; i++){
    for(int j = 0; j < 2; j++){
      for(int nj = 0; nj < 2; nj++){
        //x[i]+z[i]+j=y+nj*t[i], y=0
        ll z = nj*t[i]-x[i]-j;
        if(z>=0 && z<t[i]) dp[i+1][nj] += dp[i][j];
        //x[i]+z[i]+j=y+nj*t[i], z=0
        ll y = x[i]+j-nj*t[i];
        if(y>0 && y<t[i]) dp[i+1][nj] += dp[i][j];
      }
    }
  }
  cout << dp[n][0] << endl;
  return 0;
}

#include<iostream>
#include<vector>
using namespace std;
int main() {
  long long N,x;
  cin >> N >> x;
  vector<long long> A(N);
  int i;
  for(i=0;i<N;i++)cin >> A[i];
  for(i=N-1;i>0;i--)A[i] /= A[i-1];
  vector<long long> X(N,0);
  X[0] = x;
  for(i=1;i<N;i++) {
    X[i] = X[i-1]/A[i];
    X[i-1] %= A[i];
  }
  long long yes = 1,no = 0,temp;
  for(i=0;i<N;i++) {
    if(i<N-1?X[i] == A[i+1]-1:false)temp = yes;
    else temp = yes + no;
    if(X[i] != 0)no = yes + no;
    yes = temp;
  }
  cout << yes << endl;
}


#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
using ll = long long;

int main(){
  int n,k;
  cin >> n >> k;

  int x = (1 + k) * k / 2 * n;
  int y = (1 + n) * n / 2 * 100 * k;

  cout << x + y << endl;
}

// AtCoder_Biginner_Contest_203.cpp : このファイルには 'main' 関数が含まれています。プログラム実行の開始と終了がそこで行われます。
//

#include <iostream> // cout, endl, cin
#include <string> // string, to_string, stoi
#include <vector> // vector
#include <algorithm> // min, max, swap, sort, reverse, lower_bound, upper_bound
#include <utility> // pair, make_pair
#include <tuple> // tuple, make_tuple
#include <cstdint> // int64_t, int*_t
#include <cstdio> // printf
#include <map> // map
#include <queue> // queue, priority_queue
#include <set> // set
#include <stack> // stack
#include <deque> // deque
#include <unordered_map> // unordered_map
#include <unordered_set> // unordered_set
#include <bitset> // bitset
#include <cctype> // isupper, islower, isdigit, toupper, tolower
using namespace std;

int main(void)
{
	int N, K;
	int64_t sum = 0;
	cin >> N >> K;
	for (int i = 1; i <= N; i++) {
		for (int j = 1; j <= K; j++) {
			sum += i * 100 + j;
		}
	}
	cout << sum << endl;
	return 0;
}


#include "bits/stdc++.h"

using namespace std;

typedef long long ll;

const ll INFLL = 2e18 + 5;

ll good(string x, ll n){
	ll ans = 0;
	for(char c: x){
		if(ans > INFLL / n)	return INFLL;
		ans *= n;
		ans += int(c - '0');
	}
	return ans;
}

int main(){
	ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
	int t = 1;	//cin >> t;
	for(int tt = 0; tt < t; tt++){
		string x;	cin >> x;
		ll m;	cin >> m;
		int d = 0, n = (int) x.size();
		for(int i = 0; i < n; i++){
			d = max(d, x[i] - '0');
		}
		if((int) x.size() == 1){
			ll xd = (x[0] - '0');
			if(xd <= m)	cout << "1\n";
			else cout << "0\n";
		}else{
			ll lo = d, hi = m + 1;
			while(hi - lo > 1){
				ll mid = (lo + hi) / 2;
				if(good(x, mid) <= m){
					lo = mid;
				}else{
					hi = mid;
				}
			}
			cout << lo - d << "\n";
		}
	}
}

#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using pll = pair<long long, long long>;
constexpr char ln =  '\n';
constexpr long long MOD = 1000000007;
constexpr long long INF = 1000000000 + 100;
constexpr long long LINF = 1000000000000000000 + 100;
#define all(v) v.begin(), v.end()
#define rep(i, n) for(int i=0;i<(n);i++)
#define rept(i, j, n) for(int i=(j); i<(n); i++)
#define rrep(i, n) for(int i=(n); i>=0; i--)
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }

int main(){
    string X; ll M; cin >> X >> M;

    if(X.size()==1){
        if(M < (X[0]-'0'))cout << 0 << ln;
        else cout << 1 << ln;
        return 0;
    }

    int mx_x = -1;
    //xに含まれる最大の値
    for(auto x:X){
        chmax(mx_x, x-'0');
    }

    reverse(all(X));
    auto check = [&](ll val) -> bool{
        ll num = 0, tmp = 1;
        rep(i, X.size()){
            num += tmp * (X[i]-'0');
            //オーバーフロー検知
            if(i != (int)X.size()-1 and tmp > (LONG_LONG_MAX/9) /val)return false;
            tmp *= val;
        }
        if(num <= M)return true;
        return false;
    };

    //Xを基数変換してM以下になるかどうか
    ll ok = mx_x, ng = LINF;
    while(ng - ok > 1){
        ll mid = (ok + ng) / 2;
        if(check(mid))ok = mid;
        else ng = mid;
    }
    cout << ok - mx_x << ln;
}


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

typedef long long int ll;
typedef long double ld;
#define benq queue
#define pbenq priority_queue
#define all(x) x.begin(), x.end()
#define sz(x) (ll)x.size()
#define m1(x) memset(x, 1, sizeof(x))
#define m0(x) memset(x, 0, sizeof(x))
#define inf(x) memset(x, 0x3f, sizeof(x))
#define MOD 1000000007
#define INF 0x3f3f3f3f3f3f3f3f
#define PI 3.14159265358979323846264338
#define flout cout << fixed << setprecision(12)
ll n, k;

int main() {
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cin >> n >> k;
    ll cur = n;
    while(k--) {
        string s = to_string(cur), t = s;
        sort(all(s));
        sort(all(t), greater<char>());

        cur = stoll(t) - stoll(s);
    }

    cout << cur << '\n';
    return 0;
}

// Problem : B - Quadruple
// Contest : AtCoder - AtCoder Regular Contest 107
// URL : https://atcoder.jp/contests/arc107/tasks/arc107_b
// Memory Limit : 1024 MB
// Time Limit : 2000 ms
// Powered by CP Editor (https://github.com/cpeditor/cpeditor)
#include<bits/stdc++.h>
using namespace std;
using ll = long long;
int main(){
	int n, k;
	cin >> n >> k;
	auto f = [&](int x) -> long long{
		if(x < 2 || x > 2 * n) return 0;
		return min(0ll + x - 1, 1ll * 2 * n - x + 1);
	};
	ll ans = 0;
	for(int i = 2; i <= 2 * n; i ++){
		ans += f(i) * f(i + k);
	}
	cout << ans << endl;
	return 0;
}


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

char colorOnTop(char c0, char c1) {
  if (c0 == c1) return c0;
  if (c0 == 'W' && c1 == 'B') return 'R';
  if (c0 == 'W' && c1 == 'R') return 'B';
  if (c0 == 'B' && c1 == 'W') return 'R';
  if (c0 == 'B' && c1 == 'R') return 'W';
  if (c0 == 'R' && c1 == 'W') return 'B';
  if (c0 == 'R' && c1 == 'B') return 'W';
  return 'A';
}

char getTopColor(int n, string s) {
  if (n == 1) return s[0];

  int k = 1;
  while (3 * k < n) k *= 3;

  string ns = "";
  for (int i = 0; i + k < n; i++) ns += colorOnTop(s[i], s[i + k]);
  return getTopColor(n - k, ns);
}

int main() {
  //fast_io();

  int n;
  string s;
  cin >> n >> s;
  cout << getTopColor(n, s);
}

#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace std;
using namespace __gnu_pbds;
typedef long long ll;
template<class T> using ordered_set = tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
template<class A> ostream& operator<<(ostream &cout, vector<A> const &v) {cout << "["; for(int i = 0; i < v.size(); i++) {if (i) cout << ", "; cout << v[i];} return cout << "]";};
template<class A, class B> ostream& operator<<(ostream &cout, const pair<A,B> &x) {return cout << "(" <<x.first << ", " << x.second << ")";};
template<class T> void pv(T a, T b) {cerr << "["; for (T i = a; i != b; ++i) {if (i != a) cerr << ", "; cerr << *i;}cerr << "]\n";}
void _print() {cerr << "]\n";}
template<class T, class... V> void _print(T t, V... v) {cerr << t; if (sizeof...(v)) cerr << ", "; _print(v...);}
#define debug(x...) cerr << "[" << #x << "] = [", _print(x)
#define fi first
#define se second
#define SZ(x) (int)((x).size())
#define pii pair<int,int>
#define uid(x,y) uniform_int_distribution<int>(x,y)(rng)
int vp[400005], fa[400005];
int main() {
    ios::sync_with_stdio(0);
    cin.tie(0);
    int n;
    string s;
    cin >> n >> s;
    vp[0] = 0;
    fa[0] = 1;
    for (int q = 1; q < 400005; q++) {
        vp[q] = vp[q-1];
        fa[q] = fa[q-1];
        int qq = q;
        while (qq % 3 == 0) {
            vp[q]++;
            qq /= 3;
        }
        fa[q] = (fa[q]*qq)%3;
    }
    int tot = 0;
    for (int q = 0; q < n; q++) {
        //B = 0, R = 1, W = 2
        int x = 0;
        if (s[q] > 'B') x++;
        if (s[q] > 'R') x++;
        if (vp[n-1] == vp[q]+vp[n-1-q]) tot += x*fa[n-1]*fa[q]*fa[n-1-q];
    }
    tot = ((tot%3)+3)%3;
    if (n % 2 == 0) tot = (3-tot)%3;
    if (tot == 0) cout << "B\n";
    else if (tot == 1) cout << "R\n";
    else cout << "W\n";
    return 0;
}


#include<bits/stdc++.h>
#define ll long long
#define ld long double
#define pb push_back
#define mp make_pair
#define ff first
#define ss second
#define mod 1000000007
#define all(x) x.begin(),x.end()
using namespace std;
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#pragma GCC optimize("O3")
#pragma comment(linker, "/stack:200000000")
#pragma GCC optimize("unroll-loops")
using namespace __gnu_pbds;
#define speed ios_base::sync_with_stdio(false);cin.tie(0);

int main()
{
    speed
    ll t=1,i,j,x;

    string s;
    cin>>s;
    string w="";
    for(i=0;i<s.size();i++)
    {
        if(s[i]=='.')
        break;
        w+=s[i];
    }
    cout<<w<<'\n';
}

#include<bits/stdc++.h>
using namespace std;
string s;
int main()
{
	cin>>s;
	for (int i=0;i<s.size();i++)
	{
		if (s[i]!='.') cout<<s[i];
		else break;
	}
	return 0;
}


// Problem: A - ABC Preparation
// Contest: AtCoder - AtCoder Beginner Contest 185
// URL: https://atcoder.jp/contests/abc185/tasks/abc185_a
// Memory Limit: 1024 MB
// Time Limit: 2000 ms
// Powered by CP Editor (https://github.com/cpeditor/cpeditor)

#include<bits/stdc++.h>
using namespace std;
#define int         long long int
#define vi           vector<int>
#define pii          pair<int,int>
#define vpp          vector<pii>
#define mii          map<int,int>
#define pb           push_back
#define rep(i,a,bb)  for(int i=a;i<bb;i++)
#define ff           first
#define ss           second
#define fast         ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define test         int T;cin>>T;while(T--)
#define __sort(v)    sort(v.begin(),v.end())
#define __rsort(v)   sort(v.rbegin(),v.rend())
#define setbits(x)   __builtin_popcount(x)
#define zrobits(x)   __builtin_ctzint(x)
#define endl '\n'
#define debug(x)  cerr<<"[ "<<#x<<" : "<<x<<" ]"<<endl
#define debugp(x) cerr<<"[ "<<#x<<".ff : "<<x.first<<", "<<#x<<".ss : "<<x.second<<" ]"<<endl
#define debugs(x) cerr<<"[ "; for(auto i:x) cerr<<i<<" "; cerr<<" ]"<<endl;
#define debugm(x) cerr<<"----------"<<endl; for(auto i:x) cerr<<i.ff<<":"<<i.ss<<endl; cerr<<"----------";
#define PI 3.14159265359
int dx[]={0,0,1,-1};
int dy[]={1,-1,0,0};
int dxk[]={0,0,1,-1,1,1,-1,-1};
int dyk[]={1,-1,0,0,1,-1,1,-1};
const int inf = 1e+18;
const int mod = 1e+9 + 7;
int cases = 1;

int power(int x, int p, int m){
	int res = 1;
	while(p){
		if(p&1)
		  res=(res*x)%m;
		x = (x*x)%m;
		p/=2;
	}
	return res;
}

int inverse_mod(int x, int p, int m){
	// Fermat's little theorem
	// a^p = a  % p
	// a^(p-1) = a % p
	// a^(p-2) = (1/a)%p => inverse modulo
	return power(x, p-2, m);
}

void solve()
{
	int a, b, c, d;
	cin>>a>>b>>c>>d;
	cout<<min({a, b, c, d});
}

int32_t main()
{
  fast;
//  test{
 // cout<<"Case #"<<cases<<": ";
  solve();
  //++cases;
  //}
  return 0;
}

#include<iostream>
#include<cstdio>
#include<fstream>
#include<algorithm>
#include<cmath>
#include<deque>
#include<vector>
#include<queue>
#include<string>
#include<cstring>
#include<map>
#include<stack>
#include<set>
#include<iomanip>
#include<ctime>
#define maxn 1000005
#define inf 0x7fffffffffff
#define mod 1000000007
#define mst(a,x) memset(a,x,sizeof(a))
#define endl "\n"
#define hh cout<<endl
#define up(l,r,i) for(LL i=l;i<=r;i++)
#define down(l,r,i) for(LL i=l;i>=r;i--)
#define in(l,r,a) for(LL i=l;i<=r;i++)cin>>a[i]
#define out(l,r,a) for(LL i=l;i<=r;i++)cout<<a[i]<<" ";hh;
#define injz(n,m,a) for(LL i=1;i<=n;i++)for(LL j=1;j<=m;j++)cin>>a[i][j]
#define st(a,n) sort(a+1,a+n+1)
#define sta(v) sort(v.begin(),v.end())
#define pb push_back
#define cf cin>>T;while(T--)
#define xh(n) U=n;while(U--)
#define cfout(x) cout<<(x?"YES":"NO")<<endl
#define cs cerr<<"qaq"<<endl
#define dbg(n) cerr<<n<<endl
typedef long long LL;LL T,U;
typedef double db;
using namespace std;
int main()
{
    ios::sync_with_stdio(false);
    #ifdef ONLINE_JUDGE
    #else
    //freopen("bwxnQAQin.txt","r",stdin);
    //freopen("bwxnQAQout.txt","w",stdout);
    #endif
    LL a,b;
    cin>>a>>b;
    cout<<a*1.0*b/100<<endl;
    cerr<<"Time : "<<1000*((double)clock())/(double)CLOCKS_PER_SEC<<"ms";
    return 0;
}


#include <iostream>
#include <algorithm>
#include <vector>
#include <string>
#include <set>
#include <queue>
#include <iomanip>

using namespace std;

typedef long long ll;

int main()
{
	ll n, k;
	cin >> n >> k;

	for (ll q = 0; q < k; q++) {
		if (n % 200 == 0) {
			n /= 200;
		}
		else {
			if (k - q == 1) {
				cout << n * 1000 + 200 << endl;
				return 0;
			}
			else {
				q++;
				n = n * 5 + 1;
			}
		}
	}

	cout << n << endl;
}

//**He who has a why can survive almost any how***

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

#define mp make_pair
#define mt make_tuple
#define fi first
#define se second
#define pb push_back
#define ll long long
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define rep(i,n) for(i=0;i<n;i++)
#define forn(i, n) for (ll i = 0; i < (ll)(n); ++i)
#define for1(i, n) for (ll i = 1; i <= (ll)(n); ++i)
#define ford(i, n) for (ll i = (ll)(n) - 1; i >= 0; --i)
#define fore(i, a, b) for (ll i = (ll)(a); i <= (ll)(b); ++i)
#define fora(it,x) for(auto it:x)
#define PI 3.14159265
#define sync ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);
#define endl "\n"

typedef pair<ll, ll> pii;
typedef vector<ll> vi;
typedef vector<pii> vpi;
typedef vector<vi> vvi;
typedef long long i64;
typedef vector<i64> vi64;
typedef vector<vi64> vvi64;
typedef pair<i64, i64> pi64;
typedef long double ld;

template<class T> bool uin(T &a, T b) { return a > b ? (a = b, true) : false; }
template<class T> bool uax(T &a, T b) { return a < b ? (a = b, true) : false; }

bool cmp(pair<string,ll>p1,pair<string,ll> p2){
    return(p1.second>p2.second);
}

int main(){
    ll n;
    cin>>n;
    vector<pair<string,ll>> v;
    forn(i,n){
        ll te;
        string ts;
        cin>>ts>>te;
        v.pb(mp(ts,te));
    }
    sort(all(v),cmp);
    cout<<v[1].first;
}


// #include<bits/stdc++.h>
#include <iostream>
#include <iomanip>
#include <cmath>
#include <string>
#include <algorithm>
#include <ctime>
#include <functional>
#include <vector>
#include <stack>
#include <queue>
#include <map>
#include <set>
#include <tuple>
#include <cassert>
#include <bitset>

using namespace std;

int main() {
  string S;
  cin >> S;

  S += S.at(0);
  S.erase(0,1);

  cout << S << endl;
}

#include<iostream>
using namespace std;
int main()
{
    int a[5],i,min=0;

    for(i=0;i<4;i++)
    {
       cin>>a[i];

    }
    min=a[0];
    for(i=1;i<4;i++)
    {
       if(min>a[i])
         min=a[i];

    }
    cout <<min<<endl;
    return 0;
}


#include <bits/stdc++.h>
using namespace std;
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
#define ll long long
using pss = pair<string, string>;
using pll = pair<ll, ll>;
using pls = pair<ll,string>;
typedef tree<ll, null_type, less_equal<ll>, rb_tree_tag, tree_order_statistics_node_update> indexed_set;
#define endl '\n';
#define IO ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
const long long mod = 1 * 1e18 + 7;
int main()
{
    IO;
    ll i=0, j=0, m=0, n=0, k=0, t=0;
    cin>>t;
    while(t--)
    {
        cin>>n;
        string s[3];
        for(i=0;i<3;i++)
        cin>>s[i];
        string ans="";
        ans.push_back('1');
        for(i=0;i<n;i++)
        ans.push_back('0');
        for(i=0;i<n;i++)
        ans.push_back('1');
        cout<<ans<<endl;
    }
    return 0;
}


#include <iostream>
#include <cmath>
#include <algorithm>
#include <string>
#include <map>

using namespace std;

long power_mod(long a, long b, long m)
{
    int k = 0;
    long c = b;
    long n = 1L;
    while (c >= 1)
    {
        c >>= 1;
        ++k;
    }
    for (int i = k; i >= 0; --i)
    {
        n = ((b >> i) & 1) ? (n * n * a) % m : (n * n) % m;
    }
    return n;
}

int main()
{
    const long P = 1000000007;
    int H, W;
    cin >> H >> W;
    //string *S = new string[H];
    bool **S = new bool *[H];
    string Str;
    int K = 0;
    int **illuminate = new int *[H];
    for (int i = 0; i < H; ++i)
    {
        cin >> Str;
        S[i] = new bool[W];
        illuminate[i] = new int[W];
        for (int j = 0; j < W; j++)
        {
            S[i][j] = (Str.at(j) == '.');
            K += (S[i][j] ? 1 : 0);
            illuminate[i][j] = 0;
        }
    }

    //horizontal
    for (int i = 0; i < H; i++)
    {
        int j = 0;
        while (j < W)
        {
            int len = 0;
            while (j < W && !S[i][j])
            {
                j++;
            }
            while (j + len < W && S[i][j + len])
            {
                len++;
            }
            for (int k = 0; k < len; ++k)
            {
                illuminate[i][j + k] += len;
            }
            j = j + len;
        }
    }

    //vertical
    for (int j = 0; j < W; j++)
    {
        int i = 0;
        while (i < H)
        {
            int len = 0;
            while (i < H && !S[i][j])
            {
                i++;
            }
            while (i + len < H && S[i + len][j])
            {
                len++;
            }
            for (int k = 0; k < len; ++k)
            {
                illuminate[i + k][j] += len;
            }
            i = i + len;
        }
    }

    long sum = 0;
    long C = power_mod(2, K, P);

    for (int i = 0; i < H; i++)
    {
        for (int j = 0; j < W; j++)
        {
            if (illuminate[i][j] > 0)
            {
                sum += C - power_mod(2, K - illuminate[i][j] + 1, P);
            }
        }
    }

    cout << (sum % P + P) % P;

    return 0;
}

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

typedef long long ll;
#define SZ(a) int((a).size())
#define _REP(_1,_2,_3,_4,name,...) name
#define _REP4(i,b,e,s) for(decltype(e) _b=(b),_e=(e),i=_b+(0<(s)?0:(s));(0<(s)?i<_e:_e<=i);i+=(s))
#define _REP3(i,b,e) for(decltype(e) _b=(b),_e=(e),i=(_b<_e?_b:_b-1);(_b<_e?i<_e:_e<=i);(_b<_e?i++:i--))
#define _REP2(i,n) for(decltype(n) i=0,_n=(n);i<_n;i++)
#define _REP1(n) for(decltype(n) _i=0,_n=(n);_i<_n;_i++)
#define REP(...) _REP(__VA_ARGS__,_REP4,_REP3,_REP2,_REP1)(__VA_ARGS__)
#define FOR(it,c) for(auto&& it=begin(c);it!=end(c);it++)
#define ROF(it,c) for(auto&& it=rbegin(c);it!=rend(c);it++)
#define INT(n) int n;assert(0<scanf("%d",&n))

static const int MAXP = 1000000;
vector<int> ps, fs;
void init(){
  fs.reserve(1 + MAXP);
  for(int i = 0; i <= MAXP; i++){fs.push_back(i);}
  for(int i = 2; i <= MAXP; i++){
    if (fs[i] == i){
      ps.push_back(i);
      for (int j = i; j <= MAXP; j += i){
        fs[j] = min(fs[j], i);
      }
    }
  }
}
bool isprime(const long long& n){
  if (n <= MAXP){
    return (1 < n && fs[n] == n);
  } else {
    for(int p: ps){
      if (n % p == 0){return false;}
    }
    return true;
  }
}
vector<pair<long long, int>> factor(long long n){
  vector<pair<long long, int>> v;
  long long i = n;
  if (MAXP < i){
    for(int p: ps){
      int r = 0;
      while (i % p == 0){r++; i /= p;}
      if (0 < r){v.push_back(make_pair(p, r));}
      if (i <= MAXP){break;}
    }
    if (MAXP < i){
      v.push_back(make_pair(i, 1));
      i = 1;
    }
  }
  while(1 < i){
    if (v.empty() || (*v.rbegin()).first != fs[i]){
      v.push_back(make_pair(fs[i], 1));
    } else {
      (*v.rbegin()).second++;
    }
    i /= fs[i];
  }
  return v;
}

int moebius(long long n){
  int m = 1;
  for(auto pr: factor(n)){
    if (pr.second == 1){
      m *= -1;
    } else {m = 0; break;}
  }
  return m;
}

int main(){
  ll ans = 0;
  init();
  INT(l); INT(r);
  REP(i, 2, r / 2 + 1){
    int n = r / i - (l - 1) / i;
    ans += (ll) -moebius(i) * n * (n - 1);
    if (l <= i){ans -= 2*(n - 1);}
  }
  printf("%lld\n", ans);
  return 0;
}


#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define ull unsigned long long
#define pb push_back
#define mkp make_pair
#define mt make_tuple
#define ff first
#define ss second
#define M1 1000000007
#define M2 998244353

#define fl(i,a,b)  for(ll i=a;i<b;i++)
#define bfl(i,a,b) for(ll i=b-1;i>=a;i--)
#define f(i,n)     for(int i=0;i<n;i++)
#define bf(i,n)    for(int i=n-1;i>=0;i--)
#define f1(i,n)    for(int i=1;i<=n;i++)
#define bf1(i,n)   for(int i=n;i>=1;i--)

#define all(v)      v.begin(),v.end()
#define pll         pair<long,long>
#define pii         pair<int,int>
#define vi          vector<int>
#define vll          vector<ll>

#define p0(a)       cout << a << " "
#define p1(a)       cout << a << bn
#define p2(a, b)    cout << a << " " << b << bn
#define p3(a, b, c) cout << a << " " << b << " " << c << bn
#define p4(a,b,c,d) cout << a << " " << b << " " << c << " " << d << bn
#define debug(x)    cerr << #x << " = " << x << endl;

#define max3(a,b,c) max(max(a,b),c)
#define min3(a,b,c) min(min(a,b),c)

#define bn          "\n"
#define pbn         cout<<"\n"

#define TRACE
#ifdef TRACE
    #define trace(...) __f(#__VA_ARGS__, __VA_ARGS__)
    template <typename Arg1>
    void __f(const char* name, Arg1&& arg1){
        cerr << name << " : " << arg1 << endl;
    }
    template <typename Arg1, typename... Args>
    void __f(const char* names, Arg1&& arg1, Args&&... args){
        const char* comma = strchr(names + 1, ',');
        cerr.write(names, comma - names) << " : " << arg1<<" | ";
        __f(comma+1, args...);
    }
#else
    #define trace(...) 1
#endif

ll modI(ll a,ll m);
ll gcd(ll a,ll b);
ll powM(ll x,ll y,ll m);

void py(int ok)
{
    if(ok==1){
        cout<<"YES"<<bn;
    }else{
        cout<<"NO"<<bn;
    }
}

void swap(ll& a,ll& b)
{
    ll tp=a;
    a=b;
    b=tp;
}

ll gcd(ll x,ll y)
{
    if(x==0) return y;
    return gcd(y%x,x);
}

ll lcm(ll x, ll y)
{
    if(x==0 || y==0){
        cout<<"Not valid lcm"<<bn;
    }

    ll LCM= x/gcd(x,y);
    LCM=LCM*y;

    return LCM;
}

ll powM(ll x,ll y,ll m)
{
    ll ans=1,r=1;
    x%=m;
    while(r>0&&r<=y)
    {
        if(r&y)
        {
            ans*=x;
            ans%=m;
        }
        r<<=1;
        x*=x;
        x%=m;
    }
    return ans;
}

ll modI(ll a, ll m)
{
    ll m0=m,y=0,x=1;
    if(m==1) return 0;
    while(a>1)
    {
        ll q=a/m;
        ll t=m;
        m=a%m;
        a=t;
        t=y;
        y=x-q*y;
        x=t;
    }
    if(x<0) x+=m0;
    return x;
}

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

int main()
{

	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	cout.tie(0);
	int tt=1;
    // cin>>tt;
   f1(testcase_no,tt)
   {
       //   cout<<"test case no. "<<testcase_no<<bn;

      ll n;
      cin>>n;

      bool vis[10001]={0};
      vector<int>v;
      v.pb(6);
      v.pb(15);
      v.pb(10);
    //   int cnt=3;
      vis[6]=1;
      vis[10]=1;
      vis[15]=1;

      for(int i=1;i<10001;i++)
      {
          if(v.size()==n)break;

          if(vis[i])continue;
          if(i%6==0)v.pb(i);
          else if(i%10==0)v.pb(i);
          else if(i%15==0)v.pb(i);
          vis[i]=1;

          if(v.size()==n)break;
      }

    //   cout<<v.size()<<bn;

     for(auto it:v)p0(it);
     pbn;

        // cout << fixed << setprecision(25);

   }

	return 0;
}

#pragma GCC optimize("Ofast,inline,unroll-loops,fast-math")
#pragma GCC optimize("O3")
#include<bits/stdc++.h>
#define mod 1000000007
#define mod1 998244353
#define INF LLONG_MAX
#define NINF LLONG_MIN
#define inf 1e18
#define all(v) v.begin(),v.end()
#define T ll test;cin>>test; while(test--)
#define rep(i,a,n) for(ll i=a;i<(long long)n;++i)
#define rep1(i,a,n) for(ll i=a;i<=(long long)n;++i)
#define repi(i,a,n) for(int i=a;i<=(int)n;++i)
#define repl(i,a,n) for(int i=a;i<(int)n;++i)
#define PI 3.141592653589793238510
#define en '\n'
#define MAX 100005
#define lesser_time ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define debug cout<<"HERE"<<en;
#define setbits(x)  __builtin_popcountll(x)
#define zrobits(x)  __builtin_ctzll(x)
#define ps(x,y) fixed<<setprecision(y)<<x
#define mk(arr,n,type) type *arr=new type[n];
#define F first
#define S second
#define LB lower_bound
#define UB upper_bound
#define vc vector
#define vi vc<int>
#define mii unordered_map<int,int>
#define pql priority_queue<int>
#define pqs priority_queue<int,vi,greater<int>>
#define vll vector<long long>
#define pll pair<long long,long long>
#define pl pair<int,int>
#define eb emplace_back
#define pb push_back
#define mp make_pair
typedef long long ll;
typedef long double ld;
using namespace std;
using namespace std::chrono;
ll mod_exp(ll x,ll n){ll res=1;while(n>0){if(n&1)res=(res*x)%mod;x=(x*x)%mod;n>>=1;}return res;}
void inout(){freopen("in.txt","r",stdin);freopen("out.txt","w",stdout);}

int main(){
  lesser_time;
  int a,b,c,d;
  cin>>a>>b>>c>>d;
  cout<<b-c;
return 0;
}


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

#define INF (int)2e9
#define mod 1000000007
#define PI 3.141592653589793238
#define all(a) (a).begin(),(a).end()
#define rep(i,a,b) for(int i=a; i<b; ++i)

typedef long long ll;
typedef vector<int> vi;
typedef vector<vector<int>> vvi;
typedef pair<int, int> pi;
typedef vector<pi> vpi;

void solve(){

	int n;
	cin>>n;

	vector<int> a(n);
	rep(i,0,n){
		cin>>a[i];
	}

	n=min(n,8);
	vector<int> req(200, -1);

	rep(i,1,1<<n){
		ll r1=0;
		rep(j,0,n){
			if(i&(1<<j)){
				r1+=a[j];
			}
		}
		r1=r1%200;
		if(req[r1]!=-1){
			cout<<"YES\n";
			vector<int> s1, s2;
			rep(j,0,n){
				if(i&(1<<j)){
					s1.push_back(j+1);
				}
			}
			rep(j,0,n){
				if(req[r1]&(1<<j)){
					s2.push_back(j+1);
				}
			}
			cout<<s1.size()<<" ";
			for(int i: s1) cout<<i<<" ";
			cout<<'\n';
			cout<<s2.size()<<" ";
			for(int i: s2) cout<<i<<" ";
			cout<<'\n';
			return;
		}
		req[r1]=i;

	}

	cout<<"NO";

}

int main(){

	// 	freopen("input.txt", "r", stdin);
	// 	freopen("output.txt", "w", stdout);

	ios::sync_with_stdio(0);
	cin.tie(0);
	cout.precision(10);
	int ts=1;
	//cin>>ts;
	for(int i=1; i<=ts; ++i){
		// cout<<"Case #"<<i<<": ";
		solve();
		// cout<<'\n';
	}
	return 0;

}

#include<bits/stdc++.h>
using namespace std;
#define ll long long int
#define pb push_back
const long double pi = acos(-1);

// g++ -std=c++17 -Wshadow -Wall -g -fsanitize=address -fsanitize=undefined -D_GLIBCXX_DEBUG -o

const int nax=205;
int dp[nax][nax][nax];
int n;
vector<int>a;
const int mod=200;
string ans1,ans2,base;
int solve(int i,int j,int diff,string s1,string s2){
 if(diff==0 && s1!=s2 && s1!=base && s2!=base){
//   cout<<i<<" "<<j<<"\n";
  ans1=s1,ans2=s2;
  return 1;
 }
 if(i==n || j==n)return 0;
 if(dp[i][j][diff]!=-1)return dp[i][j][diff];
 string t1=s1,t2=s2;
 t1[i]='1';
 t2[j]='1';
 dp[i][j][diff]=solve(i+1,j+1,(diff+a[i])%mod,t1,s2)|solve(i+1,j+1,((diff-a[j])%mod+mod)%mod,s1,t2);
 dp[i][j][diff]|=solve(i+1,j+1,diff,s1,s2)|solve(i+1,j+1,((diff+a[i]-a[j])%mod+mod)%mod,t1,t2);
 return dp[i][j][diff];
}

int main(){
 ios_base::sync_with_stdio(false);
 cin.tie(NULL);
 cin>>n;
 a.assign(n,0);
 memset(dp,-1,sizeof(dp));
 for(int i=0;i<n;i++){
  cin>>a[i];
  a[i]%=200;
 }
 string s1(n,'0');
 string s2(n,'0');
 base=string(n,'0');
 if(solve(0,0,0,s1,s2)){
  cout<<"Yes\n";
  vector<int>v1,v2;
  for(int i=0;i<n;i++){
   if(ans1[i]=='1')v1.pb(i);
  }
  for(int i=0;i<n;i++){
   if(ans2[i]=='1')v2.pb(i);
  }
  cout<<v1.size()<<" ";
  for(auto x:v1)cout<<x+1<<" ";
  cout<<"\n";
  cout<<v2.size()<<" ";
  for(auto x:v2)cout<<x+1<<" ";
  cout<<"\n";
 }
 else{
  cout<<"No\n";
 }
//  for(int i=0;i<40;i++){
//   for(int j=0;j<40;j++){
//    cout<<dp[i][j][diff]<<" ";
//   }
//   cout<<"\n";
//  }
 return 0;
}

// ALWAYS TAKE INITITAL MIN AS 2E18 AND INITITAL MAX AS -2E18
// ALWAYS TAKE INITIAL MAX AS 2E18 AND INITIAL MIN AS -2E18
// TAKE ALL INT VARIABLES AS LONG LONG INT
// READ WHEN WRITING BINARY SEARCH -
//    take care of the left and right limits while writing code for binary search -
//    l should be lower than min. possible ans, and r should be higher than max. possible ans
//    (MAX. POSSIBLE ANS CAN BE MORE THAN 1e18!!)


#include <iostream>
#include <string>
#include <vector>
#include <list>
#include <map>
#include <queue>
#include <stack>
#include <algorithm>
#include <fstream>
#include <sstream>
#include <iomanip>
#define ll long long

using namespace std;

long long MOD = 1000000007;

int main(){
    ll N;
    cin >> N;

    vector<ll> A(N);
    vector<ll> B(N);
    for(auto &a:A){
        cin >> a;
    }
    for(auto &b:B){
        cin >> b;
    }

    ll prd=0;
    for(int i=0; i<N; i++){
        prd+=A[i]*B[i];
    }

    if(prd==0){
        cout << "Yes" << endl;
    }else{
        cout << "No" << endl;
    }
}

#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define rep(i,n) for(ll i=0,endrep=(n); i<endrep; ++i)
#define rep1(i,n) for(ll i=1,endrep=(n); i<=endrep; ++i)
#define revrep(i,n) for(ll i=(n)-1; i>=0; --i)
inline constexpr ll Inf = (1ULL << 62) -1;
#define fastio cin.tie(nullptr); ios_base::sync_with_stdio(false);
#define newl '\n'
#define YN(e) ((e)?"Yes":"No")
#define all(a) begin(a),end(a)
#define rall(a) rbegin(a),rend(a)
template <class T,class U> bool updmax(T& a, U b) { if(b>a){ a=b; return true;} return false;}
template <class T,class U> bool updmin(T& a, U b) { if(b<a){ a=b; return true;} return false;}
inline constexpr int Mod = 1000000007;
//inline constexpr int Mod = 998244353;
#define dbg(a) cout << #a << ": " << a << endl;
#define dbg1(a,n) cout<<#a<<": "; rep(i,n) cout<<a[i]<<" "; cout<<endl;
#define dbg2(m,h,w) cout<<#m<<":"<<endl; rep(i,h){ rep(j,w)cout<<m[i][j]<<" "; cout<<endl; }

int main() {
    fastio;
    ll ans=0;
    ll N;
    cin >> N;
    vector<ll> a(N),b(N);
    rep(i,N) cin >> a[i];
    rep(i,N) cin >> b[i];
    rep(i,N) {
        ans += a[i]*b[i];
    }
    cout << YN(ans == 0) << endl;
}


#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; (i) < (int)(n); ++ (i))
#define rep3(i, m, n) for (int i = (m); (i) < (int)(n); ++ (i))
#define repr(i, n) for (int i = (int)(n) - 1; (i) >= 0; -- (i))
#define rep3r(i, m, n) for (int i = (int)(n) - 1; (i) >= (int)(m); -- (i))
#define ALL(x) std::begin(x), std::end(x)
using namespace std;

int ans = 0;
using ll = long long;
set<ll> visits;
map<int, vector<int>> lines;
ll xy2id(int x, int y) {return (ll)y*1001001001+x; }

void dfs(int sx, int sy) {
    ll id = xy2id(sx,sy);
    if (visits.find(id) != visits.end()) return;
    visits.insert(id);
    vector<int> &line = lines[sy];
    int wall = 2001001001;
    if (line[line.size()-1] == sx) ++ans;
    else {
        auto pos = upper_bound(ALL(line), sx);
        // cerr << "[lines]" << endl;
        // for (int v: line) { cerr << v << endl;}
        int idx = distance(line.begin(), pos);
        if (idx < line.size()) {
            wall = line[idx];
        }
        // cerr << "[w]" << sx << " " << sy << " " << wall << endl;
    }
    for (int y : {sy-1, sy+1}) {
        vector<int> &nline = lines[y];
        if (nline.size() == 0)  continue;
        auto pos = upper_bound(ALL(nline), sx);
        int idx = distance(nline.begin(), pos);
        if (idx >= nline.size()) continue;
        rep3(i, idx, nline.size()) {
            int nx = nline[i];
            // cerr << sx << " " << sy << " " << nx << " " << y << " " << i << endl;
            if (nx > wall) break;
            dfs(nx, y);
        }
    }

}

int main() {
    int n, m; cin >> n >> m;
    lines[n].push_back(0);
    // char grid[2*n+1][2*n+1];
    // rep(i,2*n+1) {
    //     rep(j,2*n+1) {
    //         grid[j][i] = '.';
    //     }
    // }
    // grid[n][0] = 'o';
    rep(i,m) {
        int x, y; cin >> x >> y;
        lines[y].push_back(x);
        // grid[y][x] = 'x';
    }
    // rep(i,2*n+1) {
    //     rep(j,2*n+1) {
    //         cerr << grid[i][j];
    //     }
    //     cerr << endl;
    // }
    for (auto &it: lines) {
        sort(ALL(it.second));
    }
    // for (auto it: lines) {
    //     cerr << it.first << ":";
    //     for (int v: it.second) cerr << v << " ";
    //     cerr << endl;
    // }
    dfs(0, n);
    cout << ans << endl;

    return 0;
}

#include<bits/stdc++.h>
using namespace std;
typedef long long LL;
set<string> Set;
LL getMin(string s){
    sort(s.begin(), s.end());
    LL ans = 0;
    for(int i = 0;i<s.size();++i)
    {
        ans = ans *10+s[i]-'0';

    }
    return ans;
}
LL getMax(string s){
    sort(s.begin(), s.end(), greater<LL>());
    LL ans = 0;
    for(int i = 0;i<s.size();++i)
    {
        ans = ans *10+s[i]-'0';

    }
    return ans;
}
string getString(LL d){
    string s="";
    if(d==0)
    {
        return "0";
    }
    while(d){
        s += d%10+'0';
        d/=10;
    }
    reverse(s.begin(),s.end());
    return s;
}
int main() {
    string s;
    LL d;
    cin >> d;
    s = getString(d);
    int n;
    cin >> n;

    LL b=d, a=0;
    while(n--){
         a = getMin(s);
         b = getMax(s);
        s = getString(b-a);
        //cout << a << " " << b << " " << s  << "\n";

    }
    cout <<s << "\n";
    return 0;
}


#include <bits/stdc++.h>
using namespace std;
#define all(c) c.begin(),c.end()
#define sz(x) int(x.size())
#define ar array
typedef long long ll ;
typedef vector<int> vi;
#define mod 1000000007
mt19937_64 rng(chrono::steady_clock::now().time_since_epoch().count());
ll exp(ll x,ll y){
  x%=mod;
  ll res=1;
  while(y){
    if(y&1)
    res=res*x%mod;
    x=x*x%mod;
    y>>=1;
  }
  return res;
}
ll fact(ll n){
  ll res=1;
  for(ll i=2;i<=n;i=i+1)
  (res*=i)%=mod;
  return res;
}
bool isprime(ll n){
  if(n<=1) return 0;
  for(ll i=2;i*i<=n;++i)
  if(n%i==0) return 0;
  return 1;
}

int main() {
//freopen("input.txt","r",stdin);
//freopen("output.txt","w",stdout);
ios_base::sync_with_stdio(false);
cin.tie(0); cout.tie(0);
int n; cin>>n;
n=(int)(1.08*double(n));
if(n<206) cout<<"Yay!";
else if(n==206) cout<<"so-so";
else cout<<":(";
return 0;
}

#include<bits/stdc++.h>
#define ll long long
#define re register
#define INF 2147483647
using namespace std;

inline int read()
{
	int f=1,x=0;char s=getchar();
	while(s<'0'||s>'9')
	{
		if(s=='-') f=-1;
		s=getchar();
	}
	while(s>='0'&&s<='9')
	{
		x=x*10+s-48;
		s=getchar();
	}
	return f*x;
}

const int p=1e9+7;
const int N=4e6+5;
inline int sub(int a,int b)
{
	return a-b<0?a-b+p:a-b;
}

inline int ksm(int a,int b)
{
	int ans=1;
	for(;b;b>>=1,a=1ll*a*a%p)
		if(b&1) ans=1ll*ans*a%p;
	return ans;
}

int fac[N],inv[N];
inline int C(int n,int m)
{
	if(n<m) return 0;
	return 1ll*fac[n]*inv[m]%p*inv[n-m]%p;
}

int main()
{
	int n=read(),m=read(),k=read()+1;
	if(n-m>=k)
	{
		puts("0");
		return 0;
	}
	fac[0]=inv[0]=1;
	for(int i=1;i<=4000000;i++) fac[i]=1ll*fac[i-1]*i%p;
	inv[4000000]=ksm(fac[4000000],p-2);
	for(int i=4000000-1;i>=1;i--) inv[i]=1ll*inv[i+1]*(i+1)%p;
//	cout<<C(n+m,n)<<endl;
	printf("%d\n",sub(C(n+m,n),C(n+m,n-k)));
	return 0;
}


#include<bits/stdc++.h>
using namespace std;
#define _rep(i, x, y) for(int i = (int)x; i < (int)y; ++i)
#define _dep(i,x,y) for(int i = (int)x; i > (int)y; i--)
#define PII pair<int,int>
#define eb emplace_back
#define pb push_back
#define fi first
#define se second
#define PQ priority_queue
#define lb lower_bound
#define ub upper_bound
#define all(x) (x).begin(), (x).end()
typedef long long ll;
typedef vector<int> VI;
typedef vector<VI> VII;
typedef vector<ll> VL;
typedef vector<vector<ll>> VLL;
constexpr int mod = 1e9 + 7;
constexpr int KINF = 0x3f3f3f3f;
constexpr double eps = 1e-7;
int main(){
	ios::sync_with_stdio(false); cin.tie(0);
	ll A, B;
	cin >> A >> B;
	// gcd(x, y) = gcd(x - y, y) <= x - y <= B - A <= 72   (x > y)
	// 所以A到B之间任意两个数的最大公因子必然是小于等于72的质数的倍数
	// 于是问题就可以转化为存在共同公因子的数不超过两个便是合法,20的范围用状压DP即可解决
	int p[20] = {2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71};
	VI dp(1 << 20);
	dp[0] = 1;
	for(ll x = A; x <= B; x ++){
		int mask = 0;
		_rep(i, 0, 20)
			if(x % p[i] == 0) mask |= (1 << i);// 求出x所含的质因子
		_rep(j, 0, (1 << 20)){
			if(j & mask) continue;// 存在某一位相同(即之前的数与当前数有共同公因子)
			dp[j | mask] += dp[j];
		}
	}
	cout << accumulate(all(dp), 0) << endl;
	return 0;
}
// 小心左移运算符导致的int溢出
// dp记得处理非法状态
// resize并不会初始化数组
// 全局函数一定要记得inline
// 带空格字符串不能直接cin,要用getline

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

int main(){
    int n, k;
    cin >> n >> k;
    long t[n][n];   //t[0]= city1
    for(int i=0; i<n; i++){
        for(int j=0; j<n; j++){
            cin >> t[i][j];
        }
    }
    int p[n];   //p[0] = city 1
    for(int i=0; i<n; i++){
        p[i]=i;
    }
    long long ans=0, ret;
    int i;
    do{
        ret=0;
        for(i=0; i<n-1; i++){
            ret += t[p[i]][p[i+1]];
        }
        //last to city1
        ret += t[p[i]][0];
        if(ret==k) ans++;
    }while(next_permutation(p+1, p+n));
    cout << ans;
    return 0;
}


#include<bits/stdc++.h>
#define ll long long
#define inf 0x3f3f3f3f
using namespace std;
const ll mod = 1e9+7;
const int maxn = 2005;
char s[2005][2005];
ll qpow(ll a,ll b){
	ll res=1ll;
	while(b){
		if(b&1)res=res*a%mod;
		a=a*a%mod;
		b>>=1;
	}
	return res;
}
int n,m;
ll c[maxn],l[maxn],nn[maxn][maxn];
int main() {
	for(int i=0;i<maxn;i++)
        for(int j=0;j<maxn;j++)
        s[i][j]='#';
	ll p = 0;
	scanf("%d%d",&n,&m);
	for(int i=1;i<=n;i++){
		scanf("%s",s[i]+1);
		for(int j=1;j<=m;j++){
			if(s[i][j]=='.')p++;
		}
	}
	memset(nn,0,sizeof(nn));
	for(int i=1;i<=n;i++){
		for(int j=0;j<=m+1;j++)c[j]=0;
		for(int j=1;j<=m;j++){
			if(s[i][j]=='.'){
				c[j]=c[j-1]+1;;
			}else{
				c[j]=0;
			}
		}
		for(int j=m;j>0;j--){
			if(c[j]!=0){
				c[j]=max(c[j],c[j+1]);
			}
		}
		for(int j=1;j<=m;j++){
			nn[i][j]=c[j];
		}
	}
	for(int i=1;i<=m;i++){
		for(int j=0;j<=n+1;j++)c[j]=0;
		for(int j=1;j<=n;j++){
			if(s[j][i]=='.'){
				c[j]=c[j-1]+1;;
			}else{
				c[j]=0;
			}
		}
		for(int j=n;j>0;j--){
			if(c[j]!=0){
				c[j]=max(c[j],c[j+1]);
			}
		}
		for(int j=1;j<=n;j++){
			nn[j][i]+=c[j];
		}
	}
	for(int i=1;i<=n;i++){
		for(int j=1;j<=m;j++){
			if(nn[i][j]!=0){
				nn[i][j]--;
			}
		}
	}
	ll ans = 0;
	for(int i=1;i<=n;i++){
		for(int j=1;j<=m;j++){
			if(s[i][j]=='.'){
				ll k=nn[i][j];
				ll tmp = ((qpow(2ll,k)-1ll+mod)%mod)*(qpow(2ll,p-k))%mod;
				ans=(ans+tmp)%mod;
			}
		}
	}
	printf("%lld",ans);
	return 0;
}

#include <bits/stdc++.h>

using namespace std;
using ll = long long;
#define pb push_back
#define F first
#define S second
int d[200005];
int sz[200005];
int fi(int x) {
    if (d[x] == x) {
        return x;
    }
    else {
        return d[x] = fi(d[x]);
    }
    //return d[x] == x ? x : d[x] = fi(d[x]);
}
int main()
{
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    int n;
    cin >> n;
    int a[n+5];
    for (int i = 1 ; i <= n ; i++) {
        cin >> a[i];
    }
    for (int i = 1 ; i <= 200000 ; i++) {
        d[i] = i;
        sz[i] = 1;
    }
    for (int i = 1 ; i <= n / 2 ; i++) {
        if (a[i] != a[n+1-i]) {
            int x = fi(a[i]);
            int y = fi(a[n+1-i]);
            if (x != y) {
                sz[y] += sz[x];
                d[x] = y;
            }
        }
    }
    int ans = 0;
    for (int i = 1 ; i <= 200000 ; i++) {
        if (d[i] == i) {
            ans += sz[i] - 1;
        }
    }
    cout << ans << '\n';
}


//#include "bits/stdc++.h"

#include <iostream>
#include <vector>
// #include <map>
// #include <string>
#include <algorithm>
// #include <numeric>
// #include <limits>

using namespace std;

int main() {
    int n;
    long k = 1;
    long res = 1000000000 + 7;
    cin >> n;
    vector<int> a(n);
    for (int i = 0; i < n; i++) {
        cin >> a[i];
    }
    sort(a.begin(), a.end());
    for (auto it = a.rbegin(); it != a.rend(); ++it) {
        if (it == a.rend() -1) {
            k = (k * (*(it) + 1)) % res;
        } else {
            k = (k * (*(it) - *(it+1) + 1)) % res;
        }
    }

    //cout << k << endl;
    cout << k << endl;
    // std::cout << "\e[38;5;0m\e[48;5;40m --- end ---  \e[m" << std::endl; // debug
    return 0;
}

#include <bits/stdc++.h>

#define task "B"
#define all(v) (v).begin(), (v).end()
#define rep(i, l, r) for (int i = (l); i < (r); ++i)
#define FOR(i, l, r) for (int i = (l); i <= (r); ++i)
#define FORD(i, r, l) for (int i = (r); i >= (l); --i)
#define DB(X) { cerr << #X << " = " << (X) << '\n'; }
#define DB1(A, _) { cerr << #A << "[" << _ << "] = " << (A[_]) << '\n'; }
#define DB2(A, _, __) { cerr << #A << "[" << _ << "][" << __ << "] = " << (A[_][__]) << '\n'; }
#define DB3(A, _, __, ___) { cerr << #A << "[" << _ << "][" << __ << "][" << ___ << "] = " << (A[_][__][___]) << '\n'; }
#define PR(A, l, r) { cerr << '\n'; FOR(_, l, r) DB1(A, _); cerr << '\n';}
#define sz(x) ((int)(x).size())
#define pb push_back
#define eb emplace_back
#define pf push_front
#define F first
#define S second
#define next ___next
#define prev ___prev
#define y1 ___y1
#define left ___left
#define right ___right
#define y0 ___y0
#define div ___div
#define j0 ___j0

using ll = long long;
using ld = long double;
using ull = unsigned long long;
using namespace std;
typedef pair<int, int> ii;
typedef pair<int, ii> iii;
typedef vector<int> vi;
typedef vector<ii> vii;
typedef vector<iii> viii;
typedef vector<ll> vl;
const int N = 1e5 + 2, mod = 1e9 + 7;
int n, a[N];

int main()
{
#ifdef HynDuf
    freopen(task".in", "r", stdin);
    //freopen(task".out", "w", stdout);
#else
    ios_base::sync_with_stdio(false); cin.tie(nullptr);
#endif
    cin >> n;
    FOR(i, 1, n) cin >> a[i];
    sort(a + 1, a + 1 + n);
    int ans = a[1] + 1;
    FOR(i, 2, n) ans = ans * 1LL * (a[i] - a[i - 1] + 1) % mod;
    cout << ans;
    return 0;
}


#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define fi first
#define se second
#define rep(i,n) for(int i=0;i<n;i++)
#define all(v) v.begin(),v.end()
#define pb push_back
#define eb emplace_back
template<class T>void chmax(T &a,T b){if(a<b)a=b;}
template<class T>void chmin(T &a,T b){if(a>b)a=b;}
constexpr int INF=1000000000;
constexpr ll llINF=1000000000000000000;
constexpr int mod=1000000007;
constexpr double eps=1e-8;
const double pi=acos(-1);
int dx[]={0,1,0,-1},dy[]={1,0,-1,0};
int Random(int mi,int ma){
    random_device rnd;
    mt19937 mt(rnd());//32bit
    //[mi,ma]
    uniform_int_distribution<int>engine(mi,ma);
    return engine(mt);
}
ll gcd(ll a,ll b){
    if(b==0)return a;
    return gcd(b,a%b);
}
ll lcm(ll a,ll b){
    return a/gcd(a,b)*b;
}
bool prime(int a){
    if(a==1)return false;
    for(int i=2;i*i<=a;i++){
        if(a%i==0)return false;
    }
    return true;
}
ll modpow(ll a,ll b){
    if(b==0)return 1;
    if(b%2)return modpow(a,b-1)*a%mod;
    ll memo=modpow(a,b/2);
    return memo*memo%mod;
}
vector<ll>kaijo,invkaijo;
void init_fact(int n){
    kaijo.resize(n+1);
    invkaijo.resize(n+1);
    kaijo[0]=1;
    for(ll i=1;i<=n;i++){
        kaijo[i]=kaijo[i-1]*i;
        kaijo[i]%=mod;
    }
    rep(i,n+1)invkaijo[i]=modpow(kaijo[i],mod-2);
}
/*
vector<vector<ll>>C,sC;
void init_comb(int n,int m){
    C.resize(n+1,vector<ll>(m+1,0));
    sC.resize(n+1,vector<ll>(m+1,0));
    C[0][0]=1;
    for(int i=1;i<=n;i++){
        C[i][0]=1;
        for(int j=1;j<=m;j++){
            C[i][j]=(C[i-1][j-1]+C[i-1][j])%mod;
        }
    }
    rep(i,n+1){
        rep(j,m){
            sC[i][j+1]=(sC[i][j]+C[i][j])%mod;
        }
    }
}*/
ll comb(int a,int b){
    if(a<b)return 0;
    if(a<0)return 0;
    return kaijo[a]*invkaijo[a-b]%mod*invkaijo[b]%mod;
}
ll inv(ll x){
    x=modpow(x,mod-2);
    return x;
}
bool check(int n,int b){
    while(n){
        if(n%b==7)return false;
        n/=b;
    }
    return true;
}
int main(){
    int n;
    cin>>n;
    int ans=0;
    for(int i=1;i<=n;i++){
        if(check(i,8)&&check(i,10))ans++;
    }
    cout<<ans<<endl;
    return 0;
}

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

int main(int argc, char* argv[]) {

    int N;
    cin >> N;

    int count=0;

    std::string s, ds;
    bool found;
    for(int i=1; i<=N; i++) {
        std::stringstream ss, dss;
        found = false;
        ss << std::oct << i;
        s = ss.str();
        dss << std::dec << i;
        ds = dss.str();

       // cout << " s8  = " << s << endl;
        for(int k=0; k<s.length(); k++) {
            if(s[k] == '7') {
        //        cout << " found" << endl;
                count++;
                found = true;
                break;
            }
        }

        if(!found) {
         //   cout << " s10 = " << ds << endl;
            for(int k=0; k<ds.length(); k++) {
                if(ds[k] == '7') {
          //          cout << " found" << endl;
                    count++;
                    break;
                }
            }
        }

    }

    // cout << "result :" ;
    cout << N - count;

    return 0;
}


#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;
#define ll long long
#define IOS ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0)
#define MOD 1000000007
#define MOD2 1000000009
#define MOD3 998244353
#define endl "\n"
#define pii pair <int, int>
#define pll pair <ll, ll>
#define plllll pair <ll, pair<ll, pair<ll, pair<ll, ll>>>>
#define vii std::vector<int>
#define vll std::vector<ll>
#define F first
#define S second
#define ordered_set tree<int, null_type,less<int>, rb_tree_tag,tree_order_statistics_node_update>

int main()
{
    IOS;
        #ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
        #endif

    // int t;
    // cin >> t;
    // while(t--) {

    // }
    int n;
    cin >> n;
    std::vector<int> a(n), b(n);
    for(int i = 0; i < n; i++) {
        cin >> a[i];
    }
    for(int i = 0; i < n; i++) {
        cin >> b[i];
    }
    int ans = 0;
    for(int i = 1; i <= 1000; i++) {
        int ok = 1;
        for(int j = 0; j < n; j++) {
            if(i >= a[j] && i <= b[j]) {
                ok = 1;
            }
            else {
                ok = 0;
                break;
            }
        }
        if(ok)
            ans++;
    }
    cout << ans;

return 0;
}

#include<bits/stdc++.h>
using namespace std;
#define int          	long long int
#define pb           	push_back
#define mp           	make_pair
#define all(x)       	x.begin(),x.end()
#define rep(i,a,b)   	for(int i=a;i<b;i++)
#define mem1(a)      	memset (a,-1,sizeof(a))
#define mem0(a)      	memset (a,0,sizeof(a))
#define sz(x)        	(int)((x).size())
#define rr           	return 0
#define f            	first
#define s            	second
#define pii          	pair<int,int>
#define endl         	"\n"
#define bigprime     	1000000007
#define gcd(a,b)        __gcd((a),(b))
#define lcm(a,b)        (a/gcd(a,b))*b
#define scanvec(a,n)      rep(i,0,n){cin>>a[i];}
#define printvec(a,n)     rep(i,0,n){cout<<a[i]<<" ";}

//bool ispalindrome(string s){string str = s;reverse(str.begin(),str.end());return(s==str);}
//bool isPrime(int N){for(int i=2;i*i<=N;++i){if(N%i==0) return false;}return true;}
//bool isvowel(char x){ ret//longest common subsequence using memoization over recursion
//int fastexpo(int a, int b, int mod) {int res = 1; while (b > 0) {if (b & 1)res = (res * a) % mod; a = (a * a) % mod; b = b >> 1;} return res;}

void dothis(){
	int n;cin>>n;
	std::vector<int> a(n);
	scanvec(a,n);
	std::vector<int> b(n);
	scanvec(b,n);
	int y = *min_element(all(b));
	int x = *max_element(all(a));
	int zero = 0;
	cout<<max(zero,y-x+1);
}

signed main(){
	ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    //int t;cin>>t;while(t--){dothis();}
    dothis();
	rr;
}


#include <algorithm>
#include <iostream>
#include <map>

using namespace std;

const int kMaxN = 2e5 + 1;

struct E {
  int x, y, v;
  bool operator<(const E &_e) const {
    return x < _e.x;
  }
} e[kMaxN];
map<int, int> v;
int n, m, ans;

int main() {
  cin >> n >> m;
  for (int i = 1; i <= m; i++) {
    cin >> e[i].x >> e[i].y;
  }
  sort(e + 1, e + 1 + m);
  v[n] = 1;
  for (int i = 1, j = 1; i <= m; i = j) {
    for (; e[i].x == e[j].x; j++) {
    }
    for (int k = i; k < j; k++) {
      e[k].v = v[e[k].y - 1] || v[e[k].y + 1];
    }
    for (int k = i; k < j; k++) {
      v[e[k].y] = e[k].v;
    }
  }
  for (auto i = v.begin(); i != v.end(); i++) {
    ans += i->second;
  }
  cout << ans;
  return 0;
}

#include<iostream>
#include<map>
#include<vector>
#include<algorithm>
#include<set>
#include<queue>
#include<stack>
#include<math.h>
#include<time.h>
#include<deque>
#include<cstring>
#define ll long long
#define FOR(i,a,b) for(ll i=a;i<b;i++)
#define pb push_back
#define F first
#define S second
#define mp make_pair
#define pf push_front
#define MOD (ll)(1e9+7)
#define INF (ll)(1e18)
#define M 5000005
#define endl "\n"
#define AC ios::sync_with_stdio(0);cin.tie(0);
using namespace std;
void solve(){

}
map<ll,vector<ll> > black;
map<ll,bool> ex;
signed main(){
    AC;
    ll n,m;
    cin>>n>>m;
    FOR(i,0,m){
        ll x,y;
        cin>>x>>y;
        black[x].pb(y);
    }
    ex[n]=1;
    for(auto[a,b]:black){
        map<ll,bool> tmp,result;
        for(auto i:b){
            if(ex.find(i)!=ex.end()){
                tmp[i]=1;
                ex.erase(ex.find(i));
            }
        }
        //cout<<endl;
        for(auto i:b){
            if(tmp.find(i+1)!=tmp.end()) result[i]=1;
            if(tmp.find(i-1)!=tmp.end()) result[i]=1;
            if(ex.find(i+1)!=ex.end()) result[i]=1;
            if(ex.find(i-1)!=ex.end()) result[i]=1;
        }
        for(auto i:result) ex[i.F]=1;
        //cout<<"ex= ";
        //for(auto i:ex) cout<<i.F<<" ";
        //cout<<endl;
    }
    cout<<ex.size()<<endl;
}


#include<cmath>
#include<iostream>
#include<cstdio>
#include<cstdlib>
#include<algorithm>
#include<bitset>
#include<cstring>
#include<ctime>
#include<deque>
#include<iomanip>
#include<list>
#include<map>
#include<deque>
#include<queue>
#include<set>
#include<stack>
#include<vector>
#include<string>
#include<sstream>
#include<climits>
#include<chrono>
#include<random>
#include<unordered_set>
#include<unordered_map>
#include<ctype.h>
#include<cassert>
#include<numeric>
#include<functional>
using namespace std;
typedef long long ll; typedef unsigned long long ull; typedef long double ldb; typedef double db;typedef pair<ll, ll> pll; typedef pair<int, int> pii; typedef pair<ll, int> pli;
#define all(a) (a).begin(),(a).end()
#define rall(a) (a).rbegin(),(a).rend()
#define Debug cout<<"\nRight Here\n";
const double Pi = acos(-1.0); constexpr int inf = 1 << 29, Mod = 1e9 + 7, N = 1e5 + 3; constexpr ll INF = 1ll << 60;
ll qpow(ll a, ll b, ll mod = Mod, ll ans = 1) {
	for (; b; b >>= 1, a = (a * a + mod) % mod)if (b & 1)ans = (ans * a + mod) % mod;
	return ans;
}
ll gcd(ll a, ll b) { return (b ? gcd(b, a % b) : a); }; ll lcm(ll a, ll b) { return a * b / (gcd(a, b)); }
pii EXgcd(int x, int y) {        //return.first ny
	if (!y) { return { 1,0 }; }pii a = EXgcd(y, (x + y) % y);
	return { a.second, a.first - a.second * (x / y) };
}
inline bool Ezisprime(const int n) {
	if (n <= 1)return 0; if (n <= 3)return 1;
	vector<int> ezp{ 5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73,79,83,89,97 };
	for (int i = 0; i < ezp.size(); i++)if (n == ezp[i])return 1;
	for (int i = 2; i <= sqrt(n); i++)if (n % i == 0)return 0;
	return 1;
}
pll Fib(ll n) {
	if (n == 0) return { 0, 1 };
	auto p = Fib(n >> 1);
	ll c = p.first * ((p.second) << 1 - p.first), d = p.first * p.first + p.second * p.second;
	if (n & 1)return { d, c + d }; else return { c, d };
}
inline vector<ll> EuSieve(const ll& n) {
	vector<ll> prime; vector<bool>is_prime(n + 1, 1);
	for (ll i = 2; i <= n; ++i) {
		if (is_prime[i])prime.emplace_back(i);
		for (auto& p : prime) {
			if (i * p > n)break;
			is_prime[i * p] = 0;
			if (i % p == 0)break;
		}
	}
	return prime;
}
inline ll Digsum(ll n, ll ans = 0) {
	for (; n; n /= 10)ans += n % 10;
	return ans;
}
inline void modize(ll& n, const ll add, const ll mod = Mod) { n = ((n + add) % mod + mod) % mod; }
inline bool cmp(const pii a, const pii b) {  //default more and more larger
	return a.second < b.second;
}
//partial_sum(begin,end,place,minus<int>()) adjacent_differece(begin,end,place)
//count(begin(),end(),char=='x') count_if(begin(),end(),boolcmp) vector<int> p(n);iota(p.begin(), p.end(), 0);
//|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| Code follows ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||\\

int main()
{
	ios::sync_with_stdio(0); cin.tie(0), cout.tie(0);

	int n; cin >> n;
	vector<vector<ll>>a(n, vector<ll>(5));
	for (auto& i : a)for (auto& j : i)cin >> j;
	int l = 0, r = 1e9 + 1;
	auto check = [&](int x)->bool
	{
		set<int>s;
		for (auto i : a)
		{
			int bit = 0;
			for (auto j : i)
			{
				bit <<= 1;
				bit |= j >= x;
			}
			s.insert(bit);
		}
		for (auto i : s)for (auto j : s)for (auto k : s)if ((i | j | k) == 31)return 1;
		return 0;
	};
	while (r - l > 1)
	{
		int mid = (l + r) >> 1;
		(check(mid) ? l : r )= mid;
//		cout << "l= " << l << " r= " << r << '\n';
	}
	cout << l << '\n';

}
/*

*/

#include <bits/stdc++.h>
using namespace std;
//-(smallstar))---- :]

#define int long long
#define ll long long
#define ld long double
#define fastio                        \
    ios_base::sync_with_stdio(false); \
    cin.tie(NULL);                    \
    cout.tie(NULL)
#define fr(i, n) for (int i = 0, _##i = (n); i < _##i; ++i)
#define fd(i, n) for (int i = (n); --i >= 0;)
#define frr(i, l, r) for (int i = (l), _##i = (r); i < _##i; ++i)
#define fdd(i, l, r) for (int i = (r), _##i = (l); --i >= _##i;)
#define repi(i, a) for (__typeof((a).begin()) i = (a).begin(), _##i = (a).end(); i != _##i; ++i)
#define dwni(i, a) for (__typeof((a).rbegin()) i = (a).rbegin(), _##i = (a).rend(); i != _##i; ++i)
#define pi pair<ll, ll>
#define tii tuple<ll, ll, ll>
#define mp make_pair
#define mt make_tuple
#define fi first
#define se second
#define vi vector<ll>
#define vii vector<pi>
#define eb emplace_back
#define pb push_back
#define pf push_front
#define ppb pop_back
#define ppf pop_front
#define sz(a) (ll)((a).size())
#define filla(a, n, val)       \
    for (ll i = 0; i < n; i++) \
        a[i] = val;
#define all(o) (o).begin(), (o).end()
#define rall(o) (o).rbegin(), (o).rend()
#define bitcount __builtin_popcountll
#define nl cout << "\n"
#define ns cout << " "
#define o2(a, b) cout << a << " " << b
#define o(a) cout << a
#define ppr(a) cout << a.first << " " << a.second
#define debug(a)          \
    cerr << #a << ": ";   \
    for (auto i : a)      \
        cerr << i << " "; \
    cerr << '\n';
#define debugvi(a)                           \
    for (int idx = 0; idx < a.size(); idx++) \
    {                                        \
        cerr << #a << "[" << idx << "]: ";   \
        for (auto i : a[idx])                \
            cerr << i << " ";                \
        cerr << ' ';                         \
        cerr << '\n';                        \
    }
#define debugpp(a)                                         \
    cerr << #a << ": ";                                    \
    for (auto i : a)                                       \
        cerr << "(" << i.first << "," << i.second << ") "; \
    cerr << '\n';
#define EPSILON 1e-9

void takeInput(vi &a, int n)
{
    ll l;
    for (int i = 0; i < n; i++)
    {
        cin >> l;
        a.pb(l);
    }
}

const ll MOD = 1000000007;
const ll LIM = 200005;
const ll BITS = 31;
const ll inf = 1e16;
// vector<vector<int>> vec( n , vector<int> (m, 0));

void solve()
{
    int n;
    cin >> n;

    int ans = INT_MAX;
    vector<pair<int, int>> a;
    vector<pair<int, int>> b;
    while (n--)
    {
        int x, y;
        cin >> x >> y;
        a.push_back({x, n});
        b.pb({y, n});
    }
    sort(all(a));
    sort(all(b));
    int minn = INT_MAX;
    if (a[0].second != b[0].second)
    {
        cout << max(a[0].first, b[0].first);

        return;
    }
    else
    {
        minn = a[0].first + b[0].first;
        minn = min(minn, max(a[0].first, b[1].first));
        minn = min(minn, max(a[1].first, b[0].first));
    }
    cout << minn;
}

signed main()
{
    fastio;
    int t;
    t = 1;
    //  cin >> t;
    fr(i, t)
    {
        solve();
    }
}


#ifdef DBG_MACRO_NO_WARNING
#include <dbg.h>
#endif
#include <bits/stdc++.h>
#define all(c) begin(c), end(c)
#define isz(c) (int)(c).size()

using namespace std;
using ll = long long;
using ii = pair<int, int>;
using vi = vector<int>;

template <typename InputIterator,
          typename T = typename iterator_traits<InputIterator>::value_type>
void read_n(InputIterator it, int n)
{
    copy_n(istream_iterator<T>(cin), n, it);
}

template <typename InputIterator,
          typename T = typename iterator_traits<InputIterator>::value_type>
void write(InputIterator first, InputIterator last, const char *delim = "\n")
{
    copy(first, last, ostream_iterator<T>(cout, delim));
}

int main(void)
{
    ios::sync_with_stdio(false), cin.tie(NULL);
    int n, k;
    cin >> n >> k;

    vector<vi> t(n, vi(n));
    for (auto &ti : t)
        read_n(ti.begin(), n);

    vi a(n);
    for (int i = 0; i < n; ++i)
        a[i] = i;

    int ans = 0;
    do
    {
        int cur = 0;
        for (int i = 0; i < n; ++i)
            cur += t[a[i]][a[(i + 1) % n]];
        ans += cur == k;
    } while (next_permutation(a.begin() + 1, a.end()));

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

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

typedef long long ll;
typedef unsigned long long ull;
typedef double dd;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef pair<int,int> pii;

const int Mx=1e6+11;
const double pi = acos(-1);
#define MOD 1000000007

#define nl '\n'
#define pb push_back
#define F first
#define S second
#define I insert
#define mp make_pair

#define sz(x) x.size()
#define tt int t; cin>>t; while(t--)
#define be(a) (a).begin(),(a).end()
#define rbe(a) (a).rbegin(),(a).rend()
#define mem(a,b) memset(a,b,sizeof(a))
#define cill(x,y) (x+(y-1))/y
#define yes cout<<"YES\n"
#define no cout<<"NO\n"

#define op() ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define file freopen("input.txt","r",stdin);freopen("output.txt","w",stdout);
#define frac cout.unsetf(ios::floatfield); cout.precision(10); cout.setf(ios::fixed,ios::floatfield);

int main()
{
    op();

    ll k,cnt=0,sum;
    int n;

    cin>>n>>k;

    ll arr[n+1][n+1],per[n+1];

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

      per[i]=i;
    }

    do
    {
      sum=0;

      for(int i=2;i<=n;i++)
      {
        ///
        sum+=arr[per[i-1]][per[i]];
      }

      sum+=arr[per[n]][1];
      ///cout<<sum<<nl;
      if(sum==k)
        cnt++;

    }while(next_permutation(per+2,per+n+1));

    cout<<cnt<<nl;
    return 0;
}


#pragma GCC optimize("Ofast")
#define _USE_MATH_DEFINES
#include "bits/stdc++.h"

using namespace std;

using ll = int64_t;
using ld = long double;
using vi = vector<int>;
using vl = vector<ll>;
using vvi = vector<vector<int>>;
using pii = pair<int, int>;
using pll = pair<ll, ll>;
using vpii = vector<pii>;
using vpll = vector<pll>;

constexpr char newl = '\n';
constexpr double eps = 1e-10;

#define FOR(i,a,b) for (int i = (a); i < (b); i++)
#define F0R(i,b) FOR(i,0,b)
#define RFO(i,a,b) for (int i = ((b)-1); i >=(a); i--)
#define RF0(i,b) RFO(i,0,b)
#define show(x) cout << #x << " = " << x << '\n';
#define rng(a) a.begin(),a.end()
#define rrng(a) a.rbegin(),a.rend()
#define sz(x) (int)(x).size()
#define YesNo {cout<<"Yes";}else{cout<<"No";}
#define YESNO {cout<<"YES";}else{cout<<"NO";}
#define v(T) vector<T>
#define vv(T) vector<vector<T>>

template<typename T1, typename T2> inline void chmin(T1& a, T2 b) { if (a > b) a = b; }
template<typename T1, typename T2> inline void chmax(T1& a, T2 b) { if (a < b) a = b; }
template<class T> bool lcmp(const pair<T, T>& l, const pair<T, T>& r) {
  return l.first < r.first;
}
template<class T> istream& operator>>(istream& i, v(T)& v) {
  F0R(j, sz(v)) i >> v[j];
  return i;
}
template<class A, class B> istream& operator>>(istream& i, pair<A, B>& p) {
  return i >> p.first >> p.second;
}
template<class A, class B, class C> istream& operator>>(istream& i, tuple<A, B, C>& t) {
  return i >> get<0>(t) >> get<1>(t) >> get<2>(t);
}
template<class T> ostream& operator<<(ostream& o, const pair<T, T>& v) {
  o << "(" << v.first << "," << v.second << ")";
  return o;
}
template<class T> ostream& operator<<(ostream& o, const vector<T>& v) {
  F0R(i, v.size()) {
    o << v[i] << ' ';
  }
  o << newl;
  return o;
}
template<class T> ostream& operator<<(ostream& o, const set<T>& v) {
  for (auto e : v) {
    o << e << ' ';
  }
  o << newl;
  return o;
}
template<class T1, class T2> ostream& operator<<(ostream& o, const map<T1, T2>& m) {
  for (auto& p : m) {
    o << p.first << ": " << p.second << newl;
  }
  o << newl;
  return o;
}

#if 1

// INSERT ABOVE HERE
signed main() {
  cin.tie(0);
  ios_base::sync_with_stdio(false);

  int v, t, s, d; cin >> v >> t >> s >> d;
  if (d < v * t || v * s < d) YesNo;
}
#endif

#include<bits/stdc++.h>

using namespace std;

#define ff              first
#define ss              second
#define int             long long
#define pb              push_back
#define mp              make_pair
#define pii             pair<int,int>
#define vi              vector<int>
#define mii             map<int,int>
#define pqb             priority_queue<int>
#define pqs             priority_queue<int,vi,greater<int> >
#define setbits(x)      __builtin_popcountll(x)
#define zrobits(x)      __builtin_ctzll(x)
#define all(a)      (a).begin(),(a).end()

#define ps(x,y)         fixed<<setprecision(y)<<x
#define mk(arr,n,type)  type *arr=new type[n];
#define w(x)            int x; cin>>x; while(x--)
#define REP(i,n) for(i=0;i<n;i++)
#define FIO             ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0)
mt19937                 rng(chrono::steady_clock::now().time_since_epoch().count());
const long long   mod = 1e9 + 7;

void c_p_c()
{
#ifndef  ONLINE_JUDGE
	freopen("input.txt", "r", stdin);
	freopen("output.txt", "w", stdout);
#endif
}
bool f(int x, int y)
{
	return x > y;
}

void solve() {

	float x, y, z;
	cin >> x >> y >> z;

	float ans = y / x;
	//cout << ans << endl;
	int i;
	for (i = 1000000; i >= 0; i--)
	{
		float k = i / z;
		if (k < ans)
		{
			cout << i << endl;
			return;
		}
	}

}
int32_t main()
{

	c_p_c();

	FIO;

	int tt = 1;

	//w(t)
	solve();

}


#include <bits/stdc++.h>
#define _overload3(_1, _2, _3, name, ...) name
#define _rep(i, n) repi(i, 0, n)
#define repi(i, a, b) for (int i = (a); i < (b); ++i)
#define rep(...) _overload3(__VA_ARGS__, repi, _rep, )(__VA_ARGS__)
#define ALL(x) x.begin(), x.end()
#define chmax(x, y) x = max(x, y)
#define chmin(x, y) x = min(x, y)
using namespace std;
random_device rnd;
mt19937 mt(rnd());
using ll = long long;
using lld = long double;
using VI = vector<int>;
using VVI = vector<VI>;
using VL = vector<ll>;
using VVL = vector<VL>;
using PII = pair<int, int>;
const int IINF = 1 << 30;
const ll INF = 1ll << 60;
const ll MOD = 1000000007;

bool isUpper(char c)
{
    return 'A' <= c && c <= 'Z';
}

int main()
{
    string s;
    cin >> s;
    int ans = 0;
    rep(i, s.size() - 3)
    {
        if (s[i + 0] == 'Z' && s[i + 1] == 'O' && s[i + 2] == 'N' && s[i + 3] == 'e')
            ans++;
    }
    cout << ans << endl;
    return 0;
}

#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define rep(i, s, n) for (ll i = s; i < (ll)(n); i++)

struct BIT {
private:
  int N;

public:
  vector<ll> bit;
  BIT(ll size) {
    N = size;
    bit.resize(N);
  }

  void add(ll a, ll w) {
    for (ll x = a; x <= N; x += x & -x)
      bit[x] += w;
  }

  ll sum(ll a) {
    ll ret = 0;
    for (ll x = a; x > 0; x -= x & -x)
      ret += bit[x];
    return ret;
  }
};

int main() {
  ll N;
  cin >> N;
  vector<ll> li(N, 0);
  vector<ll> comp(N, 0);
  map<pair<ll, ll>, ll> to_idx_b;
  map<ll, ll> cnta, cntb;
  rep(i, 0, N) {
    ll num;
    cin >> num;
    li[i] = num + i;
  }
  rep(i, 0, N) {
    ll num;
    cin >> num;
    comp[i] = num + i;
    to_idx_b[{num + i, cntb[num + i]++}] = i;
  }
  vector<ll> sw(N);
  for (ll i = 0; i < N; i++) {
    ll target = li[i];
    pair<ll, ll> tmp = {target, cnta[target]++};
    if (to_idx_b.count(tmp) == 0) {
      cout << -1 << endl;
      return 0;
    } else {
      sw[i] = to_idx_b[tmp];
    }
  }

  ll swaps = 0;
  BIT bi(N);
  rep(i, 0, N) {
    ll num = sw[i];
    bi.add(num + 1, 1);
    swaps += i - bi.sum(num);
  }

  cout << swaps << endl;
}


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

int main(){
  int64_t L,ansue=1,anssita=1,ans;
  cin>>L;
  for(int i=0;i<11;i++){
    ansue*=L-1-i;
    anssita*=i+1;
    if(ansue%2==0&&anssita%2==0){
      ansue/=2;
      anssita/=2;
    }
    if(ansue%3==0&&anssita%3==0){
      ansue/=3;
      anssita/=3;
    }
    if(ansue%5==0&&anssita%5==0){
      ansue/=5;
      anssita/=5;
    }
    if(ansue%7==0&&anssita%7==0){
      ansue/=7;
      anssita/=7;
    }
    if(ansue%11==0&&anssita%11==0){
      ansue/=11;
      anssita/=11;
    }
  //  cout<<"ansue="<<ansue<<endl;
  //  cout<<"anssita="<<anssita<<endl;
  }
  ans=ansue/anssita;
  cout<<ans<<endl;
}

// Problem: A - Rotate
// Contest: AtCoder - AtCoder Beginner Contest 197（Sponsored by Panasonic）
// URL: https://atcoder.jp/contests/abc197/tasks/abc197_a
// Memory Limit: 1024 MB
// Time Limit: 2000 ms
// Powered by CP Editor (https://github.com/cpeditor/cpeditor)

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

#define S             second
#define F             first
#define pb            push_back
#define ppb           pop_back()
#define B(c)          (c).begin()
#define E(c)          (c).end()
#define all(c)        (c).begin(),(c).end()
#define sz(c)         (int)((c).size())
#define lcm(a,b)      (a * (b / __gcd(a,b)))
#define pow(x, n)     (int)(pow(x,n))
#define lb            lower_bound
#define mp            make_pair
#define ll            long long
#define vi            vector<int>
#define vl            vector<ll>
#define pii           pair<int,int>
#define pll           pair<ll,ll>
#define vpi           vector<pii>
#define vpl           vector<pll>
#define vvi           vector<vector<int> >
#define vvl           vector<vector<ll> >
#define M_PI		  3.14159265358979323846
#define fn(i,a,b)     for(ll i=a;i<b;i++)
#define fe(i,a,b)     for(ll i=a;i<=b;i++)

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

	ll t = 1;
	//cin >> t;
	while (t--)
	{
       string s;
       cin >> s;
       char c = s[0];
       string p = s.substr(1,sz(s)-1);
       p+=c;
       cout<<p;

	}

}


#include <bits/stdc++.h>
using namespace std;
#define ll long long int
#define ld long double
#define mp make_pair
#define pb push_back
#define ppb pop_back
#define pf push_front
#define ppf pop_front
#define all(x) (x).begin(), (x).end()
#define uniq(v) (v).erase(unique(all(v)), (v).end())
#define sz(x) (ll)((x).size())
#define fr first
#define sc second
#define pii pair<int, int>
#define rep(i, a, b) for (int i = a; i < b; i++)
#define mem1(a) memset(a, -1, sizeof(a))
#define mem0(a) memset(a, 0, sizeof(a))

int main()
{
    int x, y;
    cin >> x >> y;

    if (x == 0 and y == 0)
        cout << 0 << endl;

    else if (x == 0 and y == 1)
        cout << 2 << endl;

    else if (x == 1 and y == 0)
        cout << 2 << endl;

    else if (x == 1 and y == 1)
        cout << 1 << endl;

    else if (x == 0 and y == 2)
        cout << 1 << endl;

    else if (x == 2 and y == 0)
        cout << 1 << endl;

    else if (x == 1 and y == 2)
        cout << 0 << endl;

    else if (x == 2 and y == 1)
        cout << 0 << endl;

    else if (x == 2 and y == 2)
        cout << 2 << endl;

    return 0;
}

/**
    Lost Arrow (Aryan V S)
    Saturday 2021-03-13
**/

#ifdef LOST_IN_SPACE
#  if   __cplusplus > 201703LL
#    include "lost_pch1.h" // C++20
#  elif __cplusplus > 201402LL
#    include "lost_pch2.h" // C++17
#  else
#    include "lost_pch3.h" // C++14
#  endif
#else
#  include <bits/stdc++.h>
#endif

constexpr bool test_cases = false;

void solve () {
    int m, h;
    std::cin >> m >> h;
    std::cout << (h % m == 0 ? "Yes" : "No") << '\n';
}

int main () {

    std::ios::sync_with_stdio(false);
    std::cin.tie(nullptr);
    std::cout.precision(10);
    std::cerr.precision(10);
    std::cout << std::fixed << std::boolalpha;
    std::cerr << std::fixed << std::boolalpha;

    int32_t cases = 1;
    if (test_cases)
        std::cin >> cases;
    while (cases--)
        solve();

    return 0;
}

// g++.exe -Wall -Weffc++ -Wextra -pedantic -std=c++20 -g -D_GLIBCXX_DEBUG -DLOST_IN_SPACE -H

// Replace failing with learning
// Replace overthinking with action
// Replace blame with responsibility
// Replace toxic friends with mentors
// Replace complaining with gratitude
// Replace netflix marathons with sleep
// Replace fake influencers with inspiring creators


#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define endl "\n"
#define all(v) begin(v),end(v)
#define pb push_back
#define fr first
#define sc second
#define si(s) (int)s.size()
#define rep(i,a,b) for(int i=a;i<b;i++)
#define dig(a) fixed<<setprecision(a)
#define fast ios_base::sync_with_stdio(false); cin.tie(NULL)
const int M = 1e9+7;
ll power(ll a, ll n) {
ll res = 1;
while (n) {
if (n % 2) {res = (res * a) % M;}
n >>= 1; a = (a * a) % M;}
return res;
}

const int N  = 1e5+5;

void solve(){

	int a,b,c,d;
	cin>>a>>b>>c>>d;
	cout<<b-c;
}
int main(){
	fast;

	// #ifndef ONLINE_JUDGE
	// 	freopen("input.txt","r",stdin);
	// 	freopen("output.txt","w",stdout);
	// #endif

 	int tt=1; //cin>>tt;
 	while(tt--){
 		solve();
 	}
	return 0;

}

#include<bits/stdc++.h>
#define all(x) (x).begin(),(x).end()

using ll = long long;
using ld = long double;
using namespace std;

const ll inf = 2e18;
const ll mod = 1e9 + 7;
const ll N = 2e5 + 5;

int a, b, c;

void code() {
    cin >> a >> b >> c;

    vector<int> v{a, b, c};
    sort(all(v));
    if (v[2] - v[1] == v[1] - v[0]) {
        cout << "Yes\n";
        return;
    }

    cout << "No\n";
}

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

    int t = 1;
    // cin>>t;

    while (t-- > 0) {
        code();
    }
}


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

const ll MAX_N = 200'000;

ll N, P, Q, U, D;
vector<ll> G[MAX_N];
ll in[MAX_N], out[MAX_N];
vector<vector<ll>> mat;

ll cnt = 0;

void dfs(ll u, ll d) {
  in[u] = cnt++;
  mat[d].push_back(in[u]);
  for (auto v : G[u]) {
    dfs(v, d + 1);
  }
  out[u] = cnt++;
}

int main() {
  cin >> N;
  mat = vector<vector<ll>>(N);
  for (ll i = 1; i < N; ++i) {
    cin >> P;
    G[P - 1].push_back(i);
  }
  dfs(0, 0);
  cin >> Q;
  while (Q--) {
    cin >> U >> D;
    --U;
    vector<ll> &v = mat[D];
    cout << lower_bound(v.begin(), v.end(), out[U])
                - lower_bound(v.begin(), v.end(), in[U])
         << endl;
  }
}

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

class BIT {
public:
	int size_ = 1;
	vector<long long> dat;

	void init(int sz) {
		size_ = sz + 2;
		dat.resize(size_ + 2, 0);
	}
	void add(int pos, long long x) {
		pos++;
		while (pos <= size_) {
			dat[pos] += x;
			pos += (pos & -pos);
		}
	}
	long long sum(int pos) {
		long long s = 0; pos++;
		while (pos >= 1) {
			s += dat[pos];
			pos -= (pos & -pos);
		}
		return s;
	}
};

long long N;
long long A[1 << 18];
long long B[1 << 18];
long long C[1 << 18];
long long Answer = 0;

int main() {
	cin >> N;
	for (int i = 1; i <= N; i++) cin >> A[i];
	for (int i = 1; i <= N; i++) cin >> B[i];

	vector<pair<long long, int>> vec1, vec2;
	for (int i = 1; i <= N; i++) vec1.push_back(make_pair(A[i] + i, i));
	for (int i = 1; i <= N; i++) vec2.push_back(make_pair(B[i] + i, i));
	sort(vec1.begin(), vec1.end());
	sort(vec2.begin(), vec2.end());
	for (int i = 0; i < N; i++) {
		C[vec2[i].second] = vec1[i].second;
		if (vec1[i].first != vec2[i].first) {
			cout << "-1" << endl;
			return 0;
		}
	}

	BIT Z;
	Z.init(N + 2);
	for (int i = 1; i <= N; i++) {
		Answer += Z.sum(N + 1) - Z.sum(C[i]);
		Z.add(C[i], 1);
	}
	cout << Answer << endl;
	return 0;
}


/* Author: rrrr_wys
**/

#include <bits/stdc++.h>
#define rep(i, a, b) for(int i = (a); i <= (b); ++ i)
#define per(i, a, b) for(int i = (a); i >= (b); -- i)
#define pb push_back
#define pii pair<int,int>
#define pll pair<ll,ll>
#define fi first
#define se second
typedef double db;
typedef long long ll;
using namespace std;
typedef vector<int> VI;
typedef vector<VI> VVI;

const int N = 2000110;
const int mo = 1e9 + 7;

int n;
vector<pair<int,ll>> G[N];
ll f[N];
void dfs(int u, int pa) {
        for(auto &v: G[u]) if(v.fi != pa){
                f[v.fi] = f[u] ^ v.se;
                dfs(v.fi, u);
        }
}
ll a[N], A[2];
signed main () {
        ios::sync_with_stdio(false); cin.tie(0);
        cin >> n;
        rep(i,2,n) {
                int u, v; ll w;
                cin >> u >> v >> w;
                G[u].pb({v,w}); G[v].pb({u,w});
        }
        dfs(1,0);
        ll ans =0;
        rep(ti,0,60) {
                rep(i,1,n) a[i] = !!(f[i]&(1ll<<ti));
                ll tt = 0;
                rep(i,1,n) {
                        if(a[i] == 0) tt += A[1];
                        else tt += A[0];
                        A[a[i]]++;
                        tt %= mo;
                }
                ans = ans + ((1ll << ti) % mo) * tt % mo;
                ans %= mo;
                A[0]=A[1]=0;
        }
        cout << ans << "\n";
}

#include <bits/stdc++.h>
#define REP(i,n) for(int i=0;i<(int)(n);++i)
#define ALL(v)   (v).begin(),(v).end()
#define debug(x) cerr<<#x<<": "<<(x)<<endl
using namespace std;
using llong = long long;
using vi    = vector<int>;
using vvi   = vector<vi >;
using vvvi  = vector<vvi >;
using pii   = pair<int,int>;
constexpr int    INF  = 1e9;
constexpr llong  LINF = 1e18;
constexpr double EPS  = 1e-12;
constexpr int    MOD  = 1e9+7;
template<class Type>
void line(const Type &a){int cnt=0;for(const auto &elem:a)cerr<<(cnt++?' ':'>')<<elem;cerr<<endl;}

int main(){//I refer to other commentaries.
	int n;
	string s,x;
	cin>>n>>s>>x;

	vector<set<int> > dp(n+1);
	dp[n].insert(0);
	for(int i=n-1;i>=0;--i){
		int num=s[i]-'0';
		if(x[i]=='A'){
			REP(res,7){
				bool jud=true;
				if(dp[i+1].find(res*10%7)==dp[i+1].end()) jud=false;
				if(dp[i+1].find((res*10+num)%7)==dp[i+1].end()) jud=false;
				if(jud) dp[i].insert(res);
			}
		}else{
			REP(res,7){
				bool jud=false;
				if(dp[i+1].find(res*10%7)!=dp[i+1].end()) jud=true;
				if(dp[i+1].find((res*10+num)%7)!=dp[i+1].end()) jud=true;
				if(jud) dp[i].insert(res);
			}
		}
	}

	bool ans=(dp[0].find(0)==dp[0].end());
	cout<<(ans?"Aoki":"Takahashi")<<endl;
}


#include<bits/stdc++.h>
#include <cstdio>
#include <cstring>
#include <cmath>
#include <string>
#include <chrono>
#include <complex>
using namespace std;
#define ll long long
#define ld long double
#define ui unsigned int
#define ull unsigned ll
#define mp                   make_pair
#define eb                   emplace_back
#define pb                   push_back
#define pf                   push_front
#define popb                 pop_back
#define popf                 pop_front
#define hashmap              unordered_map
#define hashset              unordered_set
#define lb                   lower_bound
#define ub                   upper_bound
#define all(a)               (a).begin(), (a).end()
#define rall(a)              (a).rbegin(), (a).rend()
#define ff                   first
#define ss                   second
#define foi(n) for(ll i=0;i<n;i++)
#define foj(n) for(ll j=0;j<n;j++)
#define fok(n) for(ll k=0;k<n;k++)
#define forr(i,a,b) for(ll i=a;i<b;i++)
#define forrr(i,b,a) for(ll i=b;i>=a;i--)
#define forrrr(i,a,b,k) for(ll i=a;i<b;i=i+k)
#define graph          vector<vector<ll>>
#define sz(v) v.size()
typedef pair<int, int> pii;
typedef pair<ll, ll>   pll;
typedef vector<int>         vi;
typedef vector<ll>          vll;
typedef vector<string>      vs;
typedef vector<double>      vd;
typedef vector<pii>         vpii;
typedef vector<pll>         vpll;
typedef pair< ll, pll>      plll;
typedef vector<plll>      vplll;
typedef  vector<string> 	     vs;
typedef  vector<char>	         vc;
typedef  vector<bool>            vb;
typedef  map<string, int>         msi;
typedef  map<int, int>	         mii;
typedef  map<ll, ll>             mll;
typedef  map<ll, vll>             mvll;
typedef  map<char, ll>           mcl;
typedef map<pair<ll, ll>, ll>  mplll;
typedef  unordered_map<char, ll>           umcl;
typedef  unordered_map< ll, char>           umlc;
typedef  map<int, string>	     mis;
typedef  pair<string, int>       psi;
typedef  pair<string, string>    pss;
typedef priority_queue <ll> pq;
typedef priority_queue<pii, vector<pii>, greater<pii> > pqq;
typedef priority_queue<ll, vector<ll>, greater<ll>> prq;
const ll MOD = 1000000007;
const ll modx = 998244353;
void solve();
int main()
{
	ios_base::sync_with_stdio(false); cin.tie(NULL);

#ifndef ONLINE_JUDGE
	freopen("input1.txt", "r", stdin);
	freopen("error1.txt", "w", stderr);
	freopen("output1.txt", "w", stdout);
#endif
//	ll t ; cin >> t;
//	while (t--)
	{
		solve();
		cout << "\n";
	}

	cerr << "time taken : " << (float)clock() / CLOCKS_PER_SEC << " secs" << endl;
	return 0;
}
ll ceils(ll x, ll y) {
	return x / y + ((x % y) != 0);
}
ll gcd(ll a, ll b) {
	if (b == 0)
		return a;
	else
		return gcd(b, a % b);
}

ll lcm(ll a, ll b) {
	return a / gcd(a, b) * b;

}
ll powmod(ll x, ll y) {
	ll res = 1;
	for (ll i = 0; i < y; i++) {
		res = res * x % MOD;
	}
	return res;
}
bool isPrime(ll n)
{
	if (n <= 1)
		return false;
	if (n <= 3)
		return true;
	if (n % 2 == 0 || n % 3 == 0)
		return false;

	for (ll i = 5; i * i <= n; i = i + 6)
		if (n % i == 0 || n % (i + 2) == 0)
			return false;

	return true;
}
ll kadanesAlgo(vll a)
{
	ll n = a.size();

	ll currMax = 0;
	ll mx = INT_MIN;

	foi(n)
	{
		currMax += a[i];

		if (currMax <= a[i])
		{
			currMax = a[i];
		}

		mx = max(currMax, mx);
	}
	return mx;
}
ll n, q;
//vll a(100001, 0);
void solve() {
	/*	cin >> n >> q;
		foi(n) {
			ll x;
			cin >> x;
			a[x]++;
		}
		foi(q) {
			ll z;
			cin >> z;
		}*/
	ll m;
	cin >> n >> m;
	double g = m / 100.0;
	double h = g * n;
	cout << fixed << setprecision(12);
	cout << h;

}

#include <bits/stdc++.h>
using namespace std;
#include <ext/pb_ds/assoc_container.hpp>
using namespace __gnu_pbds;
template <class c, class cmp = less<c> > using ordered_set = tree<c, null_type, cmp, rb_tree_tag, tree_order_statistics_node_update>;
#define IOS ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define TRACE
#ifdef TRACE
#define trace(...) __f(#__VA_ARGS__, __VA_ARGS__)
template <typename Arg1>
void __f(const char* name, Arg1&& arg1){
  cerr << name << " : " << arg1 << std::endl;
}
template <typename Arg1, typename... Args>
void __f(const char* names, Arg1&& arg1, Args&&... args){
  const char* comma = strchr(names + 1, ',');cerr.write(names, comma - names) << " : " << arg1<<" | ";__f(comma+1, args...);
}
#else
#define trace(...)
#endif
template<class T> ostream& operator<<(ostream &os, vector<T> V) {os << "[ "; for(auto v : V) os << v << " "; return os << "]";}
template<class L, class R> ostream& operator<<(ostream &os, pair<L,R> P) {return os << "(" << P.first << "," << P.second << ")";}
template <typename T,typename U>pair<T,U> operator+(const pair<T,U> & l,const std::pair<T,U> & r) { return {l.first+r.first,l.second+r.second};}
typedef long long int ll;
const ll mod = 1e9 + 7;
const ll maxn = 5e6 + 5;
#define endl '\n'
#define ld long double
#define int ll
#define all(x)  (x).begin(),(x).end()
const ll md = (ll) 1e9 + 7;

inline ll add(ll a, ll b) {
  a += b;
  if (a >= md) a -= md;
  return a;
}

inline ll sub(ll a, ll b) {
  a -= b;
  if (a < 0) a += md;
  return a;
}

inline ll mul(ll a, ll b) {
  return (ll) ((long long)((a%md) * (b%md)) % md);
}

inline ll power(ll a, long long b) {
  ll res = 1;
  while (b > 0) {
    if (b & 1) {
      res = mul(res, a);
    }
    a = mul(a, a);
    b >>= 1;
  }
  return res;
}

inline ll inv(ll a) {
  a %= md;
  if (a < 0) a += md;
  ll b = md, u = 0, v = 1;
  while (a) {
    ll t = b / a;
    b -= t * a; swap(a, b);
    u -= t * v; swap(u, v);
  }
  assert(b == 1);
  if (u < 0) u += md;
  return u;
}

vector<int> fact(maxn+5);
void init (int n)
{
  fact[0] = 1;
  for(int i = 1;i<=n;i++)
  {
    fact[i] = mul(i,fact[i-1]);
  }
}
int nck(int n,int k)
{
  return mul(fact[n],mul(inv(fact[k]),inv(fact[n-k])));
}

int32_t main(){

  IOS

  init(5000000);

  int n, m;
  cin >> n >> m;
  vector<int> a(n);
  int k = 1;
  for(int i = 0;i<n;i++){
    cin >> a[i];
    m -= a[i];
    k += a[i] + 1;
  }

  if(m < 0){
    cout << 0 << endl;
    return 0;
  }

  int num = k - 1 + m;
  int den = k - 1;
  int ans = 1;
  for(int i = 0;i<den;i++){
    ans = mul(ans, num - i);
  }

  ans = mul(ans, inv(fact[den]));

  cout << ans << endl;

}


#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
ll n,ans;
int main(){
	cin>>n;
	for(ll i=1000;i<1000000000000000000;i*=1000){
		if(i>n) break;
		ans+=n-(i-1);
	}
	cout<<ans<<endl;
	return 0;
}

#include <iostream>
#include <sstream>
#include <vector>
#include <algorithm>
#include <numeric>
#include <cmath>
#include <utility>
#include <map>
#include <list>
#include <climits>
#include <set>
#include <deque>
#include <queue>
#include <stack>
#include <unordered_map>
#include <unordered_set>
#include <iomanip>
#include <bitset>
#include <string>

// #define cerr if(false)cerr
#define watch(x) cerr << "> " << #x << ": " << x << "\n";

using namespace std;

template <typename T>
std::ostream &operator <<(std::ostream &out, vector<T> &v) {
	for (typename vector<T>::size_type i = 0; i < v.size(); ++i)
		out << v[i] << " ";
	out << "\n";
    return out;
}
template <typename T>
std::ostream &operator <<(std::ostream &out, set<T> &s) {
	for (auto e : s)
		out << e << " ";
	out << "\n";
    return out;
}
template <typename T, typename N>
std::ostream &operator <<(std::ostream &out, pair<T, N> &p) {
	out << "(" << p.first << ", " << p.second << ") ";
	out << "\n";
    return out;
}
template <typename T, typename N>
std::ostream &operator <<(std::ostream &out, vector<pair<T, N> > &v) {
	for (size_t i = 0; i < v.size(); ++i)
		cout << v[i];
	out << "\n";
    return out;
}
template <typename T>
std::ostream &operator <<(std::ostream &out, vector<vector<T> > &v) {
	for (size_t i = 0; i < v.size(); ++i) {
		for (size_t j = 0; j < v[i].size(); ++j) {
			out << v[i][j] << " ";
		}
		out << "\n";
	}
   	return out;
}
template <typename T>
std::ostream &operator <<(std::ostream &out, vector<set<T> > &v) {
	for (size_t i = 0; i < v.size(); ++i) {
		out << v[i];
	}
	out << "\n";
   	return out;
}

void solve() {
	long long n;
	cin >> n;

	long long curr = 1e6;
	long long ans = 0;
	int commas = 1;
	while (curr <= n) {
		ans += (long long) commas * (curr - (curr / 1000));
		curr *= 1000;
		++commas;
	}

	ans += (long long) commas * (n - (curr / 1000) + 1);
	cout << max(ans, (long long) 0) << "\n";

	return ;
}

int main() {

	std::ios::sync_with_stdio(false);
	cin.tie(0);
	cout.tie(0);

	int t;
	t = 1;

	while (t--) {
		solve();
	}

	return 0;

}


//dragon->emperor
#include <bits/stdc++.h>

using namespace std;

/**********************************************************************************/

#define mod 1000000007
#define mod2 998244353
const double pi = acos(-1);
#define inf 1e18+5
#define iinf 1e9+5

#define ll long long
#define ld  long double
#define fl(i,a,n) for(ll i=a;i<n;i++)
#define lf(i,a,n) for(ll i=n-1;i>=a;i--)
#define read(n) ll n; cin>>n;
#define scan(a,n) vector<ll> a(n); for(ll i=0;i<n;i++) cin>>a[i];
#define print(a,n) for(ll i=0;i<n;i++) cout<<a[i]<<" "; cout<<endll;
#define p(n) cout<<n<<endll;

#define endll "\n"
#define pb push_back
#define mp make_pair
#define dec(n) fixed<<setprecision(n)
#define F first
#define S second
#define I insert
#define E end()
#define B begin()

#define all(x) x.begin(), x.end()
#define sortall(x) sort(all(x))
#define reverseall(x) reverse(all(x))

typedef vector<ll> vl;
typedef pair<ll,ll> pll;
typedef map<ll,ll> mll;
typedef vector<pll> vpl;
/*************************************[DEBUG]**************************************/

void debug(ll x) { cout<<x<<endll;}
void debug(int x) { cout<<x<<endll;}
void debug(unsigned int x) { cout<<x<<endll;}
void debug(unsigned ll x) { cout<<x<<endll;}
void debug(float x) { cout<<x<<endll;}
void debug(double x) { cout<<dec(7)<<x<<endll;}
void debug(ld x) { cout<<dec(15)<<x<<endll;}
void debug(char x) { cout<<'\''<<x<<'\''<<endll;}
void debug(string s) {cout<<'\"'<<s<<'\"'<<endll;}
void debug(vector<ll> v) { for(auto x :v) cout<<x<<" "; cout<<endll;}
void debug(bool bb)  { cout<<(bb? "True":"False")<<endll;}
void debug(map<ll,ll>mpp) { for(auto x :mpp) cout<<x.first<<" "<<x.second<<endll;}
void debug(pair<ll, ll> pp) { cout<<"{"<<pp.first<<","<<pp.second<<"}"<<endll;}
void debug(vector<pair<ll,ll>> v) { for(auto x :v) debug(x);}

/***********************************[FUNCTIONS]************************************/

// bitset<200000>vis(0);
vector<bool> prime;

void primes(ll n)
{
    prime.resize(n+1);
    prime.assign(n+1,true);
    prime[0]=0;
    prime[1]=0;
    for(ll i=2; i*i<=n; i++)
    {
        if(prime[i])
        {
            for(ll j=(i*i); j<n; j=j+i) prime[j]=false;
        }
    }
}

ll gcd(ll x, ll y)
{
    if(x==0) return y;
    return gcd((ll) y%x, (ll)x);
}

ll powM(ll x, ll y, ll m)
{
    ll ans=1, r=1;
    x=x%m;
    while(r>0 && r<=y)
    {
        if(r & y)
        {
            ans=ans*x;
            ans=ans%m;
        }
        r=r<<1;
        x=x*x;
        x=x%m;
    }
    return ans;
}

ll powN(ll a,ll n)
{
    if(n==0) return 1;
    if(n==1) return a;
    ll u=powN(a,n/2);
    u=u*u;
    if(n%2) u=u*a;
    return u;
}

ll modinv(ll a,ll m)
{
    return powM(a,m-2,m);
}

ll ncr(ll n, ll r, ll m)
{
    if(n<r) return 0;
    if(n==r || r==0) return 1;
    if(r==1) return n;
    if(n-r<r) return ncr(n,n-r,m);
    ll a=n;
    ll b=r;
    for(ll i=1; i<r; i++)
    {
        a=(a*(n-i))%m;
        b=(b*(r-i))%m;
    }
    b=modinv(b,m);
    a=(a*b)%m;
    return a;
}

/************************************[CODE]****************************************/

bool solve(ll num, ll k)
{
    ll n=1;
    while(n<num)
        n=n*k;
    while(num>0)
    {
        if(num/n==7) return false;
        num=num%n;
        n=n/k;
    }
    return true;
}

int main()
{
    ll n; cin>>n;
    ll ans=0;
    fl(i,1,n+1)
    {
        if(solve(i,10) && solve(i,8)) ans++;
    }
    p(ans);
    return 0;
}

#include <iostream>
#include <vector>
#include <queue>
#include <stack>
#include <map>
#include <algorithm>
#include <bitset>
#include <string>
#include <cstdio>
#include <cmath>
#include <climits>
using namespace std;

const long long INF = 1000000007;

typedef pair<int, int> P;
template<class T>
T gcd(T a, T b)
{
    if (a % b == 0) return b;
    else return gcd(b, a%b);
}

bool include7(int N)
{
    while(N > 0)
    {
        int i = N % 10;
        if (i == 7)
        {
            return true;
        }

        N /= 10;
    }

    return false;
}

int to8(int N)
{
    int hold8 = 1;
    int hold10 = 1;
    int ans = 0;

    while(N >= hold8)
    {
        hold8 *= 8;
        hold10 *= 10;
    }
    if (hold8 >= 8)
    {
        hold8 /= 8;
        hold10 /= 10;
    }

    while(N > 0)
    {
        ans += hold10 * min(7, N / hold8);
        N -= hold8 * min(7, N / hold8);

        hold8 /= 8;
        hold10 /= 10;
    }

    return ans;
}

int main(void)
{
    int N;
    cin >> N;

    vector<bool> flag(N+1, false);
    // 10
    for (int i = 1; i <= N; i++)
    {
       if (include7(i))
       {
           flag[i] = true;
       }
    }

    // 8
    for (int i = 1; i <= N; i++)
    {
        int p = to8(i);
        if (include7(p))
       {
           flag[i] = true;
       }
    }

    int count = 0;
    for (int i = 0; i <= N; i++)
    {
        if (flag[i])
        {
            count++;
        }

    }

    cout << N - count << endl;
}


#include<stdio.h>
#include<stdlib.h>
#include<iostream>
#include <cstdio>
#include <cstring>
#include <algorithm>
using namespace std;
void aa(int a,int b)
{
    if(a>b)
        cout<<">";
    else if(a<b)
        cout<<"<";
    else
        cout<<"=";
}
int main()
{
    int a,b,c;
    cin>>a>>b>>c;
    if(c==0)
    cout<<"=";
        else if(c==1)
        aa(a,b);
        else if(c%2==0)
            aa(abs(a),abs(b));
        else if(c>0)
            aa(a,b);
        else
            aa(b,a);
}

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

int main(){
  long long N,mod=7;
  string S1,S2;
  cin >> N >> S1 >> S2;
  vector<long long> V(N);
  vector<bool> W(N);
  long long pow10 = 1;
  for(int i=N-1;i>=0;i--){
    V[i] = (S1[i]-'0') * pow10;
    V[i] %= mod;
    pow10 *= 10;
    pow10 %= mod;
  }
  for(int i=0;i<N;i++){
    if(S2[i]=='A') W[i] = true;
    else W[i] = false;
  }

  vector<vector<bool>> B(N+1,vector<bool>(mod,false));
  B[N][0] = true;
  for(int i=N-1;i>=0;i--){
    if(W[i]){
      for(int j=0;j<mod;j++){
        int x = (V[i]+j) % mod;
        if(B[i+1][j] && B[i+1][x]) B[i][j] = true;
      }
    }
    else{
      for(int j=0;j<mod;j++){
        int x = (V[i]+j) % mod;
        if(B[i+1][j] || B[i+1][x]) B[i][j] = true;
      }
    }
  }

  if(B[0][0]) cout << "Takahashi" << endl;
  else cout << "Aoki" << endl;
  return 0;
}


#include <iostream>
#include <string>
using namespace std;
int main()
{
  string S;
  cin >> S;
  for (auto &ch : S)
    if (ch == '6')
      ch = '9';
  	else if (ch == '9')
      ch = '6';
  for (int i = S.length() - 1; i >= 0; i -= 1)
    cout << S[i];
}

#include <iostream>
#include <string>
#include <vector>
#include <cmath>
#include <map>
#include <numeric>
#include <iomanip>
#include <algorithm>
using namespace std;

int main(void) {
	int n;

	cin >> n;

	cout << n / 100 +(n % 100 == 0 ? 0 : 1) << endl;
}


#include <bits/stdc++.h>
#define rep(i, N) for(int i = 0; i < (int)N; i++)
using namespace std;
typedef long long ll;
typedef pair<int,int> P;
typedef vector<int> vi;
const int INF = (1 << 30); // > 10^9, int 2*INF

int main() {
    int a, b, ans = 0, flag = 0;
    cin >> a >> b;
    //vi a(n); rep(i, n) scanf("%d", &a[i]);

    //puts( (flag ? "Yes" : "No") );
    //printf("%.12lf\n", ans);
    //rep(i, n) printf("%d\n", a[i]);
    cout << (a*2+100)-b; printf("\n");
}

#include<bits/stdc++.h>

using namespace std;

#define FastIO ios_base :: sync_with_stdio(false), cin.tie(0), cout.tie(0)
#define read(in) freopen("Input.txt","r",stdin)
#define write(out) freopen("Ouput.txt","w",stdout)
#define pf printf
#define sf scanf
#define fr0(i,n) for(int i=0 ; i<n ; i++)
#define fr1(i,n) for(int i=1 ; i<=n ; i++)
#define fr2(i,n) for(int i=n ; i>=1 ; i--)
#define frx(i,x,n) for(int i=x ; i<=n ; i++)
#define sf1(val) scanf("%lld",&val)
#define sf2(val1,val2) scanf("%lld %lld",&val1,&val2)
#define INF 999999999999999999
#define Pi 2*acos(0.0)
#define len 200000

typedef long long int lli;

lli a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,sum=0,total=0,res=0,ans=0;

int main()
{
    //FastIO;

    //read(in);

    sf2(a,b);

    sum=2*a+100;

    pf("%lld\n",abs(sum-b));
}


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

using ll = long long;
constexpr int INF = (int)1e9;
constexpr long long LINF = (long long)1e18;
constexpr long long MOD = 1e9 + 7;
//constexpr long long MOD = 998244353;
constexpr double pi = 3.141592653589793238;

int main() {
    string s;
    cin >> s;

    string t1, t2;
    bool flag = true;

    for (int i = 0; i < (int)s.size(); ++i) {
        if (s.at(i) == 'R') flag = !flag;
        else {
            if (flag) {
                if (t1.size() == 0) {
                    t1.push_back(s.at(i));
                    t2.push_back(s.at(i));
                    continue;
                }
                if (t1.at(t1.size() - 1) != s.at(i)) {
                    t1.push_back(s.at(i));
                    t2.insert(t2.begin(), s.at(i));
                }
                else {
                    t1.pop_back();
                    t2.erase(t2.begin());
                }

            }
            else {
                if (t1.size() == 0) {
                    t1.push_back(s.at(i));
                    t2.push_back(s.at(i));
                    continue;
                }
                if (t2.at(t2.size() - 1) != s.at(i)) {
                    t2.push_back(s.at(i));
                    t1.insert(t1.begin(), s.at(i));
                }
                else {
                    t2.pop_back();
                    t1.erase(t1.begin());
                }
            }
        }
    }
    if (flag) cout << t1 << endl;
    else cout << t2 << endl;

    return 0;
}

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

int main(void){
  string s;
  cin >> s;
  vector<string> subs;
  string tmp = "";
  for(int i = 0; i < s.size() ; ++i){
    if(s[i] != 'R'){
      tmp += s[i];
    }
    else{
      subs.push_back(tmp);
      tmp = "";
    }
    if(i == s.size()-1){
      subs.push_back(tmp);
    }
  }

  string ans = "";
  for(int i=0 ; i < subs.size() ; ++i){
    if((subs.size()-i-1)%2 == 0){
      ans += subs[i];
    }
    else{
      string tmp = subs[i];
      reverse(tmp.begin(), tmp.end());
      ans = tmp + ans;
    }
  }

  vector<char> stack;
  for(int i = 0; i<ans.size() ; ++i){
    if(stack.size() == 0){
      stack.push_back(ans[i]);
      continue;
    }
    if(ans[i] == stack[stack.size()-1]){
      stack.pop_back();
    }
    else{
      stack.push_back(ans[i]);
    }
  }

  // output
  for(int i=0; i<stack.size() ; ++i){
    cout << stack[i] << "" ;
  }
  cout << endl;

return 0;
}


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

#define _P(...) (void)printf(__VA_ARGS__)
#define FOR(x,to) for(x=0;x<(to);x++)
#define FORR(x,arr) for(auto& x:arr)
#define FORR2(x,y,arr) for(auto& [x,y]:arr)
#define ALL(a) (a.begin()),(a.end())
#define ZERO(a) memset(a,0,sizeof(a))
#define MINUS(a) memset(a,0xff,sizeof(a))
template<class T> bool chmax(T &a, const T &b) { if(a<b){a=b;return 1;}return 0;}
template<class T> bool chmin(T &a, const T &b) { if(a>b){a=b;return 1;}return 0;}
//-------------------------------------------------------

int N,K,V;
vector<int> E[202020];

int need[202020],aff[202020];
int num;

void dfs(int cur,int pre) {
	need[cur]=0;
	aff[cur]=-1;

	FORR(e,E[cur]) if(e!=pre) {
		dfs(e,cur);
		if(aff[e]>=0) aff[cur]=max(aff[cur],aff[e]-1);
		if(need[e]>=0) need[cur]=max(need[cur],need[e]+1);
	}

	if(aff[cur]>=need[cur]) {
		need[cur]=-1;
	}
	else {
		if(need[cur]>=V) {
			need[cur]=-1;
			aff[cur]=V;
			num++;
		}
		else {
			aff[cur]=-1;
		}
	}

}

int ok(int v) {
	if(v<=0) return 0;

	V=v;
	num=0;
	dfs(0,0);
	if(need[0]>=0) num++;
	return num<=K;
}

void solve() {
	int i,j,k,l,r,x,y; string s;

	cin>>N>>K;
	FOR(i,N-1) {
		cin>>x>>y;
		E[x-1].push_back(y-1);
		E[y-1].push_back(x-1);
	}
	int ret=N;
	for(j=20;j>=0;j--) if(ok(ret-(1<<j))) ret-=1<<j;
	cout<<ret<<endl;

}

int main(int argc,char** argv){
	string s;int i;
	if(argc==1) ios::sync_with_stdio(false), cin.tie(0);
	FOR(i,argc-1) s+=argv[i+1],s+='\n'; FOR(i,s.size()) ungetc(s[s.size()-1-i],stdin);
	cout.tie(0); solve(); return 0;
}

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

#define REP(i,n) for (int i=0; i<(n); ++i)
#define ALL(x) begin(x),end(x)
#define DUMP(x) cerr<<#x<<" = "<<(x)<<endl

struct fast_ios {
    fast_ios() {
        cin.tie(nullptr);
        ios::sync_with_stdio(false);
        cout << fixed << setprecision(20);
    };
} fast_ios_;

using ll = long long;

template<class T>
bool chmin(T &a, T b) {
    if (a > b) { a = b; return true; }
    return false;
}
template<class T>
bool chmax(T &a, T b) {
    if (a < b) { a = b; return true; }
    return false;
}

template<class T>
ostream &operator<<(ostream &os, const vector<T> &v);
template<class T, class U>
ostream &operator<<(ostream &os, const pair<T, U> &p);
template<class T, class U>
ostream &operator<<(ostream &os, const map<T, U> &mp);

template<class T>
ostream &operator<<(ostream &os, const vector<T> &v) {
    os << '[';
    REP(i, v.size()) {
        if (i) os << ',';
        os << v[i];
    }
    return os << ']';
}

template<class T, class U>
ostream &operator<<(ostream &os, const pair<T, U> &p) {
    return os << '(' << p.first << ' ' << p.second << ')';
}

template<class T, class U>
ostream &operator<<(ostream &os, const map<T, U> &mp) {
    os << '{';
    for (const auto &p : mp) {
        os << p << endl;
    }
    return os << '}';
}

const int INF = numeric_limits<int>::max();
const ll LINF = numeric_limits<ll>::max();

template<class T>
struct edge {
    int from, to; T cost;
    edge(int to, T cost) :
            from(-1), to(to), cost(cost) {}
    edge(int from, int to, T cost) :
            from(from), to(to), cost(cost) {}
};

int main() {
    int N, K; cin >> N >> K;
    vector<vector<int>> g(N);
    REP(i, N-1) {
        int u, v; cin >> u >> v;
        --u, --v;
        g[u].push_back(v);
        g[v].push_back(u);
    }

    auto check = [&](int t) {
        // ans <= t ?
        int cnt = 0;
        vector<int> used;
        function<pair<int,int>(int,int)> dfs = [&](int u, int p) {
            int min_x = INF, max_y = -1;
            for (int v : g[u]) {
                if (v == p) continue;
                auto [x, y] = dfs(v, u);
                chmin(min_x, x);
                chmax(max_y, y);
            }
            if (min_x != INF and min_x + max_y + 2 <= t) {
                // already covered
                return make_pair(min_x + 1, -1);
            } else if (max_y + 1 == t) {
                // use
                ++cnt;
                used.push_back(u);
                return make_pair(0, -1);
            } else {
                // skip
                return make_pair(min_x == INF ? INF : min_x + 1, max_y + 1);
            }
        };
        auto [x, y] = dfs(0, -1);
        if (y != -1) ++cnt;
        return cnt <= K;
    };

    int ok = N-1, ng = 0;
    while (abs(ok - ng) > 1) {
        int m = (ok + ng) / 2;
        (check(m) ? ok : ng) = m;
    }
    cout << ok << endl;
}