#include <bits/stdc++.h>

using namespace std;

vector<vector<int>> bata;
vector<int> dscore, nscore;
vector<int> stsize;

void getScores(int v) {
    nscore[v] = 1;
    dscore[v] = 0;
    stsize[v] = 1;
    if (bata[v].size() == 0) {
//        printf("%d d n s %d %d %d\n", v, dscore[v], nscore[v], stsize[v]);
        return;
    }
    // dckids are all disadvantaged
    vector<int> dckids, ndckids;
    auto take = [&] (int c, int curDecider) { // 0 = the initial decider, 1 = the initial non-decider
        (curDecider == 0 ? dscore : nscore)[v] += dscore[c];
        (curDecider == 1 ? dscore : nscore)[v] += nscore[c];
    };
    for (int c : bata[v]) {
        getScores(c);
        stsize[v] += stsize[c];
        if (stsize[c] % 2 == 0) {
            if (dscore[c] >= nscore[c]) { // decider pre-takes this
                take(c, 0);
            } else {
                dckids.push_back(c);
            }
        } else {
            ndckids.push_back(c);
        }
    }
    sort(begin(ndckids), end(ndckids), [&] (int i, int j) {
        return dscore[i] - nscore[i] > dscore[j] - nscore[j];
    });
    int curPlayer = 0;
    for (int c : ndckids) {
        take(c, curPlayer);
        curPlayer = 1 - curPlayer;
    }
    for (int c : dckids) take(c, curPlayer);
//    printf("%d d n s %d %d %d\n", v, dscore[v], nscore[v], stsize[v]);
}

int main() {
    int n; scanf("%d", &n);
    dscore = nscore = stsize = vector<int>(n, -1);
    bata.assign(n, vector<int>());
    for (int i = 1; i < n; ++i) {
        int p; scanf("%d", &p);
        bata[p-1].push_back(i);
    }
    getScores(0);
    printf("%d\n", nscore[0]);
    return 0;
}

#include <iostream>
#include <cstdio>
#include <string>
#include <algorithm>
#include <utility>
#include <cmath>
#include <vector>
#include <stack>
#include <queue>
#include <deque>
#include <set>
#include <map>
#include <tuple>
#include <numeric>
#include <functional>
using namespace std;
typedef long long ll;
typedef vector<ll> vl;
typedef vector<vector<ll>> vvl;
typedef pair<ll, ll> P;
#define rep(i, n) for(ll i = 0; i < n; i++)
#define exrep(i, a, b) for(ll i = a; i <= b; i++)
#define out(x) cout << x << endl
#define exout(x) printf("%.10f\n", x)
#define chmax(x, y) x = max(x, y)
#define chmin(x, y) x = min(x, y)
#define all(a) a.begin(), a.end()
#define rall(a) a.rbegin(), a.rend()
#define pb push_back
#define re0 return 0
const ll mod = 1000000007;
const ll INF = 1e16;

ll n;
vvl G;
vl dp;
vl Size;  // Size[v] : vの部分木のサイズ

void dfs1(ll v, ll p = -1) {
    Size[v] = 1;
    for(ll u : G[v]) {
        if(u == p) {
            continue;
        }
        dfs1(u, v);
        Size[v] += Size[u];
    }
}

void dfs2(ll v, ll p = -1) {
    dp[v] = 1;
    ll x = 0;
    vl vec;
    for(ll u : G[v]) {
        if(u == p) {
            continue;
        }
        dfs2(u, v);
        if(Size[u]%2 == 0) {
            if(dp[u] < 0) {
                dp[v] += dp[u];
            }
            else {
                x += dp[u];
            }
        }
        else {
            vec.pb(dp[u]);
        }
    }
    sort(all(vec));
    ll k = vec.size();
    rep(i, k) {
        if(i%2 == 0) {
            dp[v] += vec[i];
        }
        else {
            dp[v] -= vec[i];
        }
    }
    if(k%2 == 0) {
        dp[v] += x;
    }
    else {
        dp[v] -= x;
    }
}

int main() {

    cin >> n;

    G.resize(n);
    exrep(i, 1, n-1) {
        ll p;
        cin >> p;
        p--;
        G[i].pb(p);
        G[p].pb(i);
    }

    Size.resize(n);
    dfs1(0);

    dp.resize(n);
    dfs2(0);

    out((n + dp[0])/2);
    re0;
}


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

int main(){
  int n;
  cin>>n;
  string s;
  cin>>s;
  int count=0;
  for(int i=0;i<s.length();i++){
  	int a=0,t=0,g=0,c=0;
    for(int j=i;j<s.length();j++){

        switch(s[j]){
        	case 'A':a++; break;
			case 'T':t++; break;
			case 'G':g++; break;
			case 'C':c++; break;
		}

      	if(a==t && g==c)
      		count++;

    }
    //cout<<i<<" "<<a<<" "<<c<<" "<<g<<" "<<t<<endl;
  }
  cout<<count<<endl;
return 0;
}

#include <iostream>
#include <cmath>
#include <string>
#include <vector>
#include <algorithm>
#include <utility>
#include <tuple>
#include <cstdint>
#include <cstdio>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <deque>
#include <unordered_map>
#include <unordered_set>
#include <bitset>
#include <cctype>
#include <climits>

#define rep(i, n) for(int i = 0; i < n; i++)
#define per(i, n) for(int i = n - 1; i >= 0; i--)
using ll = long long;
#define vi vector<int>
#define vvi vector<vi>
#define vl vector<ll>
#define pii pair<int, int>
#define pll pair<ll, ll>
#define all(a) (a).begin(), (a).end()
#define rall(a) (a).rbegin(), (a).rend()
#define mod 1000000007
using namespace std;
template<class T, class U>
T &chmax(T &a, const U &b){ if(a < b) a = b; return a; }
template<class T, class U>
T &chmin(T &a, const U &b){ if(a > b) a = b; return a; }
int main(){
  int n,m;
  cin >> n >> m;
  vector<pii> v(m);
  map<int, int> cnt;
  rep(i, m){
    int x,y;
    cin >> x >> y;
    v[i] = {x, y};
    cnt[x]++;
  }
  sort(all(v));
  int left = 0, right = 0;
  set<int> s{n};
  for(auto x : cnt){
    vi a,b;
    right += x.second;
    for(int i = left; i < right; i++){
      int y = v[i].second;
      if(s.count(y - 1) || s.count(y + 1)) a.push_back(y);
      else b.push_back(y);
    }
    for(int y : a) s.insert(y);
    for(int y : b) s.erase(y);
    left += x.second;
  }
  cout << (int)s.size() << "\n";
}


#include <bits/stdc++.h>
//#include <ext/pb_ds/assoc_container.hpp>
//#include <ext/pb_ds/tree_policy.hpp>
using namespace std;
//#pragma GCC optimize("Ofast,no-stack-protector,unroll-loops,fast-math,O3")
//#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
//using namespace __gnu_pbds;
#define fastio() ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0)
#define pb  push_back
#define show(x) cout<<(#x)<<" : "<<x<<endl;
#define ll  long long
#define ld  long double
#define fill(a,val) memset(a,val,sizeof(a))
#define mp  make_pair
#define ff  first
#define ss  second
#define pii pair<ll,ll>
#define sq(x) ((x)*(x))
#define all(v) v.begin(),v.end()
#define rall(v) v.rbegin(),v.rend()
#define endl "\n"
#define int long long
#define printclock cerr<<"Time : "<<1000*(ld)clock()/(ld)CLOCKS_PER_SEC<<"ms\n";
const ll MOD     = 1000*1000*1000+7;
const ll INF     = 1ll*1000*1000*1000*1000*1000*1000 + 7;
const ll MOD2    = 998244353;
const ll N       = 1000 * 100 + 10;
const ll N2      = 70;
const ld PI  = 3.141592653589793;
//template<class T> using oset=tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;
ll gcd(ll a, ll b){if(!b)return a;return gcd(b, a % b);}
ll power(ll x,ll y,ll p = LLONG_MAX ){ll res=1;x%=p;while(y>0){if(y&1)res=(res*x)%p;y=y>>1;x=(x*x)%p;}return res;}
ll lcm(ll a , ll b){return (a*b)/gcd(a,b);}

signed main()
{
    fastio();
    //cout<<fixed<<setprecision(20);
    //CHECK for LONG LONG and LONG DOUBLE
    //*comment for all except cc/cf
    #ifndef ONLINE_JUDGE
           freopen("input.txt","r",stdin);
           freopen("output.txt","w",stdout);
    #endif//*/
    int n;
    string s;
    cin>>n>>s;
    for(auto &x : s)
    {
    	if(x=='A')
    		x = '0';
    	if(x=='G')
    		x = '1';
    	if(x=='C')
    		x = '2';
    	if(x=='T')
    		x = '3';
    }
    int c[n][4];
    fill(c,0);
    for (int i = 0; i < n; ++i)
    {
    	c[i][s[i]-'0']++;
    }
    for (int i = 1; i < n; ++i)
    {
    	for (int j = 0; j < 4; ++j)
    	{
    		c[i][j]+=c[i-1][j];
    	}
    }
    // cout<<s;
    int ans = 0;
    for(int i = 0 ; i < n ; i++)
    {
    	for(int j = i+1 ; j < n ; j++)
    	{
    		int cc = c[j][2];
    		if(i)
    			cc-=c[i-1][2];

    		int cg = c[j][1];
    		if(i)
    			cg-=c[i-1][1];

    		int ct = c[j][3];
    		if(i)
    			ct-=c[i-1][3];

    		int ca = c[j][0];
    		if(i)
    			ca-=c[i-1][0];

    		if(ca==ct&&cg==cc)
    		{
    			ans++;
    		}
    	}
    }
    cout<<ans;

    printclock;
    return 0;
}

#include<bits/stdc++.h>
using namespace std;
int n;
#define Maxn 500010
#define cout cerr
char ch[Maxn];
int S[Maxn],T[Maxn];
int seq[Maxn],cnt;
int A[Maxn],a,B[Maxn],b;

int main(){
	scanf("%d",&n);
	scanf("%s",ch+1);
	for(int i=1;i<=n;++i)S[i]=ch[i]-'0';
	scanf("%s",ch+1);
	for(int i=1;i<=n;++i)T[i]=ch[i]-'0';
	long long Ans=0;
	for(int i=1;i<=n;++i){
		if(S[i])A[++a]=i;
		if(T[i])B[++b]=i;
	}
	if(a<b){
		puts("-1");
		return 0;
	}
	if((a-b)&1){
		puts("-1");
		return 0;
	}
	int j=1;
	for(int i=1;i<=b;++i)
		if(A[j]<B[i]){
			if(j>=a){
				puts("-1");
				return 0;
			}
			while(A[j]<B[i]){
				if(j>=a){
					puts("-1");
					return 0;
				}
				Ans+=A[j+1]-A[j];
				j+=2;
			}
			if(j>a){
				puts("-1");
				return 0;
			}
			Ans+=A[j]-B[i];
			j++;
		}else{
			Ans+=A[j]-B[i];
			j++;
		}
	for(int i=j;i<=a;i+=2)Ans+=A[i+1]-A[i];
	printf("%lld\n",Ans);
	return 0;
}


#include<iostream>
#include<vector>
#include<string>
#include<queue>
#include<map>
#include<algorithm>

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

int main(){
  ll l;
  cin >> l;
  ld prod = 1;

  for(int i=1;i <= 11;i++){
    if(i == l-11) break;
    prod *= (l-i);
    prod /= i;
  }
  ll ans = (ll)prod;
  cout << ans << endl;
  return 0;
}

/******************************
Author: jhnah917(Justice_Hui)
g++ -std=c++14 -DLOCAL
******************************/

#include <bits/stdc++.h>
#define x first
#define y second
#define all(v) v.begin(), v.end()
#define compress(v) sort(all(v)), v.erase(unique(all(v)), v.end())
using namespace std;

typedef long long ll;

int N;
ll D[222][222];

int main(){
    ios_base::sync_with_stdio(false); cin.tie(nullptr);
    cin >> N;
    D[0][0] = 1;
    for(int i=1; i<=N; i++) D[i][0] = 1;
    for(int i=1; i<=N; i++){
        for(int j=1; j<=i; j++) D[i][j] = D[i-1][j] + D[i-1][j-1];
    }
    cout << D[N-1][11];
}


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

bool ok(long long dx, long long dy, long long R) {
    return dx * dx + dy * dy <= R * R;
}
long long f(long long x, long long y, long long R, long long lim) {
    int l = 0, r = 1;
    long long res = 0;
    for (int i = int(1e9) + 50000; i >= lim; i -= 10000) {
        while (ok(r * 10000 - x, i - y, R)) r++;
        while (ok(l * 10000 - x, i - y, R)) l--;
        res += r - l - 1;
    }
    return res;
}

int main() {
    long double sx, sy, sr;
    cin >> sx >> sy >> sr;
    long long X = round(sx * 10000LL), Y = round(sy * 10000LL),
              R = round(sr * 10000LL);
    X %= 10000;
    Y %= 10000;
    long long ans = f(X, Y, R, 10000);
    ans += f(X, -Y, R, 0);
    cout << ans << endl;
}

#include <algorithm>
#include <cctype>
#include <cmath>
#include <cstring>
#include <iostream>
#include <sstream>
#include <numeric>
#include <map>
#include <set>
#include <queue>
#include <vector>

using namespace std;

typedef long long LL;
typedef long double LD;
const LD EPS = 1e-14;

LL solve(long double X, long double Y, long double R) {
	LL ans = 0, cx = LL(round(X * 10000)), cy = LL(round(Y * 10000)), r = LL(round(R * 10000));
	for (LL y = (cy - r) / 10000 - 1; y <= (cy + r) / 10000; ++y) {
		LL dy = y * 10000 - cy;
		if (dy * dy > r * r) continue;
		long double w = sqrt((long double)(r * r - dy * dy));
		LL left = (cx - LL(w)) / 10000 - 2, right = (cx + LL(w)) / 10000 + 2;
		for (int i = 0; i < 4; ++i) {
			LL dx = left * 10000 - cx;
			if (dx * dx + dy * dy > r * r) {
				++left;
			}
			dx = right * 10000 - cx;
			if (dx * dx + dy * dy > r * r) {
				--right;
			}
		}
		ans += max(0LL, right - left + 1);
	}
	return ans;
}

LL solve2(long double X, long double Y, long double R) {
	LL ans = 0;
	for (LL y = Y - R - 1; y <= Y + R + 1; ++y) {
		LD w = sqrt(max((LD)0.0, R * R - (y - Y) * (y - Y)));
		LL left = X - w - 1, right = X + w + 1;
		for (int i = 0; i < 2; ++i) {
			if (((left - X) * (left - X) + (Y - y) * (Y - y)) > R * R + EPS) {
				++left;
			}
			if (((right - X) * (right - X) + (Y - y) * (Y - y)) > R * R + EPS) {
				--right;
			}
		}
		ans += max(0LL, right - left + 1);
	}
	return ans;
}

int main() {
	long double X, Y, R;
	std::cin >> X >> Y >> R;
	cout << solve(X, Y, R) << endl;

#ifdef NDEBUG
	for (int t = 0; t < 10000000; ++t) {
		int x = (rand() % 10000) + 1;
		int y = (rand() % 10000) + 1;
		int r = (rand() % 10000) + 1;
		LD X = x * 0.0001;
		LD Y = y * 0.0001;
		LD R = r * 0.0001;
		X += rand() % 10;
		Y += rand() % 10;
		R += rand() % 10;

		LL a = solve(X, Y, R);
		LL b = solve2(X, Y, R);
		if (a != b) {
			cout << a << endl;
			cout << b << endl;
			cout << X << "," << Y << "," << R << endl;
			break;
		}
	}
#endif

	return 0;
}


//#include <bits/stdc++.h>
#include <iostream>
#include <iomanip>
#include <math.h>
#include <cmath>
#include <algorithm>
#include <climits>
#include <functional>
#include <cstring>
#include <string>
#include <cstdlib>
#include <ctime>
#include <cstdio>
#include <vector>
#include <stack>
#include <queue>
#include <deque>
#include <map>
#include <set>
#include <bitset>
#include <complex>
//#include <ext/pb_ds/assoc_container.hpp>
//#include <ext/pb_ds/tree_policy.hpp>
#define itn int
#define nit int
#define ll long long
#define ms multiset
#define F(i,a,b) for(register int i=a,i##end=b;i<=i##end;++i)
#define UF(i,a,b) for(register int i=a,i##end=b;i>=i##end;--i)
#define re register
#define ri re int
#define il inline
#define pii pair<int,int>
#define cp complex<double>
//#pra gma G CC opti mize(3)
using namespace std;
using std::bitset;
//using namespace __gnu_pbds;
const double Pi=acos(-1);
namespace fastIO {
	template<class T>
	inline void read(T &x) {
		x=0;
		bool fu=0;
		char ch=0;
		while(ch>'9'||ch<'0') {
			ch=getchar();
			if(ch=='-')fu=1;
		}
		while(ch<='9'&&ch>='0') x=(x*10-48+ch),ch=getchar();
		if(fu)x=-x;
	}
	inline int read() {
		int x=0;
		bool fu=0;
		char ch=0;
		while(ch>'9'||ch<'0') {
			ch=getchar();
			if(ch=='-')fu=1;
		}
		while(ch<='9'&&ch>='0') x=(x*10-48+ch),ch=getchar();
		return fu?-x:x;
	}
	char _n_u_m_[40];
	template<class T>
	inline void write(T x ) {
		if(x==0){
			putchar('0');
			return;
		}
		T tmp = x > 0 ? x : -x ;
		if( x < 0 ) putchar('-') ;
		register int cnt = 0 ;
		while( tmp > 0 ) {
			_n_u_m_[ cnt ++ ] = tmp % 10 + '0' ;
			tmp /= 10 ;
		}
		while( cnt > 0 ) putchar(_n_u_m_[ -- cnt ]) ;
	}
	template<class T>
	inline void write(T x ,char ch) {
		write(x);
		putchar(ch);
	}
}
using namespace fastIO;
const int MAXN=200002;
int n,t1,t2,f[MAXN],dfn,ans[MAXN],d[MAXN];
vector<int>g[MAXN],c[MAXN];
bool vis[MAXN];
inline void make_tree(int pos){
	vis[pos]=1;ri nxt;
	F(i,0,g[pos].size()-1){
		nxt=g[pos][i];
		if(!vis[nxt]){
			f[nxt]=pos;
			c[pos].push_back(nxt);
			make_tree(nxt);
		}
	}
}
inline int play(int pos,int dp){
	vis[pos]=1;ri rt=pos;d[pos]=dp;
	F(i,0,g[pos].size()-1)
	{
		if(!vis[g[pos][i]]){
			ri nxt=play(g[pos][i],dp+1);
			if(d[nxt]>d[rt])rt=nxt;
		}
	}return rt;
}
inline void dfs(int pos){
	ans[pos]=++dfn;
	F(i,0,c[pos].size()-1){
		dfs(c[pos][i]);++dfn;
	}
}
#define mark vis
inline bool cmp(int x,int y){
	return mark[x]<mark[y];
}
int main(){
    cin>>n;
    F(i,2,n){
    	t1=read(),t2=read();
    	g[t1].push_back(t2);
    	g[t2].push_back(t1);
	}
	memset(vis,0,sizeof(vis));
	int p1=play(1,0);
	memset(vis,0,sizeof(vis));
	int p2=play(p1,0);
	memset(vis,0,sizeof(vis));
	make_tree(p1);
	memset(vis,0,sizeof(vis));
	ri qwq=p2;
	while(qwq)mark[qwq]=1,qwq=f[qwq];
	F(i,1,n)if(c[i].size()>1)sort(c[i].begin(),c[i].end(),cmp);
	dfs(p1);
	F(i,1,n)write(ans[i],' ');
    return 0;
}

/*
             author:ryo3ihara
            　　　　　　　”継続は力なり、雨だれ石を穿つ”
            　　　　　　　　　　”slow but steady wins the race”

*/

#pragma GCC optimize("Ofast")
#include<bits/stdc++.h>

//#include<atcoder/all>
//using namespace atcoder;

/*
// 多倍長テンプレ
#include <boost/multiprecision/cpp_dec_float.hpp>
#include <boost/multiprecision/cpp_int.hpp>
namespace mp = boost::multiprecision;
// 任意長整数型
using Bint = mp::cpp_int;
// 仮数部が1024ビットの浮動小数点数型(TLEしたら小さくする)
using Real = mp::number<mp::cpp_dec_float<1024>>;
*/

using namespace std;
using ll = long long;
using ld = long double;
using pll = pair<ll, ll>;
using pli = pair<ll, int>;
using pii = pair<int, int>;
using pld = pair<ll, ld>;
using ppiii =  pair<pii, int>;
using ppiill = pair<pii, ll>;
using ppllll = pair<pll, ll>;
using pplii = pair<pli, int>;
using mii = map<int, int>;
using dll = deque<ll>;
using qll = queue<ll>;
using pqll = priority_queue<ll>;
using pqrll = priority_queue<ll, vector<ll>, greater<ll>>;
using vint = vector<int>;
using vll = vector<ll>;
using vpll = vector<pll>;
using vvll = vector<vector<ll>>;
using vvint = vector<vector<int>>;
using vvpll = vector<vector<pll>>;

//マクロ
//forループ
#define REP(i,n) for(ll i=0;i<ll(n);i++)
#define REPD(i,n) for(ll i=n-1;i>=0;i--)
#define FOR(i,a,b) for(ll i=a;i<=ll(b);i++)
#define FORD(i,a,b) for(ll i=a;i>=ll(b);i--)
#define ALL(x) x.begin(),x.end()
#define SIZE(x) ll(x.size())
#define fs first
#define sc second
//定数
const ll MOD = 1000000007;
const int inf = 1e9;
const ll INF = 1e18;
const ll MAXR = 100000; //10^5:配列の最大のrange

inline void Yes(bool b = true) { cout << (b ? "Yes" : "No") << '\n'; }
inline void YES(bool b = true) { cout << (b ? "YES" : "NO") << '\n'; }

//最大化問題最小化問題
template<class T> inline bool chmin(T& a, T b) {
    if (a > b) {
        a = b;
        return true;
    }
    return false;
}
template<class T> inline bool chmax(T& a, T b) {
    if (a < b) {
        a = b;
        return true;
    }
    return false;
}
//高速冪乗化　modの時は一部入れ替える
ll power(ll x, ll y) {
    if(y == 1) {
        return x;
    }
    ll ans;
    if(y % 2 == 1) {
        ll r = power(x,(y-1)/2);
        //ans = r * r % MOD;
        //ans = ans * x % MOD;
        ans = x * r * r;
    }
    else {
        ll r = power(x,y/2);
        //ans = r * r % MOD;
        ans = r * r;
    }
    return ans;
}
/*
Bint powerb(Bint x, Bint y) {
    if(y == 1) {
        return x;
    }
    Bint ans;
    if(y % 2 == 1) {
        Bint r = powerb(x,(y-1)/2);
        //ans = r * r % MOD;
        //ans = ans * x % MOD;
        ans = x * r * r;
    }
    else {
        Bint r = powerb(x,y/2);
        //ans = r * r % MOD;
        ans = r * r;
    }
    return ans;
}
*/

signed main(){
    //入力の高速化用のコード
    ios::sync_with_stdio(false);
    cin.tie(nullptr);

    //入力
    double Sx,Sy,Gx,Gy;
    cin >> Sx >> Sy >> Gx >> Gy;

    double ok = Sx,ng=Gx;
    double mid;
    REP(i,10000){
        mid = ok + (ng-ok)/2;
        if((Sy/abs(Sx-mid))>(Gy/abs(Gx-mid))) ok = mid;
        else ng = mid;
    }

    //本文
    //cout << ans << endl;

    //出力
    //cout << ans << endl;
    cout << fixed << setprecision(10) << mid << endl;
  return 0;
}


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

int main() {
  	// 入力
	vector<int> taste(4);
  	bool EQUAL = false;
  	for(int i=0; i<4; i++){
      	cin >> taste.at(i);
    }
  	// 入力終わり
  	sort(taste.begin(),taste.end());
  	if(taste.at(0)+taste.at(3) == taste.at(1)+taste.at(2)){
      	EQUAL = true;
    }else if(taste.at(0)+taste.at(1)+taste.at(2) == taste.at(3)){
      	EQUAL = true;
    }else if(taste.at(0)+taste.at(1)==taste.at(2)+taste.at(3)){
		EQUAL = true;
    }
  	if(EQUAL) cout << "Yes" << endl;
  	else cout << "No" << endl;
}

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
typedef queue<int> qi;
typedef vector<int> vi;
typedef vector<char> vc;
typedef vector<ll> vll;
typedef vector<pair<int, int>> vpii;
typedef multiset<int> msi;
typedef vector<vector<int>> vvi;
typedef queue<int> di;
typedef multimap<int, int> mmii;
// -------------------------------------------------
// https://atcoder.jp/contests/abc198/tasks/abc198_c
// -------------------------------------------------

int main() {

	ll r, x, y;
	cin >> r >> x >> y;
	ld d = sqrt(x * x + y * y);
	// cout << "d:" << d << ", r:" << r << endl;
	// ll ans = d==r ? 1 : (d!=r&&d<=2*r ? 2 : ceil((ld)d/r));
	ll ans = d!=r&&d<=2*r ? 2 : ceil((ld)d/r);
	cout << ans << endl;

}


#include<bits/stdc++.h>
using namespace std;
#define arep(i,x,n) for(int i=int(x);i<(int)(n);i++)
#define rep(i,n) for(long long i = 0;i < n;++i)
#define rrep(i,n) for(int i=int(n-1);i>=0;i--)
#define fs first
#define sc second
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define coy cout<<"Yes"<<endl
#define con cout<<"No"<<endl
#define pi 3.141592653589793
#define eps 0.00000001
#define INF 1e9+7
#define LINF 1e18+10
using ll = long long;

using P = pair<int, int>;
using lP = pair<ll, ll>;
using fP = pair<double, double>;
using PPI = pair<P, int>;
using PIP = pair<int, P>;
using Ps = pair<int, string>;

using vi = vector<int>;
using vl = vector<ll>;
using vc = vector<char>;
using vd = vector<double>;
using vs = vector<string>;
using vp = vector<P>;
using vb = vector<bool>;
using vvi = vector<vector<int>>;
using vvl = vector<vector<ll>>;
using vvd = vector<vector<double>>;
using vvc = vector<vector<char>>;
using vvp = vector<vector<P>>;
using vvb = vector<vector<bool>>;
template <typename T>
bool chmax(T& a, const T b) { if (a < b) { a = b; return true; } return false; }
template <typename T>
bool chmin(T& a, const T b) { if (a > b) { a = b; return true; } return false; }

//const ll mod=998244353;
const ll mod = 1e9 + 7;
const ll MAX = 300000;
template <typename T>
T abs(T a) { if (a < 0)return -a; else return a; }//2020/09/30 stdlib has abs(long) abs(long long) error

//////////////////////////////////////
ll x,y,a,b;

int main(){

  cin>>x>>y>>a>>b;
  ll ans=0;
  y--;
  while(x<b&&x<y){
    x*=a;
    ans++;
  }
  if(x>y){
    cout<<ans-1<<endl;
    return 0;
  }
  ans+=(y-x)/b;
  cout<<ans<<endl;
  return 0;
}

#include <iostream>
#include <set>
using namespace std;
typedef long long ll;
int main() {
	ll x, y, a, b; cin >> x >> y >> a >> b;
	ll exp = 0;
	while ((double)a*x < 2e18 && a*x <= x+b && a*x < y) {
		x = a * x; exp++;
	}
	if (x < y) {
		exp += (y - x - 1) / b;
	}
	cout << exp;
}


#include <algorithm>
#include <climits> // FOO_MAX, FOO_MIN
#include <cmath>
#include <cstdlib> // abs(int)
#include <deque>
#include <iomanip>
#include <iostream>
#include <map>
#include <numeric>
#include <string>
#include <vector>

using namespace std;

#define roundup(n, d) (((n) + ((d)-1)) / (d))
#define assign_max(into, compared) (into = max((into), (compared)))
#define assign_min(into, compared) (into = min((into), (compared)))
#define rep(i, n) for (long long i = 0; i < n; ++i)
#define v_in(v)        \
    for (auto&& i : v) \
    cin >> i
#define vv_in(vv) rep(I, (long long)vv.size()) for (auto&& J : vv[I]) cin >> J
#define FAST_IO                  \
    ios::sync_with_stdio(false); \
    cin.tie(nullptr);
#define fix(n) fixed << setprecision(n)
#define ALL(v) v.begin(), v.end()
#define printvar(x) cout << #x << ":" << x << endl

#define PI 3.14159265358979323846

using ll = long long;
using ull = unsigned long long;
using vll = vector<long long>;
using vvll = vector<vector<long long>>;

int main(void) {
    ll n, x;
    cin >> n >> x;
    ll x100 = x * 100;

    vvll in(n, vll(2));
    vv_in(in);

    ll sum = 0;
    rep(i, n) {
        sum += in[i][0] * in[i][1];
        if (sum > x100) {
            cout << i + 1 << endl;
            return 0;
        }
    }

    cout << -1 << endl;
    return 0;
}

#include <iostream>
#include <complex>
#include <vector>
#include <string>
#include <algorithm>
#include <cstdio>
#include <numeric>
#include <cstring>
#include <ctime>
#include <cstdlib>
#include <set>
#include <map>
#include <unordered_map>
#include <unordered_set>
#include <list>
#include <cmath>
#include <bitset>
#include <cassert>
#include <queue>
#include <stack>
#include <deque>
#include <random>

using namespace std;
template<typename T1, typename T2> inline void chkmin(T1 &a, T2 b) {if (a > b) a = b;}
template<typename T1, typename T2> inline void chkmax(T1 &a, T2 b) {if (a < b) a = b;}
#define files(FILENAME) read(FILENAME); write(FILENAME)
#define read(FILENAME) freopen((FILENAME + ".in").c_str(), "r", stdin)
#define write(FILENAME) freopen((FILENAME + ".out").c_str(), "w", stdout)
#define all(c) (c).begin(), (c).end()
#define sz(c) (int)(c).size()
#define left left228
#define right right228
#define y1 y1228
#define mp make_pair
#define pb push_back
#define y2 y2228
#define rank rank228
using ll = long long;
using ld = long double;
const string FILENAME = "input";

int n;

int main() {
	ios_base::sync_with_stdio(false);
	cin.tie(0);
	cout.tie(0);
	//read(FILENAME);
	cin >> n;
	string s, t;
	cin >> s >> t;
	int cnt = 0, cnt1 = 0;
	for (auto x: s) {
		if (x == '1') {
			cnt++;
		}
	}
	for (auto y: t) {
		if (y == '1') {
			cnt1++;
		}
	}
	if (cnt < cnt1) {
		cout << -1 << '\n';
		return 0;
	}
	if (cnt % 2 != cnt1 % 2) {
		cout << -1 << '\n';
		return 0;
	}
	vector<int> st;
	for (int i = 0; i < n; i++) {
		if (t[i] == '1') {
			st.pb(i);
		}
	}
	vector<int> st1;
	for (int i = 0; i < n; i++) {
		if (s[i] == '1') {
			st1.pb(i);
		}
	}
	int uk = 0;
	ll ans = 0;
	for (auto x: st) {
		while (true) {
			if (uk >= sz(st1)) {
				cout << -1 << '\n';
				exit(0);
			}
			if (st1[uk] < x) {
				if (uk + 1 == sz(st1)) {
					cout << -1 << '\n';
					exit(0);
				}
				ans += st1[uk + 1] - st1[uk];
				uk+= 2;
			} else {
				ans += st1[uk] - x;
				uk++;
				break;
			}
		}
	}
	if (uk < sz(st1)) {
		for (int j = uk; j < sz(st1); j += 2) {
			ans += st1[j + 1] - st1[j];
		}
	}
	cout << ans << '\n';
}


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

#define hyperspeed           \
    ios::sync_with_stdio(0); \
    cin.tie(0);
#define INF 1000000000000000003
typedef long long ll;
typedef vector<ll> vi;
typedef pair<ll, ll> pi;
#define PB push_back
#define PF push_front
#define POB pop_back
#define MP make_pair
#define ff first
#define ss second
#define BS binary_search
#define LB lower_bound
#define UB upper_bound
#define all(x) (x).begin(),(x).end()
#define ln(x) (ll)x.length()
#define sz(x) (ll)x.size()
#define nl '\n'
#define goog(x) cout<<"Case #"<<i<<": ";
#define MAX 1000006

const unsigned int MOD = 1000000007;

inline ll ceilM(ll a, ll b) { return (a / b) + ((a % b) != 0);} //O(1);
ll gcd(ll a, ll b) {if (a == 0)return b; return gcd(b % a, a);} //O(log min(a, b));
bool isPrime(ll n) {if (n < 2) return 0; ll i = 2; while (i * i <= n) {if (n % i == 0) return 0; i++;} return 1;} //(O(sqrt(n)))

ll arr[MAX];

void solve()
{
	//cout << "hey" << endl;
	ll a, b;
	cin >> a >> b;
	double ans = (b * a) / 100.0;
	cout << fixed << setprecision(7) << ans << endl;

}

int main()
{
	hyperspeed;

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

	solve();

	return 0;
}

#include <bits/stdc++.h>
using namespace std;
#define   IOS ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);
#define   mp make_pair
#define   pb push_back
#define   ll long long
#define   ld long double
#define   debug(x)  cout << '[' << #x << " is: " << x << "] " << endl;
#define   rsor(v)   sort(v.rbegin() , v.rend());
#define   rev(v)    reverse(v.begin() , v.end());
#define   sz(x)     (int)(x).size()
#define   all(x)    x.begin(), x.end()
#define  _cout(v)  for(auto f : v ) cout << f << " " ;
#define  _cin(v)   for(auto &it : v)cin >> it ;
#define  vi vector<int>
#define  fs first
#define  sc second

const int mod =1e9+7;
int32_t main() {
    IOS;
    int a,b,c;
    cin>>b>>c;
    if(b==0||c==0){
        cout<<0;
        return 0;
    }
    cout<<fixed<<setprecision(5);
    cout<<(long double)(b*c)/100;

}


#include <bits/stdc++.h>
using i64 = long long;
#define REP(i, n) for (int i = 0, REP_N_ = int(n); i < REP_N_; ++i)
#define ALL(x) std::begin(x), std::end(x)

template <class T>
inline bool chmax(T &a, T b) {
  return a < b and ((a = std::move(b)), true);
}
template <class T>
inline bool chmin(T &a, T b) {
  return a > b and ((a = std::move(b)), true);
}

template <typename T>
std::istream &operator>>(std::istream &is, std::vector<T> &a) {
  for (auto &x : a) is >> x;
  return is;
}

using namespace std;

int main() {
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
  const int L = 100'000'000;

  int n, m;
  cin >> n >> m;
  vector<i64> w(n);
  cin >> w;
  vector<i64> vlmax(L + 1);
  i64 lmax = 0;
  i64 vmin = 1e9;
  REP(i, m) {
    i64 l, v;
    cin >> l >> v;
    chmax(vlmax[v], l);
    chmax(lmax, l);
    chmin(vmin, v);
  }
  if (vmin < *max_element(ALL(w))) {
    cout << -1 << endl;
    exit(0);
  }
  REP(i, L) { vlmax[i + 1] = max(vlmax[i], vlmax[i + 1]); }

  auto get_len = [&](i64 w) {
    if (w > L) return lmax;
    return vlmax[w - 1];
  };

  vector<int> camels(n);
  REP(i, n) { camels[i] = i; }

  i64 ans = (n - 1) * lmax;
  do {
    vector<i64> pos(n);
    pos[0] = 0;
    for (int i = 1; i < n; ++i) {
      i64 w_sub = w[camels[i]];
      for (int j = i - 1; j >= 0; --j) {
        w_sub += w[camels[j]];
        i64 len = get_len(w_sub);
        chmax(pos[i], pos[j] + len);
      }
    }
    chmin(ans, pos[n - 1]);
  } while (next_permutation(ALL(camels)));

  cout << ans << endl;
}

#include <bits/stdc++.h>
#define sz(a) a.size()
#define pb(a) push_back(a)
#define all(a) a.begin(),a.end()
#define mem(a,b) memset(a,b,sizeof(a))
#define rep(i,a,b) for(int i=a;i<b;i++)
using namespace std;typedef long long ll;const ll mod=1e9+7;
#define inf 0x3f3f3f3f
const int M=1e4+7,N=4e5+7;
int T;

int n,m;
vector<int> va[N];
int cx[N],cy[N],dx[N],dy[N];
int u[N],v[N];
bool vis[N];
int nx,ny,k,dis;
bool searchpath()
{
	queue<int> q;
	dis=inf;
	memset(dx,-1,sizeof(dx));
	memset(dy,-1,sizeof(dy));
	for(int i=1;i<=nx;i++){
		if(cx[i]==-1){
			q.push(i);
			dx[i]=0;
		}
	}
	while(!q.empty()){
		int u=q.front();
		q.pop();
		if(dx[u]>dis) break;
		for(int i=0,vv;i<va[u].size();i++){
            vv=va[u][i];
			if(dy[vv]==-1){
				dy[vv]=dx[u]+1;
				if(cy[vv]==-1) dis=dy[vv];
				else{
					dx[cy[vv]]=dy[vv]+1;
					q.push(cy[vv]);
				}
			}
		}
	}
	return dis!=inf;
}
int find(int u)
{
	for(int i=0,vv;i<va[u].size();i++){
        vv=va[u][i];
		if(!vis[vv]&&dy[vv]==dx[u]+1){
			vis[vv]=1;
			if(cy[vv]!=-1&&dy[vv]==dis) continue;
			if(cy[vv]==-1||find(cy[vv])){
				cy[vv]=u;cx[u]=vv;
				return true;
			}
		}
	}
	return false;
}
int MaxMatch(){
	int res=0;
	memset(cx,-1,sizeof(cx));
	memset(cy,-1,sizeof(cy));
	while(searchpath()){
		memset(vis,0,sizeof(vis));
		for(int i=1;i<=nx;i++){
			if(cx[i]==-1){
				res+=find(i);
			}
		}
	}
	return res;
}
int main()
{
    scanf("%d",&n);
    k=nx=ny=n;
    for(int i=1;i<=n;i++){
        scanf("%d%d",&u[i],&v[i]);
        nx=ny=max(nx,max(u[i],v[i]));
        va[i].pb(u[i]);
        va[i].pb(v[i]);
        //va[u[i]].pb(v[i]);
    }
	printf("%d\n",MaxMatch());

    return 0;
}
/***
4
1 2
1 3
4 2
2 3

12
5 2
5 6
1 2
9 7
2 7
5 5
4 2
6 7
2 2
7 8
9 7
1 8

***/


#include <bits/stdc++.h>

using namespace std;

struct dsuflipcard {
  vector<int> par, edgeincomp;
  dsuflipcard(int n) {
    par.assign(n + 1, -1);
    edgeincomp.assign(n + 1, 0);
  }
  int find(int u) {
    if (par[u] < 0) return u;
    return par[u] = find(par[u]);
  }
  void join(int u, int v) {
    u = find(u); v = find(v);
    if (u == v) {
      ++edgeincomp[u];
      return;
    }
    par[u] += par[v];
    par[v] = u;
    edgeincomp[u] += edgeincomp[v] + 1;
  }
  int takeflipcol(void) {
    int ans = 0;
    for (int i = 1; i < par.size(); ++i) {
      if (par[i] < 0) {
        ans += min(-par[i], edgeincomp[i]);
      }
    }
    return ans;
  }
};

signed main(void) {
  ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
  if (fopen("input.txt", "r")) {
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
  }
  const int maxn = 4e5 + 5;
  int n;
  cin >> n;
  dsuflipcard cards(maxn);
  while (n--) {
    int u, v;
    cin >> u >> v;
    cards.join(u, v);
  }
  cout << cards.takeflipcol();
}

#include <bits/stdc++.h>
#define all(v) v.begin(), v.end()
#define rall(v) v.rbegin(), v.rend()
#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define drep(i,j,n) for(int i=0;i<(int)(n-1);i++)for(int j=i+1;j<(int)(n);j++)
#define trep(i,j,k,n) for(int i=0;i<(int)(n-2);i++)for(int j=i+1;j<(int)(n-1);j++)for(int k=j+1;k<(int)(n);k++)
#define codefor int test;scanf("%d",&test);while(test--)
#define INT(...) int __VA_ARGS__;in(__VA_ARGS__)
#define LL(...) ll __VA_ARGS__;in(__VA_ARGS__)
#define yes(ans) if(ans)printf("yes\n");else printf("no\n")
#define Yes(ans) if(ans)printf("Yes\n");else printf("No\n")
#define YES(ans) if(ans)printf("YES\n");else printf("NO\n")
#define vector1d(type,name,...) vector<type>name(__VA_ARGS__)
#define vector2d(type,name,h,...) vector<vector<type>>name(h,vector<type>(__VA_ARGS__))
#define vector3d(type,name,h,w,...) vector<vector<vector<type>>>name(h,vector<vector<type>>(w,vector<type>(__VA_ARGS__)))
#define umap unordered_map
#define uset unordered_set
using namespace std;
using ll = long long;
const int MOD=1000000007;
const int MOD2=998244353;
const int INF=1<<30;
const ll INF2=(ll)1<<60;
//入力系
void scan(int& a){scanf("%d",&a);}
void scan(long long& a){scanf("%lld",&a);}
template<class T,class L>void scan(pair<T, L>& p){scan(p.first);scan(p.second);}
template<class T> void scan(T& a){cin>>a;}
template<class T> void scan(vector<T>& vec){for(auto&& it:vec)scan(it);}
void in(){}
template <class Head, class... Tail> void in(Head& head, Tail&... tail){scan(head);in(tail...);}
//出力系
void print(const int& a){printf("%d",a);}
void print(const long long& a){printf("%lld",a);}
void print(const double& a){printf("%.15lf",a);}
template<class T,class L>void print(const pair<T, L>& p){print(p.first);putchar(' ');print(p.second);}
template<class T> void print(const T& a){cout<<a;}
template<class T> void print(const vector<T>& vec){if(vec.empty())return;print(vec[0]);for(auto it=vec.begin();++it!= vec.end();){putchar(' ');print(*it);}}
void out(){putchar('\n');}
template<class T> void out(const T& t){print(t);putchar('\n');}
template <class Head, class... Tail> void out(const Head& head,const Tail&... tail){print(head);putchar(' ');out(tail...);}
//デバッグ系
template<class T> void dprint(const T& a){cerr<<a;}
template<class T> void dprint(const vector<T>& vec){if(vec.empty())return;cerr<<vec[0];for(auto it=vec.begin();++it!= vec.end();){cerr<<" "<<*it;}}
void debug(){cerr<<endl;}
template<class T> void debug(const T& t){dprint(t);cerr<<endl;}
template <class Head, class... Tail> void debug(const Head& head, const Tail&... tail){dprint(head);cerr<<" ";debug(tail...);}
ll intpow(ll a, ll b){ ll ans = 1; while(b){ if(b & 1) ans *= a; a *= a; b /= 2; } return ans; }
ll modpow(ll a, ll b, ll p){ ll ans = 1; while(b){ if(b & 1) (ans *= a) %= p; (a *= a) %= p; b /= 2; } return ans; }
ll updivide(ll a,ll b){if(a%b==0) return a/b;else return (a/b)+1;}
template<class T> void chmax(T &a,const T b){if(b>a)a=b;}
template<class T> void chmin(T &a,const T b){if(b<a)a=b;}

int main(){
    INT(a,b,x,y);
    int ans=0;
    if(a>b){
        ans=min((a-b-1)*2*x+x,x+(a-b-1)*y);
    }else if(a==b){
        ans=x;
    }else{
        ans=min(2*x*(b-a)+x,(b-a)*y+x);
    }
    out(ans);
}


    #include <bits/stdc++.h>
    using namespace std;
    #include <math.h>
    #include <iomanip>
    #include <cstdint>
    #include <string>
    #include <sstream>
    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; }
    #define rep(i,n) for (int i = 0; i < (n); ++i)
    typedef long long ll;
    using P=pair<ll,ll>;
    const int INF=1001001001;
    const int mod=998244353;

    struct mint {
      ll x;
      mint(ll x=0):x((x%mod+mod)%mod){}
      mint operator-() const { return mint(-x);}
      mint& operator+=(const mint a) {
        if ((x += a.x) >= mod) x -= mod;
        return *this;
      }
      mint& operator-=(const mint a) {
        if ((x += mod-a.x) >= mod) x -= mod;
        return *this;
      }
      mint& operator*=(const mint a) { (x *= a.x) %= mod; return *this;}
      mint operator+(const mint a) const { return mint(*this) += a;}
      mint operator-(const mint a) const { return mint(*this) -= a;}
      mint operator*(const mint a) const { return mint(*this) *= a;}
      mint pow(ll t) const {
        if (!t) return 1;
        mint a = pow(t>>1);
        a *= a;
        if (t&1) a *= *this;
        return a;
      }

      mint inv() const { return pow(mod-2);}
      mint& operator/=(const mint a) { return *this *= a.inv();}
      mint operator/(const mint a) const { return mint(*this) /= a;}
     };
      istream& operator>>(istream& is, const mint& a) { return is >> a.x;}
      ostream& operator<<(ostream& os, const mint& a) { return os << a.x;}
      struct combination {
      vector<mint> fact, ifact;
      combination(int n):fact(n+1),ifact(n+1) {
        assert(n < mod);
        fact[0] = 1;
        for (int i = 1; i <= n; ++i) fact[i] = fact[i-1]*i;
        ifact[n] = fact[n].inv();
        for (int i = n; i >= 1; --i) ifact[i-1] = ifact[i]*i;
      }
      mint operator()(int n, int k) {
        if (k < 0 || k > n) return 0;
        return fact[n]*ifact[k]*ifact[n-k];
      }
     } c(2000005);

    int main() {
      int N,K;
      cin>>N>>K;
      vector<ll>A(N);
      rep(i,N){cin>>A[i];}
      vector<mint>sum(K+1);
      rep(i,N){
        mint now=1;
        rep(j,K+1){
          sum[j]+=now;
          now*=A[i];
        }
      }
      for(int x=1;x<=K;x++){
        mint ans=0;
        for(int i=0;i<=x;i++){
          ans+=c(x,i)*sum[i]*sum[x-i];
        }
        ans-=mint(2).pow(x)*sum[x];
        cout<<ans/2<<endl;
      }
      return 0;
    }

#include <bits/stdc++.h>

typedef long long int64;
typedef unsigned int uint;
typedef unsigned long long uint64;
typedef double db;
typedef long double db64;

const int N = 2e5, K = 300, MOD = 998244353, I2 = (MOD + 1) / 2;

int n, k, a[N + 5], c[K + 5][K + 5];
int64 s[K + 5];

int main() {
	scanf("%d%d", &n, &k);
	for (int i = 0; i <= k; i++) {
		c[i][0] = 1;
		for (int j = 1; j <= i; j++) {
			c[i][j] = (c[i - 1][j] + c[i - 1][j - 1]) % MOD;
		}
	}
	for (int i = 1; i <= n; i++) {
		scanf("%d", &a[i]);
		for (int x = 1, j = 0; j <= k; j++, x = (int64)x * a[i] % MOD) {
			s[j] += x;
		}
	}
	for (int i = 0; i <= k; i++) {
		s[i] %= MOD;
	}
	int pw = 2;
	for (int i = 1; i <= k; i++) {
		int64 ans = 0;
		for (int j = 0; j <= i; j++) {
			ans += (int64)s[j] * s[i - j] % MOD * c[i][j] % MOD;
		}
		ans -= (int64)pw * s[i] % MOD;
		pw = (pw + pw) % MOD;
		ans %= MOD;
		printf("%lld\n", (ans * I2 % MOD + MOD) % MOD);
	}
	return 0;
}


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

int main() {
  long long N, X;
  //string S;

  cin >> N >> X;

  long long ans = X;
  for(int i=0; i<N; i++){
    char c;
    cin >> c;
    if(c=='o'){
      ans++;
    }else{
      if(ans>0) ans--;
    }
  }

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

#include<bits/stdc++.h>
using namespace std;
using ll = long long;
#define rep(i,n) for (ll i = 0; i < (n); ++i)
#define All(v) (v).begin(),(v).end()
#define rall(v) (v).rbegin(),(v).rend()   //reverse
#define strall(v) (v).cbegin(),(v).cend() //const_itterator
#define IN(a, b, x) (a<=x&&x<b)
using namespace std;
using ll = long long;
using Pair = pair<int,int>;
using Graph = vector<vector<ll>>;
template<typename T> using min_priority_queue = priority_queue<T, vector<T>, greater<T>>;
template<typename t, typename u, typename Comp=less<>>
bool chmax(t& xmax, const u& x, Comp comp={}) { if(comp(xmax, x)) { xmax = x; return true; } return false;}
template<typename t, typename u, typename Comp=less<>>
bool chmin(t& xmin, const u& x, Comp comp={}) { if(comp(x, xmin)) { xmin = x; return true;} return false;}
const int INF = 1e9;
const ll infl = ll(1e18)+5;

int main(){
 ll N,x;
 string s;
 int cnt1=0,cnt2=0;
 cin >> N >> x >> s;
 for(int i=0;i<s.size();i++){
   if(s[i] == 'o') x++;
   else{
       if(x == 0) continue;
       x--;
   }
 }
 cout << x << endl;
}


#include <bits/stdc++.h>

#define mp make_pair
#define mt make_tuple
#define fi first
#define se second
#define pb push_back
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define forn(i, n) for (int i = 0; i < (int)(n); ++i)
#define for1(i, n) for (int i = 1; i <= (int)(n); ++i)
#define ford(i, n) for (int i = (int)(n) - 1; i >= 0; --i)
#define fore(i, a, b) for (int i = (int)(a); i <= (int)(b); ++i)

using namespace std;

typedef pair<int, int> pii;
typedef vector<int> 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 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; }

int main() {
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    cout.precision(10);
    cout << fixed;
#ifdef LOCAL_DEFINE
    freopen("input.txt", "rt", stdin);
#endif

    int n;
    cin >> n;
    vector<pii> a(n); // vector<pair<int, int> >
    forn(i, n) { // i = 0 .. n - 1
        cin >> a[i].fi >> a[i].se; // a[i].first, a[i].second
    }
    vector<int> dp(n + 1);
    dp[0] = 1;
    forn(i, n) { // i = 0 .. n - 1
        if (!dp[i]) continue;
        for (int x = 1; i + x <= n; ++x) { // (2 * i + 1, 2 * i + 1 + x), ... (2 * i + x, 2 * i + 2 * x)
            bool okBlock = true;
            for1(y, x) { // y = 1 .. x
                int v1 = 2 * i + y, v2 = v1 + x;
                bool ok = true;
                int fit = 0;
                forn(j, n) {
                    if (a[j].fi == v2 || a[j].se == v1) ok = false;
                    if (a[j].fi != v1 && a[j].se != v2) continue;
                    if (a[j].fi == v1) { // (v1, -1) or (v1, v2)
                        if (a[j].se != -1 && a[j].se != v2) ok = false;
                    }
                    if (a[j].se == v2) {
                        if (a[j].fi != -1 && a[j].fi != v1) ok = false;
                    }
                    // (?, v1)
                    if (ok) ++fit;
                }
                // (v1, -1), (-1, v2)
                okBlock &= ok && fit < 2;
            }
            if (okBlock) {
//                cerr << i << ' ' << x << '\n';
                dp[i + x] = 1;
            }
        }
    }

    // O(n^4)

    cout << (dp[n] ? "Yes" : "No") << '\n';

#ifdef LOCAL_DEFINE
    cerr << "Time elapsed: " << 1.0 * clock() / CLOCKS_PER_SEC << " s.\n";
#endif
    return 0;
}

#include <bits/stdc++.h>
#define ll long long
#define ld long double
#define f first
#define s second
#define dbg(x) cout<< #x <<" "<<x<<"\n";
using namespace std;

void solve(){
    ll n;
    cin>>n;
    vector<string> v(n+1);
    vector<ll> dp(n+1,1);
    for(ll i=1; i<=n; ++i){
        cin>>v[i];
    }
    for(ll i=1; i<=n; ++i){
        if(v[i]=="AND"){
            dp[i] = dp[i-1];
        }
        else{
            dp[i] = dp[i-1] + (1LL<<i);
        }
    }
    cout<<dp[n]<<"\n";
}

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


    #include "bits/stdc++.h"

    using namespace std;

    using ll = long long;
    using vll = vector<ll>;
    using vvll = vector<vector<ll>>;
    using vvvll = vector<vector<vector<ll>>>;
    using vvvvll = vector<vector<vector<vector<ll>>>>;
    using pl4 = pair<ll,ll>;
    using str = string;
    using vpl4 = vector<pair<ll,ll>>;

    #define sz size()
    #define be begin()
    #define en end()
    #define fi first
    #define se second
    #define pb push_back
    #define mp make_pair

    #define llin(x) ll (x);cin >>(x);
    #define stin(x) str (x);cin >>(x);
    #define vllin(x,n) vll (x)(n);FOR(i,0,n-1){cin >>(x)[i];}
    #define vllin2(a,b,n) vll (a)(n);vll (b)(n);FOR(i,0,n-1){cin >>(a)[i]>>(b)[i];}
    #define vllin3(a,b,c,n) vll (a)(n);vll (b)(n);vll (c)(n);FOR(i,0,n-1){cin >>(a)[i]>>(b)[i]>>(c)[i];}
    #define vlling(x,n) (x).assign(n,0);FOR(i,0,n-1){cin >>(x)[i];}
    #define vlling2(a,b,n) (a).assign(n,0);(b).assign(n,0);FOR(i,0,n-1){cin >>(a)[i]>>(b)[i];}
    #define vlling3(a,b,c,n) (a).assign(n,0);(b).assign(n,0);(c).assign(n,0);FOR(i,0,n-1){cin >>(a)[i]>>(b)[i]>>(c)[i];}
    #define vpl4in(x,n) vpl4 (x)((n),mp(0,0));FOR(i,0,n-1){cin >>x[i].fi>>x[i].se;}
    #define FOR(i,a,b) for(ll i = a ; i <= b ; i++)
    #define rFOR(i,b,a) for(ll i = a; i >= b ; i--)
    #define SORT(x) sort(x.be, x.en)
    #define rSORT(x) sort(x.rbegin(), x.rend())
    #define say(x) cout<<(x);
    #define sal(x) cout<<(x)<<endl;
    #define says(x) cout<<(x)<<(' ');
    #define sas cout<<(' ');
    #define sayR(x) cout<<fixed<<setprecision(10)<<(x);
    #define salR(x) cout<<fixed<<setprecision(10)<<(x)<<endl;
    #define yn(a) cout <<((a)?"yes":"no")<<endl;
    #define Yn(a) cout <<((a)?"Yes":"No")<<endl;
    #define YN(a) cout <<((a)?"YES":"NO")<<endl;
    #define Imp(a) cout <<((a)?"Possible":"Impossible")<<endl;
    #define IMP(a) cout <<((a)?"POSSIBLE":"IMPOSSIBLE")<<endl;
    #define pow(a,b) ll(pow(a,b))

    ll MOD=1000000007;
    ll INF=100000000000001;
    vector<ll> value; // ノードの値を持つ配列
    ll N;             // 葉の数

    void update(ll i, ll x) {
        // i 番目の葉の値を x に変える
        i += N - 1; // i 番目の葉のノード番号
        value[i] = x;
        while (i > 0) {
            i = (i - 1) / 2; // ノード i の親ノードの番号に変える
            value[i] = min(value[i * 2 + 1],
                        value[i * 2 + 2]); // 左右の子の min を計算しなおす
        }
    }

    ll query(ll a, ll b, ll k, ll l, ll r) {
        // [a, b) の区間に対するクエリについて
        // ノード k （区間 [l, r) 担当）が答える
        if (r <= a || b <= l) return INF; // 区間が被らない場合は INF を返す
        if (a <= l && r <= b)
            return value[k]; // ノード k の担当範囲がクエリ区間 [a, b)
                            // に完全に含まれる
        else {
            ll c1 = query(a, b, 2 * k + 1, l, (l + r) / 2); // 左の子に値を聞く
            ll c2 = query(a, b, 2 * k + 2, (l + r) / 2, r); // 右の子に値を聞く
            return min(c1, c2); // 左右の子の値の min を取る
        }
    }

long long mi(long long a) {
    ll m=MOD;
    long long b = m, u = 1, v = 0;
    while (b) {
        long long t = a / b;
        a -= t * b; swap(a, b);
        u -= t * v; swap(u, v);
    }
    u %= m;
    if (u < 0) u += m;
    return u;
}

signed main(){
    llin(a);
    llin(b);
    llin(c);
    llin(d);
    sal(a*d-b*c)
}

#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define yes {cout<<"Yes"<<endl;return 0;}
#define no {cout<<"No"<<endl;return 0;}
#define INF 2147483647
#define LINF 9223372036854775807
int DigitSum(int n1)
{
    int digitsum;
    digitsum=0;
    while(n1!=0)
    {
        digitsum+=n1%10;
        n1=n1/10;

    }
    return digitsum;
}
int main()
{
    int a,b,c,d;
    cin>>a>>b>>c>>d;
    cout<<a*d-c*b<<endl;
}


#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>

using namespace __gnu_pbds;
using namespace std;

template <typename T>
using indexed_set =
    tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;
template <class T> bool umin(T &a, const T &b) {
    return b < a ? a = b, 1 : 0;
}
template <class T> bool umax(T &a, const T &b) {
    return a < b ? a = b, 1 : 0;
}

#define int  long long
#define ll   long long
#define ld   long double
#define pb   push_back
#define mp   make_pair
#define in   insert
#define fi   first
#define se   second
#define lb   lower_bound
#define ub   upper_bound
#define prec fixed << setprecision(20)
#define sz(v)         (int)(v.size())
#define all(x)        x.begin(), x.end()
#define allr(x)       x.rbegin(), x.rend()
#define mem(a, s)     memset(a, s, sizeof(a))
#define rep(i, a, b)  for (int i = a; i <= b; ++i)
#define repr(i, a, b) for (int i = a; i >= b; --i)
#define MAX  8000000000000000064LL
#define MIN  -8000000000000000064LL

typedef vector<int> vi;
typedef stack<int> sti;
typedef queue<int> qi;
typedef pair<int, int> pii;
typedef set<int> si;
typedef map<int, int> mii;
typedef vector<pii> vpi;
typedef priority_queue<int> pqmax;
typedef priority_queue<int, vector<int>, greater<int> > pqmin;

const int mod = 1e9 + 7;
const int inf = 1e18;
const int d4x[4] = { -1, 0, 1, 0 }, d4y[4] = { 0, 1, 0, -1 };
const int d8x[8] = { -1, -1, 0, 1, 1, 1, 0, -1 },
          d8y[8] = { 0, 1, 1, 1, 0, -1, -1, -1 };

void solve();

int32_t main() {
    ios::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);
    int t = 1;

    // cin >> t;
    rep(i, 1, t) {
        // cout << "Case #" << i << ": ";
        solve();
    }
    return 0;
}

void solve() {
    int n, m, t;

    cin >> n >> m >> t;
    int start = n;

    vector<pii> v(m);

    rep(i, 0, m - 1) cin >> v[i].fi >> v[i].se;
    start -= v[0].fi;
    if (start <= 0) {
        cout << "No\n";
        return;
    }
    start += (v[0].se - v[0].fi);
    if (start > n) start = n;
    rep(i, 1, m - 1) {
        start -= (v[i].fi - v[i - 1].se);
        if (start <= 0) {
            cout << "No\n";
            return;
        }
        start += (v[i].se - v[i].fi);
        if (start > n) start = n;
    }
    start -= (t - v[m - 1].se);
    if (start > 0) cout << "Yes\n";
    else cout << "No\n";
} // solve

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

const int maxm=1010;

int N,n,m,t,a[maxm],b[maxm];

int main()
{
	scanf("%d%d%d",&n,&m,&t);N=n;
	for(int i=1;i<=m;i++) scanf("%d%d",&a[i],&b[i]);

	a[0]=b[0]=0;
	a[m+1]=t;

	for(int i=1;i<=m+1;i++)
	{
		n-=a[i]-b[i-1];
		if(n<=0) return !printf("No");

		n+=b[i]-a[i];
		n=min(n,N);
	}

	printf("Yes");

	return 0;
}


/*** keep hungry and calm PushyTao!***/
#include <iostream>
#include <algorithm>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <vector>
#include <math.h>

using namespace std;
typedef long long ll;
#define HEAP(...) priority_queue<__VA_ARGS__ >
#define heap(...) priority_queue<__VA_ARGS__,vector<__VA_ARGS__ >,greater<__VA_ARGS__ > >
template<class T> inline T min(T& x, const T& y) { return x > y ? y : x; }
template<class T> inline T max(T& x, const T& y) { return x < y ? y : x; }
ll read() {
	ll c = getchar(), Nig = 1, x = 0; while (!isdigit(c) && c != '-')c = getchar();
	if (c == '-')Nig = -1, c = getchar();
	while (isdigit(c))x = ((x << 1) + (x << 3)) + (c ^ '0'), c = getchar();
	return Nig * x;
}
#define read read()
const ll inf = 1e15;
const ll INF = 0x3f3f3f3f;
const int maxn = 1e6 + 7;
const int mod = 1000000007;
#define PI acos(-1.0)
typedef int itn;
namespace usual{
    inline ll gcd(ll a, ll b)
    {
        ll t;
        while (b != 0)
        {
            t = a % b; a = b; b = t;
        }
        return a;
    }
    inline ll qPow(ll x, ll k)
    {
        ll res = 1;
        while (k) {
            if (k & 1) res = (res * x);
            k >>= 1;
            x = (x * x);
        }
        return res;
    }
    inline ll oula(ll x) {
        ll res = x;
        for (ll i = 2; i <= x / i; i++) {
            if (x % i == 0) {
                res = res / i * (i - 1);
                while (x % i == 0) x /= i;
            }
        }
        if (x > 1) res = res / x * (x - 1);
        return res;
    }
}
using namespace usual;
priority_queue <int, vector<int>, greater<int> > xiaogen;
priority_queue <int, vector<int>, less<int> > dagen;
itn a[maxn],b[maxn];
ll cnt[maxn];
int main() {
    int n = read;
    for(int i=1;i<=n;i++){
        a[i] = read;
        cnt[a[i]+200] ++;
    }
    ll ans = 0;
    for(ll i=0;i<=400;i++){
        for(ll j=i+1;j<=400;j++){
            ans += cnt[i] * cnt[j] * (i-j) * (i-j);
        }
    }
    cout<<ans<<endl;
	return 0;
}/// ac_code

/**

**/

#include <bits/stdc++.h>
// #include <atcoder/all>
#define rep(i, a) for (int i = (int)0; i < (int)a; ++i)
#define rrep(i, a) for (int i = (int)a - 1; i >= 0; --i)
#define REP(i, a, b) for (int i = (int)a; i < (int)b; ++i)
#define RREP(i, a, b) for (int i = (int)a - 1; i >= b; --i)
#define pb push_back
#define eb emplace_back
#define all(x) x.begin(), x.end()
#define rall(x) x.rbegin(), x.rend()
#define popcount __builtin_popcount
using ll = long long;
constexpr ll mod = 1e9 + 7;
constexpr ll INF = 1LL << 60;

// #pragma GCC target("avx2")
// #pragma GCC optimize("O3")
// #pragma GCC optimize("unroll-loops")
template <class T>
inline bool chmin(T &a, T b)
{
	if (a > b)
	{
		a = b;
		return true;
	}
	return false;
}
template <class T>
inline bool chmax(T &a, T b)
{
	if (a < b)
	{
		a = b;
		return true;
	}
	return false;
}

template <typename T>
T mypow(T x, T n, const T &p = -1)
{ //x^nをmodで割った余り
	T ret = 1;
	while (n > 0)
	{
		if (n & 1)
		{
			if (p != -1)
				ret = (ret * x) % p;
			else
				ret *= x;
		}
		if (p != -1)
			x = (x * x) % p;
		else
			x *= x;
		n >>= 1;
	}
	return ret;
}

using namespace std;
// using namespace atcoder;

void solve()
{
	int n,m;
	cin>>n>>m;
	vector<ll>a(n);
	rep(i,n)cin>>a[i];
	vector<vector<int>>g(n);
	rep(i,m){
		int x,y;
		cin>>x>>y;
		x--;y--;
		g[x].eb(y);
	}
	vector<ll>dp(n,INF);
	ll ans=-INF;
	vector<bool>visited(n);
	auto dfs=[&](auto self,int v)->void{
		visited[v]=true;
		for(auto x:g[v]){
			chmin(dp[x],min(a[v],dp[v]));
		}
	};
	rep(i,n){
		dfs(dfs,i);
	}
	rep(i,n){
		chmax(ans,a[i]-dp[i]);
	}
	cout<<ans;
}

int main()
{
	ios::sync_with_stdio(false);
	cin.tie(nullptr);
	cout << fixed << setprecision(15);
	solve();
	return 0;
}


#include <bits/stdc++.h>

#define rep(i,n) for(int i=0;i<(n);i++)

using namespace std;

class mint{
	static const int MOD=1e9+7;
	int x;
public:
	mint():x(0){}
	mint(long long y){ x=y%MOD; if(x<0) x+=MOD; }

	mint& operator+=(const mint& m){ x+=m.x; if(x>=MOD) x-=MOD; return *this; }
	mint& operator-=(const mint& m){ x-=m.x; if(x<   0) x+=MOD; return *this; }
	mint& operator*=(const mint& m){ x=1LL*x*m.x%MOD; return *this; }
	mint& operator/=(const mint& m){ return *this*=inverse(m); }
	mint operator+(const mint& m)const{ return mint(*this)+=m; }
	mint operator-(const mint& m)const{ return mint(*this)-=m; }
	mint operator*(const mint& m)const{ return mint(*this)*=m; }
	mint operator/(const mint& m)const{ return mint(*this)/=m; }
	mint operator-()const{ return -x; }

	friend mint inverse(const mint& m){
		int a=m.x,b=MOD,u=1,v=0;
		while(b>0){ int t=a/b; a-=t*b; swap(a,b); u-=t*v; swap(u,v); }
		return u;
	}

	friend istream& operator>>(istream& is,mint& m){ long long t; is>>t; m=t; return is; }
	friend ostream& operator<<(ostream& os,const mint& m){ return os<<m.x; }
	int to_int()const{ return x; }
};

mint operator+(long long x,const mint& m){ return mint(x)+m; }
mint operator-(long long x,const mint& m){ return mint(x)-m; }
mint operator*(long long x,const mint& m){ return mint(x)*m; }
mint operator/(long long x,const mint& m){ return mint(x)/m; }

mint pow(mint m,long long k){
	mint res=1;
	for(;k>0;k>>=1,m*=m) if(k&1) res*=m;
	return res;
}

mint fact(int n){
	static vector<mint> memo={1};
	if(memo.size()<=n){
		int k=memo.size();
		memo.resize(n+1);
		for(;k<=n;k++) memo[k]=memo[k-1]*k;
	}
	return memo[n];
}

mint fact_inverse(int n){
	static vector<mint> memo={1};
	if(memo.size()<=n){
		int k=memo.size();
		memo.resize(n+1);
		memo[n]=inverse(fact(n));
		for(int i=n;i>k;i--) memo[i-1]=memo[i]*i;
	}
	return memo[n];
}

mint choose(int n,int k,int type=0){
	if(k==0) return 1;
	if(n< k) return 0;
	if(type==0){
		return fact(n)*fact_inverse(k)*fact_inverse(n-k);
	}
	else{
		if(k>n-k) k=n-k;
		mint res=fact_inverse(k);
		rep(i,k) res*=n-i;
		return res;
	}
}

int k;
mint pw[17][200001]; // pw[a][b] = a^b

mint calc(vector<int> cnt,int rem){
	int c=0;
	rep(i,16) if(cnt[i]>0) c++;
	if(c>k || k-c>rem) return 0;

	mint res=0;
	rep(i,k-c+1) res+=(i%2==0?1:-1)*choose(k-c,i)*pw[k-i][rem];

	return choose(16-c,k-c)*res;
}

int main(){
	string s;
	cin>>s>>k;
	int n=s.length();

	int f[128];
	rep(i,10) f['0'+i]=i;
	rep(i,6) f['A'+i]=10+i;

	rep(i,k+1) rep(j,n+1) pw[i][j]=pow(mint(i),j);

	mint ans=0;

	// leading zero なし
	vector<int> cnt(16);
	rep(i,n){
		int d=f[s[i]];
		rep(j,d) if(!(i==0 && j==0)) {
			cnt[j]++;
			ans+=calc(cnt,n-i-1);
			cnt[j]--;
		}
		cnt[d]++;
	}
	ans+=calc(cnt,0);

	// leading zero あり
	fill(cnt.begin(),cnt.end(),0);
	for(int i=1;i<n;i++){
		for(int j=1;j<16;j++) {
			cnt[j]++;
			ans+=calc(cnt,n-i-1);
			cnt[j]--;
		}
	}

	cout<<ans<<'\n';

	return 0;
}

#include <iostream>
#include <vector>
#include<bits/stdc++.h>
#include <algorithm>
#include <math.h>
#include <string>
#include <iomanip>
#include <string.h>
using namespace std;

bool used[1009];
int main(){

    long long t; cin>>t;
    long long n; cin>>n;

    for(int i=1; i<=100; i++){
        used[i*(100+t)/100] = true;

    }

    vector <long long> vec;
    for(int i=1; i<=100+t; i++){

        if(used[i]==false){
            vec.push_back(i);

        }
    }

    long long r1 = (n-1)/(long long)vec.size();
    long long r2 = (n-1)%(long long)vec.size();

    cout << r1*(100LL + t)+vec[r2] << "\n";

    return 0;
};


#include <iostream>
#include <set>
#include <algorithm>
int main()
{

    int N, M, tmp;

    std::cin >> N >> M;
    std::set<int> A, B, C, D, OUT;
    for (int i = 0; i < N; i++)
    {
        std::cin >> tmp;
        A.insert(tmp);
    }
    for (int i = 0; i < M; i++)
    {
        std::cin >> tmp;
        B.insert(tmp);
    }

    std::set_union(A.begin(), A.end(),
                   B.begin(), B.end(),
                   std::inserter(C, C.end()));
    std::set_intersection(A.begin(), A.end(),
                          B.begin(), B.end(),
                          std::inserter(D, D.end()));
    std::set_difference(C.begin(), C.end(),
                        D.begin(), D.end(),
                        std::inserter(OUT, OUT.end()));

    for (auto ite = OUT.begin(), end = OUT.end(); ite != end; ite++)
    {
        std::cout << *ite << " ";
    }
    std::cout << std::endl;
}

#include <bits/stdc++.h>

using namespace std;

#define FAST ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
#define ll long long
#define ull unsigned long long
#define pi 2*acos(0.0)
#define readl(v,n) for(ll i=0;i<n;i++) {ll val; cin>>val; v.pb(val);}
#define readi(v,n) for(int i=0;i<n;i++) {int val; cin>>val; v.pb(val);}
#define srt(v) sort(v.begin(), v.end());
#define rsrt(v) sort(v.rbegin(), v.rend());
#define MIN(v) *min_element(v.begin(), v.end())
#define MAX(v) *max_element(v.begin(), v.end())
#define sz(x) ((ll) (x).size())
#define all(x) (x).begin(), (x).end()
#define rep(i, a, b) for(ll i = (a); i < (b); i++)
#define rep2(i, a, b) for(ll i = (a); i <= (b); i++)
#define vll vector <ll>
#define vii vector <int>
#define pii pair <int, int>
#define pll pair <ll, ll>
#define M 1000007
#define MOD 1000000007
#define pb push_back
#define mp make_pair
#define ff first
#define ss second
#define endl "\n"
#define inf 1000000000000000000
#define ninf -1000000000000000000
#define deb(n) cout<<"--"<<(n)<<"--"<<endl
#define debx(x) cout << #x << " = " << (x) << endl
#define deb2(a,b) cout<<(a)<<"----"<<(b)<<endl
#define debv(v) for(auto x: v) {cout<<x<<", ";} cout<<endl;
#define put(n) cout<<(n)<<endl
#define toDecimal(s) bitset<64>(s).to_ullong()
#define toBinaryStr(n) bitset<64>(n).to_string()
#define toBinary(n) stoll(bitset<64>(n).to_string())

/*
	---- take notes here ----

*/

void solve()
{
	int n;
	double D,H;
	cin>>n>>D>>H;
	double maxx=0;
	for(int i=0; i<n; i++)
	{
		double d,h; cin>>d>>h;
		double x=D-d, y=H-h, a=d;
		double b=(y*a)/x;
		double b1=h-b;
		maxx=max(b1,maxx);
	}
	printf("%.4lf",maxx);
}

int main()
{
	FAST
	int t = 1;
	//cin >> t;
	while(t--)
	{
		solve();
	}

	return 0;
}


#include<bits/stdc++.h>
using namespace std;
using ll = long long;
using P = pair<int,int> ;
#define rep(i,n) for(ll i=0;i<(n);i++)
ll min_ll(ll a,ll b){return a>=b ? b:a;}
ll max_ll(ll a,ll b){return a>=b ? a:b;}

int main(){
    int n;
    cin >> n;
    ll a[n];
    rep(i,n){
        ll m;
        cin >> m;
        if (i%2==0) a[i]=m;
        else a[i]=-m;
    }
    ll b[n+1]={0};
    ll ans =0;
    map<ll,ll> d;
    d[0]=1;
    for (int i=0;i<n;++i){
        b[i+1]=a[i]+b[i];
        if (!d.count(b[i+1])) d[b[i+1]]=1;
        else d[b[i+1]]++;
    }
    for (auto i = d.begin();i!=d.end();++i){
        ans+=i->second*((i->second)-1)/2;
    }
    cout << ans << endl;
}

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

typedef long long ll;
typedef pair <ll, ll> llll;

const int Maxn = 300005;

int n;
map <ll, ll> M;
ll res;

int main()
{
	scanf("%d", &n);
	llll cur = llll(0ll, 0ll);
	M[cur.first - cur.second]++;
	for (int i = 0; i < n; i++) {
		int a; scanf("%d", &a);
		if (i % 2 == 0) cur.first += a;
		else cur.second += a;
		res += M[cur.first - cur.second]++;
	}
	cout << res << endl;
    return 0;
}


#include <algorithm>
#include <cstdio>
#include <cstring>
#include <cmath>
#include <cassert>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <vector>

#define For(i, l, r) for (i = int64(l); i <= int64(r); i++)
#define Fo(i, n) For(i, 1, n)
#define Rof(i, r, l) for (i = int64(r); i >= int64(l); i--)
#define Ro(i, n) Rof(i, n, 1)
#define clr(a) memset(a, 0, sizeof(a))
#define cpy(a, b) memcpy(a, b, sizeof(b))
#define fc(a, ch) memset(a, ch, sizeof(a))

typedef long long int64;

#define T1 template <class A>
#define T2 template <class A, class B>
#define T3 template <class A, class B, class C>
#define T4 template <class A, class B, class C, class D>
inline void read(char &x)
{
    do
        x = getchar();
    while (x <= ' ');
}
inline void read(char *s)
{
    char ch;

    do
        ch = getchar();
    while (ch <= ' ');
    while (ch > ' ')
    {
        (*s) = ch;
        s++;
        ch = getchar();
    }
    (*s) = 0;
}
inline void read(std::string &s)
{
    char ch;

    do
        ch = getchar();
    while (ch <= ' ');
    while (ch > ' ')
    {
        s.push_back(ch);
        ch = getchar();
    }
}
T1 inline void readint(A &x)
{
    bool neg = false;
    char ch;

    do
        ch = getchar();
    while (ch <= ' ');
    if (ch == '-')
    {
        neg = true;
        ch = getchar();
    }
    x = 0;
    while (ch > ' ')
    {
        x = x * 10 + (ch & 15);
        ch = getchar();
    }
    if (neg)
        x = -x;
}
inline void read(int &x) { readint(x); }
inline void read(int64 &x) { readint(x); }

T2 inline void read(A &a, B &b)
{
    read(a);
    read(b);
}
T3 inline void read(A &a, B &b, C &c)
{
    read(a);
    read(b);
    read(c);
}
T4 inline void read(A &a, B &b, C &c, D &d)
{
    read(a);
    read(b);
    read(c);
    read(d);
}
inline void writeln() { putchar('\n'); }
T1 inline void write(A x)
{
    static char buf[20];
    int top = 0;

    if (!x)
    {
        putchar('0');
        return;
    }
    if (x < 0)
    {
        putchar('-');
        x = -x;
    }
    while (x)
    {
        buf[++top] = (x % 10) | 48;
        x /= 10;
    }
    while (top)
        putchar(buf[top--]);
}
T1 inline void write_(A x)
{
    write(x);
    putchar(' ');
}
T1 inline void writeln(A x)
{
    write(x);
    putchar('\n');
}
T2 inline void write(A a, B b)
{
    write_(a);
    write(b);
}
T2 inline void writeln(A a, B b)
{
    write_(a);
    writeln(b);
}
T3 inline void writeln(A a, B b, C c)
{
    write_(a);
    write_(b);
    writeln(c);
}
T4 inline void writeln(A a, B b, C c, D d)
{
    write_(a);
    write_(b);
    write_(c);
    writeln(d);
}
#undef T1
#undef T2
#undef T3
#undef T4

const int P[] = {2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71};
const int PN = sizeof(P) >> 2;
const int full = (1 << PN) - 1;

int64 a, b;
int64 f[1 << PN | 5];

int main() {
	int64 i, ans;
	int j, x;

	read(a, b);

	f[0] = 1;
	For(i, a, b) {
		x = 0;
		For(j, 0, PN - 1)
			if(i % P[j] == 0)
				x |= 1 << j;
		Rof(j, full, 0)
			if(!(j & x))
				f[j | x] += f[j];
	}

	ans = 0;
	For(j, 0, full)
		ans += f[j];
	writeln(ans);
	return 0;
}


#include<bits/stdc++.h>
using namespace std;
using lli = long long;
#define rep(i,n) for(int i=0;i<n;i++)
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 (b<a) { a=b; return 1; } return 0; }
ostream &operator<<(ostream &os, const vector<lli> &x){
    os << "{";
    for(int i = 0; i < x.size(); i++){
        if(i < x.size()-1) os << x[i] << ", ";
        else os << x[i];
    }
    os << "}";
    return os;
}
struct UnionFind {
    vector<int> par; // par[i]:iの親の番号　(例) par[3] = 2 : 3の親が2

    UnionFind(int N) : par(N) { //最初は全てが根であるとして初期化
        for(int i = 0; i < N; i++) par[i] = i;
    }

    int root(int x) { // データxが属する木の根を再帰で得る：root(x) = {xの木の根}
        if (par[x] == x) return x;
        return par[x] = root(par[x]);
    }

    void unite(int x, int y) { // xとyの木を併合
        int rx = root(x); //xの根をrx
        int ry = root(y); //yの根をry
        if (rx == ry) return; //xとyの根が同じ(=同じ木にある)時はそのまま
        par[rx] = ry; //xとyの根が同じでない(=同じ木にない)時：xの根rxをyの根ryにつける
    }

    bool same(int x, int y) { // 2つのデータx, yが属する木が同じならtrueを返す
        int rx = root(x);
        int ry = root(y);
        return rx == ry;
    }
};
const lli mod = 998244353;

template< int mod >
struct ModInt {
  int x;

  ModInt() : x(0) {}

  ModInt(int64_t y) : x(y >= 0 ? y % mod : (mod - (-y) % mod) % mod) {}

  ModInt &operator+=(const ModInt &p) {
    if((x += p.x) >= mod) x -= mod;
    return *this;
  }

  ModInt &operator-=(const ModInt &p) {
    if((x += mod - p.x) >= mod) x -= mod;
    return *this;
  }

  ModInt &operator*=(const ModInt &p) {
    x = (int) (1LL * x * p.x % mod);
    return *this;
  }

  ModInt &operator/=(const ModInt &p) {
    *this *= p.inverse();
    return *this;
  }

  ModInt operator-() const { return ModInt(-x); }

  ModInt operator+(const ModInt &p) const { return ModInt(*this) += p; }

  ModInt operator-(const ModInt &p) const { return ModInt(*this) -= p; }

  ModInt operator*(const ModInt &p) const { return ModInt(*this) *= p; }

  ModInt operator/(const ModInt &p) const { return ModInt(*this) /= p; }

  bool operator==(const ModInt &p) const { return x == p.x; }

  bool operator!=(const ModInt &p) const { return x != p.x; }

  ModInt inverse() const {
    int a = x, b = mod, u = 1, v = 0, t;
    while(b > 0) {
      t = a / b;
      swap(a -= t * b, b);
      swap(u -= t * v, v);
    }
    return ModInt(u);
  }

  ModInt pow(int64_t n) const {
    ModInt ret(1), mul(x);
    while(n > 0) {
      if(n & 1) ret *= mul;
      mul *= mul;
      n >>= 1;
    }
    return ret;
  }

  friend ostream &operator<<(ostream &os, const ModInt &p) {
    return os << p.x;
  }

  friend istream &operator>>(istream &is, ModInt &a) {
    int64_t t;
    is >> t;
    a = ModInt< mod >(t);
    return (is);
  }

  static int get_mod() { return mod; }
};

using modint = ModInt< mod >;

int main(void){
    lli n;
    cin >> n;
    UnionFind u(n+1);
    vector<lli> f(n+1);
    for(int i = 1; i <= n; i++){
        cin >> f[i];
        u.unite(i, f[i]);
    }
    lli c = 0;
    vector<bool> seen(n+1);
    for(int i = 1; i <= n; i++){
        if(seen[u.root(i)] == false){
            seen[u.root(i)] = true;
            c++;
        }
    }
    modint ans = 2;
    ans = ans.pow(c)-1;
    cout << ans << endl;

    return 0;
}

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

int main(){
    long a, n, sum = 0, sumy = 0, amax = 0, ans = 0;
    cin >> n;
    for(int i = 1; i <= n; i++){
        cin >> a;
        amax = max(a, amax);
        sum += a, sumy += sum;
        ans = sumy + amax * i;
        cout << ans << endl;
    }
    return 0;
}


#include <bits/stdc++.h>
#include <fstream>
#include <bitset>
using namespace std;
using ll = long long;
using P = pair<int, int>;
const int INF=2147483647;
// 9,223,372,036,854,775,807
const ll INFL = 9223372036854775807;

bool func(const pair<ll,ll> &x,const pair<ll,ll> &y){
    if(x.second<y.second) return true;
    else return false;
}

int main(){

    ll n,k;
    cin >> n >> k;
    vector<deque<ll>> a_dequev(n+1);
    vector<ll> a_v(n);
    for(int i=0;i<n;i++){
        cin >> a_v[i];
    }
    sort(a_v.begin(),a_v.end());
    for(int i=0;i<n;i++){
        a_dequev[a_v[i]].push_back(a_v[i]);
    }
    ll sumpart = 0;
    ll ans = 0;
    int i = 0;
    int kchk = 0;
    for(int i=0;i<n;i++){
        if(a_dequev[i].empty() == false){
            a_dequev[i].pop_front();
            sumpart++;
        }
        else{
            if(i==0) break;
            kchk++;
            if(kchk>k) break;
            ans += sumpart;
            sumpart = 0 ;
            i = -1;
        }
    }
    cout << ans << endl;
    return 0;
}

#include <bits/stdc++.h>
typedef long long ll;
typedef unsigned long long ull;
using namespace std;
int mod = 1e9 + 7;
int mul(int a, int b) {
    ll ans = a * 1ll * b;
    return ans % mod;
}
int inv(int i) {
    int temp = mod - 2;
    int ans = 1;
    while (temp) {
        if (temp & 1) {
            ans = mul(ans, i);
        }
        temp >>= 1;
        i = mul(i, i);
    }
    return ans;
}
int main() {
#ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
#endif
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);
    int n, m;
    cin >> n >> m;
    vector<int> a(n);
    int s = 0;
    for (int i = 0; i < n; i++) {
        cin >> a[i];
        s += a[i];
    }
    int t = m - s;
    if (t < 0) {
        cout << 0 << endl;
        return 0;
    }
    int up = 1, down = 1;
    for (int i = 1; i <= s + n; i++) {
        up = mul(i + t, up);
        down = mul(i, down);
    }
    int ans = mul(up, inv(down));
    cout << ans << endl;
    return 0;
}


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

int main() {
    int n;
    std::cin >> n;
    std::string s, x;
    std::cin >> s >> x;
    std::vector<std::set<int>> dp(n+1);
    dp[n] = {0};
    for (int i = n - 1; i >= 0; --i) {
        if (x[i] == 'A') {
            for (int j {0}; j < 7; ++j) {
                if (dp[i+1].count(((10 * j + s[i] - '0') % 7))
                    && dp[i+1].count((10 * j) % 7)) {
                    dp[i].insert(j);
                }
            }
        } else {
            for (int j {0}; j < 7; ++j) {
                if (dp[i+1].count((10 * j + s[i] - '0') % 7)
                    || dp[i+1].count((10 * j) % 7)) {
                    dp[i].insert(j);
                }
            }
        }
    }
    if (dp[0].count(0)) {
        std::cout << "Takahashi" << std::endl;
    } else {
        std::cout << "Aoki" << std::endl;
    }
}

#line 1 "/workspaces/compro/lib/template.hpp"

#line 1 "/workspaces/compro/lib/io/vector.hpp"
#include <iostream>
#include <vector>

#ifndef IO_VECTOR
#define IO_VECTOR

template <class T> std::ostream &operator<<(std::ostream &out, const std::vector<T> &v) {
  int size = v.size();
  for (int i = 0; i < size; i++) {
    std::cout << v[i];
    if (i != size - 1)
      std::cout << " ";
  }
  return out;
}

template <class T> std::istream &operator>>(std::istream &in, std::vector<T> &v) {
  for (auto &el : v) {
    std::cin >> el;
  }
  return in;
}

#endif
#line 4 "/workspaces/compro/lib/template.hpp"
#include <bits/stdc++.h>
#define REP(i, n) for (int i = 0; i < n; i++)
#define FOR(i, m, n) for (int i = m; i < n; i++)
#define ALL(v) (v).begin(), (v).end()
#define coutd(n) cout << fixed << setprecision(n)
#define ll long long int
#define vl vector<ll>
#define vi vector<int>
#define MM << " " <<

using namespace std;

template <class T> void chmin(T &a, T b) {
  if (a > b)
    a = b;
}

template <class T> void chmax(T &a, T b) {
  if (a < b)
    a = b;
}

// 重複を消す。計算量はO(NlogN)
template <class T> void unique(std::vector<T> &v) {
  std::sort(v.begin(), v.end());
  v.erase(std::unique(v.begin(), v.end()), v.end());
}

#line 2 "main.cpp"

std::string solve(long long N, string S, std::string X) {
  vector<vector<bool>> dp(N + 1, vector<bool>(7, false));
  dp[N][0] = true;
  for (int i = N - 1; i >= 0; i--) {
    REP(j, 7) {
      int m = 10 * j + (S[i] - '0'); // S[i]を選ぶ
      m %= 7;
      int m0 = 10 * j; // 0を選ぶ
      m0 %= 7;
      if (X[i] == 'T') {
        if (dp[i + 1][m0] || dp[i + 1][m]) {
          dp[i][j] = true;
        } else {
          dp[i][j] = false;
        }
      } else {
        // どっちに転んでも高橋君が勝つ場合
        if (dp[i + 1][m0] && dp[i + 1][m]) {
          dp[i][j] = true;
        } else {
          dp[i][j] = false;
        }
      }
    }
  }

  if (dp[0][0]) {
    return "Takahashi";
  } else {
    return "Aoki";
  }
}

// generated by online-judge-template-generator v4.7.1 (https://github.com/online-judge-tools/template-generator)
int main() {
  int N;
  string S, X;
  cin >> N;
  cin >> S >> X;
  auto ans = solve(N, S, X);
  cout << ans << endl;
}


/*
15
63 25 66 36 39 29 93 3 188 128 191 82 179 178 168
*/
#include <bits/stdc++.h>
using namespace std;

#define rep(i, a, b) for(int i = (a); i < (b); ++i)
#define trav(a, x) for(auto& a : x)
#define pb push_back
#define mp make_pair
#define all(x) (x).begin(),(x).end()
#define sz(x) ((int)(x).size())
#define endl '\n'

typedef long long ll;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
typedef vector<int> vi;
typedef vector<ll> vll;

const ll mod = 1000000007;
mt19937_64 rng(chrono::steady_clock::now().time_since_epoch().count());

using State = pair<pii, bool>;

vi a;
// what cases do i have to handle?
// if the mod = 0, need to not count degenerate one
vi solve(vector<vector<vector<State>>>& prev, pii initial, bool ig) {
	vi ans;

	int whichDefault = (ig ? -1 : -2);
	bool once = false;
	while(initial != mp(-1, -1)) {
		int row = initial.first;
		int col = initial.second;
		//cout << row << " " << col << endl << flush;
		int len = sz(prev[row][col]);
		if(len + whichDefault >= 0) {
			// cout << len << " " << whichDefault << endl << flush;
			//assert(len + whichDefault < len);
			State taken = prev[row][col][len + whichDefault];
			if(taken.second) {
				ans.pb(taken.first.first + 1);
			}

			initial = taken.first;

			if(!once) {
				whichDefault = -1;
				once = true;
			}

		} else {
			// take 0
			State taken = prev[row][col][0];
			// it means that to get to the current state, we took from the previous one
			if(taken.second) {
				ans.pb(taken.first.first + 1);
			}
			initial = taken.first;
		}
	}
	reverse(all(ans));
	return ans;
}

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

	// if there exists 2 different elements = x mod 200, then obv

	int n; cin >> n;
	a.resize(n); trav(x, a) cin >> x;

	map<int,vector<int>> cnt;
	for(int i = 0; i < n; i++) {
		cnt[a[i] % 200].pb(i);
	}

	trav(p, cnt) {
		if(sz(p.second) >= 2) {
			cout << "Yes" << endl;
			cout << 1 << " " << p.second[0] + 1 << endl;
			cout << 1 << " " << p.second[1] + 1 << endl;
			return 0;
		}
	}

	// includes the dummy subsequence
	vector<vector<ll>> dp(n + 1, vector<ll>(200, 0));
	vector<vector<vector<State>>> prev(n + 1, vector<vector<State>>(200));
	dp[0][0] = 1;
	prev[0][0].pb({mp(-1,-1), false});

	for(int i = 0; i < n; i++) {
		for(int j = 0; j < 200; j++) {
			ll here = dp[i][j];
			if(here != 0) {
				// include this element
				dp[i + 1][(j + a[i]) % 200] += here;
				if(prev[i + 1][(j + a[i]) % 200].size() <= 3) {
					prev[i + 1][(j + a[i]) % 200].pb({mp(i, j), true});
				}
				dp[i + 1][j] += here;
				if(prev[i + 1][j].size() <= 3) {
					prev[i + 1][j].pb({mp(i,j), false});
				}
			}
		}
	}

	vi b, c;
	for(int j = 0; j <= n; j++) {
		for(int i = 0; i < 200; i++) {
			if(i == 0) {
				if(dp[j][i] >= 3) {
					cout << "Yes" << endl;
					b = solve(prev, {n, i}, false);
					c = solve(prev, {n, i}, true);
					cout << sz(b) << " "; trav(x, b) cout << x << " ";
					cout << endl;
					cout << sz(c) << " "; trav(x, c) cout << x << " ";
					cout << endl;
					return 0;
				}
			} else {
				if(dp[j][i] >= 2) {
					cout << "Yes" << endl;
					b = solve(prev, {n, i}, false);
					c = solve(prev, {n, i}, true);
					cout << sz(b) << " "; trav(x, b) cout << x << " ";
					cout << endl;
					cout << sz(c) << " "; trav(x, c) cout << x << " ";
					cout << endl;
					return 0;
				}
			}
		}
	}

	cout << "No" << endl;
    return 0;
}

//in dp prefix suffix sum helps..
#include<iostream>
#include<vector>
#include<string.h>
#include<algorithm>
#include<iomanip>
#include<cmath>
#include<stack>
#include <iterator>
#include <map>
#include<list>
#include <fstream>
#include<unordered_map>
#include<set>
#include<queue>
#define int  long long
#define double long double
#define pb   push_back
#define mp   make_pair
#define pii  pair<int,int>
#define pip pair<int, pair<int, int> >
#define viv vector<vector<int> >
#define vip vector< pair<int, int> >
#define vi vector<int>
#define mii  map<int, int>
#define qu queue<int>
#define set set<int>
#define multi multiset<int>
#define stack stack<int>
#define fi first
#define se second
#define reverse(s) reverse(s.begin(), s.end())
#define sort1(v) sort(v.begin(), v.end())
#define it iterator
#define pq1 priority_queue <pii, vector<pii>, greater<pii> >
#define mem(x, y) memset(x, (int)y, sizeof(x))
#define ps(x,y) fixed<<setprecision(y)<<x
// author :: Anurag Anand.
using namespace std;
int z=  1e9+7;
//int z= 998244353;
int gcd(int a, int b){
    if(a==0)return b;
    if(b==0)return a;
    return gcd(b, a%b);
}
int power(int a,int b)
{
	int res=1;
	while(b)
	{
		if(b&1)
		{
			res=(res*a)%z;
			b--;
		}
		else
		{
			a=(a*a)%z;
			b=b>>1;
		}
	}
	return res;
}
vi sieve;
// vi seg;
// void arrange(int i, int v, int x, int lx, int rx){
// 	if(rx-lx==1){
// 		seg[x] =v;
// 		return;
// 	}
// 	int m= (lx+rx)/2;
// 	if(i<m){
// 		arrange(i, v, 2*x+1, lx, m);
// 	}
// 	else arrange(i, v, 2*x+2, m, rx);
// 	seg[x]=gcd(seg[2*x+1], seg[2*x+2]);
// }
// int calc(int l, int r, int x, int lx, int rx){
// 	    if(l>=rx||r<=lx) return 0;
// 	    if(lx>=l&&rx<=r) return seg[x];
// 	    int mid=(lx+rx)/2;
// 	    int sl= calc(l, r, 2*x+1, lx, mid), sr= calc(l, r, 2*x+2, mid, rx);
// 	    return gcd(sl, sr);
// }
int32_t main()
{
    ios_base::sync_with_stdio(false);
	cin.tie(NULL);
    cout.tie(NULL);
	vi pp;
	pp.assign(1000001, 0);
	for(int i=2;i<1000;i++){
		if(!pp[i]){
			for(int j=2*i;j<=1000000;j+=i){
				pp[j]=1;
			}
		}
	}
	for(int i=2;i<=1000000;i++) if(!pp[i]) sieve.pb(i);
	int t;
	t=1;
	//cin>>t;
	while(t--){
		int n;
		cin>>n;
		set s;
		for(int i=2;i<=sqrt(n);i++){
			int j=i;
			while(j<=n){
				j*=i;
				if(j<=n) s.insert(j);
			}
		}
		cout<<n-s.size()<<"\n";
	}
}


#include <bits/stdc++.h>
#define FOR(i, begin, end) for(int i=(begin);i<(end);i++)
#define IFOR(i, begin, end) for(int i=(end)-1;i>=(begin);i--)
#define rep(i, n) FOR(i,0,n)
#define irep(i, n) IFOR(i,0,n)
#define all(v) begin(v), end(v)
using namespace std;
using ll = long long;
using ull = unsigned long long;
using P = pair<int, int>;
using PLL = pair<ll, ll>;
using VI = vector<int>;
using VLL = vector<ll>;
using VB = vector<bool>;
using VP = vector<P>;
using Graph2 = vector<vector<int>>;
using PQ = priority_queue<int>;
template<typename T>istream& operator>>(istream&s,vector<T>&v){for(auto &i: v)s>>i;return s;}
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }
bool second_compare(P a,P b){if(a.second!=b.second){return a.second<b.second;} else return true;}

int main() {
    ll x, y, a, b;
    cin >> x >> y >> a >> b;
    ll ans = 0;
    while(1) {
        if ((double)x <= (double)(x + b)/a && x * a < y) {
            ans++;
            x *= a;
        }
        else break;
    }

    ans += (y-x) / b;
    if ((y-x) % b == 0) ans--;

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

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define forn(i,x,n) for(int i = x;i <= n;++i)
#define forr(i,x,n) for(int i = n;i >= x;--i)
#define Angel_Dust ios::sync_with_stdio(0);cin.tie(0)

const int N = 1005;
struct Node
{
    string name;int h;
    bool operator<(const Node& r)   const
    {
        return h < r.h;
    }
}a[N];

int main()
{

    Angel_Dust;
    int n;cin >> n;
    forn(i,1,n) cin >> a[i].name >> a[i].h;
    sort(a + 1,a + n + 1);
    cout << a[n - 1].name << endl;

    return 0;
}


#include <bits/stdc++.h>
#include <variant>

#define rep2(i,k,n) for(i64 i=(i64)(k);i<(i64)(n);i++)
#define rep(i,n) rep2(i,0,n)
#define all(x) begin(x),end(x)
#ifdef ENV_LOCAL
#define dump if (1) cerr
#else
#define dump if (0) cerr
#endif

using namespace std;
using namespace std::string_literals;

using i32 = int32_t;
using i64 = int64_t;
using f64 = double;
using f80 = long double;
using vi32 = vector<i32>;
using vi64 = vector<i64>;

//using namespace harudake;

int main() {
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
  i32 n;
  cin>>n;
  vi64 ha(n+1);
  vi64 b(n), c(n);
  rep(i,n) {
    i32 a;
    cin>>a;
    ++ha[a];
  }
  rep(i,n) cin>>b[i];
  rep(i,n) cin>>c[i];
  i64 ans = 0;
  rep(i,n) {
    ans += ha[b[c[i]-1]];
  }
  cout<<ans<<endl;
  return 0;
}

#include <bits/stdc++.h>
#define REP(i, e) for(int (i) = 0; (i) < (e); ++(i))
#define FOR(i, b, e) for(int (i) = (b); (i) < (e); ++(i))
#define ALL(c) (c).begin(), (c).end()
#define PRINT(x) cout << (x) << "\n"
using namespace std;
using ll = long long;
using pll = pair<ll, ll>;
const long long MOD = 1000000007;

ll N, c[200010], q[200010];
pll edge[200010];
vector<ll> adj[200010];
ll depth[200010];
bool visited[200010];

void dep(ll i, ll d){
    if(depth[i] != -1) return;
    depth[i] = d;
    for(ll j : adj[i]) dep(j, d + 1);
}

void dfs(ll i, ll s){
    if(c[i] != -1) return;
    c[i] = s + q[i];
    for(ll j : adj[i]) dfs(j, c[i]);
}

signed main(){
    cin >> N;
    ll a, b;
    REP(i, N - 1){
        cin >> a >> b;
        a--; b--;
        edge[i] = {a, b};
        adj[a].push_back(b);
        adj[b].push_back(a);
    }
    REP(i, N) depth[i] = -1;
    dep(0, 0);
    ll Q, t, e, x;
    cin >> Q;
    REP(i, Q){
        cin >> t >> e >> x;
        t--; e--;
        auto [a, b] = edge[e];
        if(depth[a] > depth[b]){
            swap(a, b);
            t = 1 - t;
        }
        if(t == 0){
            q[0] += x;
            q[b] -= x;
        }else{
            q[b] += x;
        }
    }
    REP(i, N) c[i]= -1;
    dfs(0, 0);
    REP(i, N) PRINT(c[i]);
    return 0;
}


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

int main () {
  int x,y;
  cin >> x >> y;
  if (x==y){cout<< x<<endl;
           return 0;}
  else {
    cout <<3-x-y <<endl;
  return 0;}
  }

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

{
  int a,b,c;
  cin>>a>>b;
  if(a==1 &&b==0||a==0&&b==1)
    cout<<2;
  else if(a==b)
    cout<<a;
  else if(a==1 &&b==2||a==2 &&b==1)
    cout<<0;
  else
    cout<<1;

}


//#pragma GCC optimize("Ofast")
//#pragma GCC optimize("O2")
//#pragma GCC optimize("O3")
//#pragma GCC optimize("unroll-loops")
////
//#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx")
#include <bits/stdc++.h>

#include <utility>

#define all(x) (x).begin(), (x).end()
#define allp(x) (x)->begin(), (x)->end()

#define pb push_back

using namespace std;
void dout() { cerr << endl; }
//typedef long long ll;
template <typename Head, typename... Tail>
void dout(Head H, Tail... T) {
    cerr << H << ' ';
    dout(T...);
}

using ll = long long;
//#ifdef __int128
//using hll = __int128;
//#endif
using pii = pair<ll, ll>;
using ld = long double;

template <typename T>
void do_uniq(vector<T> &vec){
    sort(all(vec));
    vec.resize(unique(all(vec)) - vec.begin());
}

#ifndef ONLINE_JUDGE

clock_t timestamp_start = clock();
void time_calc()
{
    cerr << (ld)(clock() - timestamp_start) / CLOCKS_PER_SEC << "\n";
}
#endif

#ifdef _getchar_nolock
#else
#    define _getchar_nolock getchar_unlocked
#endif

#define integer int

integer mod = 1e9 + 7;

integer ml(integer a, integer b) {
    return (a * 1ll * b) % mod;
}

integer add(integer a, integer b) {
    integer rt = a + b;
    if (rt < mod) return rt;
    return rt - mod;
}

integer sub(integer a, integer b) {
    return add(a, mod - b);
}

integer sq(integer a) {
    return ml(a, a);
}

integer b_p(integer b, ll p) {
    if (p == 0) return 1;
    if (p & 1) return ml(b, b_p(b, p - 1));
    return sq(b_p(b, p >> 1));
}

#define solvsh
//#define multi

#ifdef solvsh

void precalc() {
}

void solve() {
    ll n, m;
    cin >> n >> m;

    mod = m;
    ll y = b_p(10, n);

    mod = m * m;
    ll val = b_p(10, n);
    val = sub(val, y);

    val /= m;
    cout << val << "\n";
}

#else

#endif

void multisolve() {
//    precalc();
    int t;

    cin >> t;

    int i = 1;
    while (t--) {
        solve();
        i++;
    }
}

#ifndef ONLINE_JUDGE

void gen() {
}

#endif

#define int int
int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr), cout.tie(nullptr);
    cout << fixed << setprecision(20);

#ifdef multi
    //            gen();
    multisolve();
#else

    solve();
//    gen();
#endif
//     time_calc();
}

#include<bits/stdc++.h>

using namespace std;

using ll = long long;

/*-----for personal-----*/
#define rep(i,a,b) for(int i=(a);i<(b);++i)
#define repn(i,n)  rep(i,0,n)

/*-----for lib-----*/
#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 REP_R(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)

const double EPS = 1e-5;
const int MOD = 1e9+7;
const int INF = INT_MAX / 2;
//for(auto &h : H){ cout << h << " ";} cout << endl;
//for(auto &h : H){for(auto &k:h){cout << k << " ";}cout << endl;}
//for(auto [k,v] : mp){cout << k << " " << v << endl;}
//for(auto [k,v] : mp){cout << k << " "; for(auto &u:v){cout << u << " ";}cout << endl;}

inline int32_t modinv_nocheck(int32_t value, int32_t MOD) {
    assert (0 <= value and value < MOD);
    if (value == 0) return -1;
    int64_t a = value, b = MOD;
    int64_t x = 0, y = 1;
    for (int64_t u = 1, v = 0; a; ) {
        int64_t q = b / a;
        x -= q * u; std::swap(x, u);
        y -= q * v; std::swap(y, v);
        b -= q * a; std::swap(b, a);
    }
    if (not (value * x + MOD * y == b and b == 1)) return -1;
    if (x < 0) x += MOD;
    assert (0 <= x and x < MOD);
    return x;
}

inline int32_t modinv(int32_t x, int32_t MOD) {
    int32_t y = modinv_nocheck(x, MOD);
    assert (y != -1);
    return y;
}

inline int32_t modpow(uint_fast64_t x, uint64_t k, int32_t MOD) {
    //assert (/* 0 <= x and */ x < (uint_fast64_t)MOD);
    uint_fast64_t y = 1;
    for (; k; k >>= 1) {
        if (k & 1) (y *= x) %= MOD;
        (x *= x) %= MOD;
    }
    //assert (/* 0 <= y and */ y < (uint_fast64_t)MOD);
    return y;
}

int main(){
    ll N, M; cin >> N >> M;
    int a = modpow(10LL, N, M*M)/M;
    cout << a << endl;
}


#include <bits/stdc++.h>
//#include <atcoder/all>

using namespace std;
//using namespace atcoder;

using ll = long long;
using vll = vector<ll>;
using vvll = vector<vll>;
using pll = pair<ll, ll>;
using vpll = vector<pll>;
using ld = long double;
using vld = vector<ld>;
using vb = vector<bool>;

#define rep(i, n) for (ll i = 0; i < (n); i++)
#ifdef LOCAL
#define dbg(x) cerr << __LINE__ << " : " << #x << " = " << (x) << endl
#else
#define dbg(x) true
#endif

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

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

template <class T> ostream& operator<<(ostream& s, const vector<T>& a) {
    for(auto i : a) s << i << ' ';
    return s;
}

constexpr int INF = 1 << 30;
constexpr ll INFL = 1LL << 62;
constexpr ld EPS = 1e-12;
ld PI = acos(-1.0);

struct mint {
    static const long long mod = 998244353;
    long long x;
    mint(long long x = 0) : x((x % mod + mod) % mod) {}
    mint operator-() const { return mint(-x);}
    mint& operator+=(const mint& a) {if ((x += a.x) >= mod) x -= mod; return *this;}
    mint& operator-=(const mint& a) {if ((x += mod - a.x) >= mod) x -= mod; return *this;}
    mint& operator*=(const mint& a) {(x *= a.x) %= mod; return *this;}

    friend const mint operator+(const mint& a, const mint& b) { mint ret = a; return ret += b; }
    friend const mint operator-(const mint& a, const mint& b) { mint ret = a; return ret -= b; }
    friend const mint operator*(const mint& a, const mint& b) { mint ret = a; return ret *= b; }
    friend ostream& operator<<(ostream& s, const mint& a) { return s << a.x; }

    mint pow(long long t) const {
        if (!t) return 1;
        mint a = pow(t >> 1);
        a *= a;
        if (t & 1) a *= *this;
        return a;
    }

    // for prime mod
    mint inv() const { return pow(mod - 2);}
    mint& operator/=(const mint a) { return (*this) *= a.inv();}
    friend const mint operator/(const mint& a, const mint& b) { mint ret = a; return ret /= b; }
};

void solve() {
    ll n;
    cin >> n;
    vll a(n);
    rep(i, n) cin >> a[i];
    sort(a.begin(), a.end());

    mint base = 1;
    vector<mint> b(n);
    b[0] = 1;
    for(int i = 1; i < n; ++i) {
        b[i] = base;
        base *= 2;
    }
    rep(i, n) b[i] *= a[i];
    vector<mint> bs(n+1);    // [l,r)のb[i]の和はbs[r]-bs[l]
    rep(i, n) bs[i+1] = bs[i] + b[i];

    mint ans = 0;
    base = 1;
    rep(i, n) {
        ans += ((bs[n] - bs[i+1]) * base + a[i]) * a[i];
        base /= 2;
    }
    cout << ans << endl;
    return;
}

int main() {
    std::cin.tie(nullptr);
    std::ios_base::sync_with_stdio(false);
    cout << fixed << setprecision(15);
    solve();
}

#include <bits/stdc++.h>
using namespace std;
const int P = 998'244'353;
using ll = long long;
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  int n;
  cin >> n;
  int a[n];
  for (int &x : a) cin >> x;
  sort(a, a + n);
  ll s = 0, r = 0;
  for (int i = 0; i < n; ++i) {
    r += (s + a[i]) * a[i] % P;
    s = 2 * s + a[i];
    s %= P;
  }
  cout << r % P << endl;
}


#include <bits/stdc++.h>
using namespace std;
#define MOD 1000000007
#define int long long int
#define popcount(x) __builtin_popcountll(x)
#define fastio ios::sync_with_stdio(false);cin.tie(0);cout.tie(0);
#define sc second
#define pb push_back
#define fr first
#define all(a) (a).begin(),(a).end()
#define mem0(a) memset(a,0,sizeof(a))
#define ld long double
const long long  INF = __LONG_LONG_MAX__;
#define rall(a) (a).rbegin(),(a).rend()
#pragma GCC optimize("Ofast")
#pragma GCC target("avx,avx2,fma")
#pragma GCC optimization ("unroint-loops")

int power(int a,int b,int m)
{
  int res=1;
  while(b)
  {
    if(b&1) res=((res%m)*(a%m))%m;
    a=((a%m)*(a%m))%m;
    b>>=1;
  }
  return res;
}

int power(int a,int b)
{
  int res=1;
  while(b)
  {
    if(b&1) res*=a;
    a*=a;
    b>>=1;
  }
  return res;
}

//a+b=a⊕b+2(a&b)
//a+b=a|b+a&b
//a⊕b=a|b−a&b

void solve()
{
  int n,c;
  cin>>n>>c;
  map<int,int>mp;
  for(int i=0;i<n;i++)
  {
    int a,b,c;
    cin>>a>>b>>c;
    mp[a]+=c;
    mp[b+1]-=c;
  }
  int ans=0,curr=0;
  pair<int,int> prev={-1,-1};
  for(auto i:mp)
  {
    if(prev.fr==-1)
    {
      prev={i.fr,i.sc};
    }
    else
    {
      curr+=prev.sc;
      int days=i.fr-prev.fr;
      ans+=min(c,curr)*days;
      prev={i.fr,i.sc};
    }
  }
  cout<<ans;
}

signed main()
{
  fastio
  int tt=1;
  // cin>>tt;
  //  freopen("input.txt", "r" , stdin);
  // freopen("output.txt", "w", stdout);
  while(tt--)
  {
    solve();
    cout<<"\n";
  }
  return 0;
}

#include <bits/stdc++.h>
using namespace std;
#define MOD (long long int)(998244353)
#define ll long long int
#define rep(i,n) for(int i=0; i<(int)(n); i++)
#define reps(i,n) for(int i=1; i<=(int)(n); i++)
#define REP(i,n) for(int i=n-1; i>=0; i--)
#define REPS(i,n) for(int i=n; i>0; i--)
#define FOR(i,a,b) for(int i=a; i<(int)(b); i++)
#define ALL(x) (x).begin(),(x).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define CLR(a) memset((a), 0 ,sizeof(a))
#define PB push_back
#define MP make_pair
#define SP << " " <<
const int INF = 1001001001;
const ll LINF = 100100100100100100;
const double EPS = 1e-10;
const long double PI  = acos(-1.0L);
typedef pair<int,int> PII;
typedef pair<ll,ll> PLL;
typedef pair<double,double> PDD;
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<ll> VL;
#define chmax(a,b) a = (((a)<(b))?(b):(a))
#define chmin(a,b) a = (((a)>(b))?(b):(a))

__attribute__((constructor))
void initial(){
	cin.tie(nullptr);
	ios::sync_with_stdio(false);
	cout << fixed << setprecision(15);
}

signed main() {
	ll n,p; cin>>n>>p;
	// VVL d(n);
	// rep(i,n){
	// 	VL a(3); rep(j,3) cin>>a[j];
	// 	d.PB(a);
	// }
	// sort(ALL(d));
	// ll ans = 0LL, now = 0LL;
	// priority_queue<PLL,vector<PLL>,greater<PLL>> que;
	// ll today = 0LL;
	// ll yesterday = 0LL;
	// rep(i,n){
	// 	today = a[i];
	// 	if(now>p){
	// 		ans += p*(today-yesterday);
	// 	}else{
	// 		ans += now*(today-yesterday);
	// 	}
	// 	now += c[i]; que.push({b[i],c[i]});
	// 	while(que.top().first<today){
	// 		now -= que.top().second;
	// 		que.pop();
	// 	}
	// }
	vector<PLL> d;
	rep(i,n){
		ll a,b,c; cin>>a>>b>>c;
		d.PB({a,+c}); d.PB({b+1,-c});
	}
	sort(ALL(d));
	ll now=0LL, last=0LL;
	ll cost=0LL, ans=0LL;
	rep(i,n*2){
		now=d[i].first;
		// cerr<<d[i].first SP d[i].second SP now SP last SP cost SP ans <<endl;
		if(d[i].second>0){
			ans+=min(cost,p)*(now-last);
			cost+=d[i].second;
		}else{
			ans+=min(cost,p)*(now-last);
			cost+=d[i].second;
		}
		last=now;
	}
	cout<<ans<<endl;
	return 0;
}


#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i,N) for(int i=0;i<int(N);++i)
#define rep1(i,N) for(int i=1;i<int(N);++i)
#define all(a) (a).begin(),(a).end()
#define bit(k) (1LL<<(k))
#define SUM(v) accumulate(all(v), 0LL)

typedef pair<int, int> i_i;
typedef pair<ll, ll> l_l;
template <class T> using vec = vector<T>;
template <class T> using vvec = vector<vec<T>>;
struct fast_ios{ fast_ios(){ cin.tie(0); ios::sync_with_stdio(false); cout << fixed << setprecision(20); }; }fast_ios_;

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

#define TOSTRING(x) string(#x)
template <typename T> istream &operator>>(istream &is, vector<T> &vec) { for (T &x : vec) is >> x; return is; }
template <typename T> ostream &operator<<(ostream &os, const vector<T> &v) { os  << "["; for(auto _: v) os << _ << ", "; os << "]"; return os; };
template <typename T> ostream &operator<<(ostream &os, set<T> &st) { os << "("; for(auto _: st) { os << _ << ", "; } os << ")";return os;}
template <typename T> ostream &operator<<(ostream &os, multiset<T> &st) { os << "("; for(auto _: st) { os << _ << ", "; } os << ")";return os;}
template <typename T, typename U> ostream &operator<<(ostream &os, const pair< T, U >& p){os << "{" <<p.first << ", " << p.second << "}";return os; }
template <typename T, typename U> ostream &operator<<(ostream &os, const map<T, U> &mp){ os << "["; for(auto _: mp){ os << _ << ", "; } os << "]" << endl; return os; }

#define DUMPOUT cerr
void dump_func(){ DUMPOUT << endl; }
template <class Head, class... Tail> void dump_func(Head &&head, Tail &&... tail) { DUMPOUT << head; if (sizeof...(Tail) > 0) { DUMPOUT << ", "; } dump_func(std::move(tail)...); }

#ifdef DEBUG
#define dbg(...) { dump_func(__VA_ARGS__) }
#define dump(...) DUMPOUT << string(#__VA_ARGS__) << ": "; dump_func(__VA_ARGS__)
#else
#define dbg(...)
#define dump(...)
#endif

const int INF = (ll)1e9;
const ll INFLL = (ll)1e18+1;
const ll MOD = 1000000007;
// const ll MOD = 998244353;
const long double PI = acos(-1.0);

/*
const int dx[8] = {1, 0, -1, 0, 1, -1, -1, 1};
const int dy[8] = {0, 1, 0, -1, 1, 1, -1, -1};
const string dir = "DRUL";
*/

template<typename T, typename U>
T modpow(T a, U n, int mod) {
    ll res = 1;
    while (n > 0) {
        if (n & 1) res = res * a % mod;
        a = a * a % mod;
        n >>= 1;
    }
    return res;
}
char versus(const char&a, const char b){
    char res = a;
    if(a == b)res = a;
    else{
        if(a == 'R' && b == 'P')res = 'P';
        if(a == 'P' && b == 'R')res = 'P';
        if(a == 'P' && b == 'S')res = 'S';
        if(a == 'S' && b == 'P')res = 'S';
        if(a == 'S' && b == 'R')res = 'R';
        if(a == 'R' && b == 'S')res = 'R';
    }
    return res;
}
int N, K;
string S;
char dp[200][200];
// lenは2^lenになる
char dfs(int st, int len){
    if(dp[st][len] != 'X'){
        return dp[st][len];
    }
    else{
        return dp[st][len] = versus(dfs(st, len-1), dfs((st + modpow(2, len-1, N))%N, len-1));
    }
}

int main() {
    cin >> N >> K >> S;
    rep(i,200)rep(j,200)dp[i][j] = 'X';
    rep(i,N){
        dp[i][0] = S[i];
    }
    cout << dfs(0, K) << endl;
    rep(i,N)rep(j,K){
        dump(i, j, dp[i][j]);
    }
}

//#pragma GCC optimize ("O2")
//#pragma GCC target ("avx2")
#include<bits/stdc++.h>
//#include<atcoder/all>
//using namespace atcoder;

using namespace std;
typedef long long ll;
#define rep(i, n) for(int i = 0; i < (n); i++)
#define rep1(i, n) for(int i = 1; i <= (n); i++)
#define co(x) cout << (x) << "\n"
#define cosp(x) cout << (x) << " "
#define ce(x) cerr << (x) << "\n"
#define cesp(x) cerr << (x) << " "
#define pb push_back
#define mp make_pair
#define chmin(x, y) x = min(x, y)
#define chmax(x, y) x = max(x, y)
#define Would
#define you
#define please

#define PT pair<ll, int>

int N, M, K;
vector<int> E[100001];
int D[100001], C[100];
int DD[20][20];
int dp[20][1 << 17];
int sagasu(int p, int b) {
	if (dp[p][b]) return dp[p][b];
	int ret = 1e9;
	rep(i, K) if(i != p && (b >> i & 1)) {
		chmin(ret, sagasu(i, b ^ (1 << p)) + DD[i][p]);
	}
	return dp[p][b] = ret;
}

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

	cin >> N >> M;
	rep(i, M) {
		int a, b;
		cin >> a >> b;
		E[a].pb(b);
		E[b].pb(a);
	}
	cin >> K;
	rep(i, K) cin >> C[i];

	rep(k, K) {

		rep1(i, N) D[i] = 1e9;
		priority_queue<PT, vector<PT>, greater<PT>> que;
		D[C[k]] = 0;
		que.push(mp(0, C[k]));
		while (que.size()) {
			PT p = que.top();
			que.pop();
			int i = p.second;
			if (D[i] != p.first) continue;
			for (int j : E[i]) {
				ll d = D[i] + 1;
				if (D[j] > d) {
					D[j] = d;
					que.push(mp(d, j));
				}
			}
		}
		rep(p, K) {
			DD[k][p] = D[C[p]];
			dp[p][1 << k | 1 << p] = DD[k][p] + 1;
		}
	}

	int kotae = 1e9;
	rep(i, K) chmin(kotae, sagasu(i, (1 << K) - 1));

	if (kotae < 1e8) co(kotae);
	else co(-1);

	Would you please return 0;
}