#include<bits/stdc++.h>
#define LL long long
#define rint register int
#define LB lower_bound
#define UB upper_bound
#define MS(x,y) memset(x,y,sizeof(x))
#define rep(i,a,b) for(rint i=a,i##end=b;i<=i##end;++i)
#define drep(i,a,b) for(rint i=a,i##end=b;i>=i##end;--i)
#define cms printf("%.2lf\n",(&o2-&o1)/1024.0/1024);
using namespace std;bool o1;
char IO;
inline int Rd(){
	int _s_=0;bool _f_=0;
	while(!isdigit(IO=getchar()))
		(IO=='-')&&(_f_=1);
	do _s_=(_s_<<1)+(_s_<<3)+(IO^48);
	while(isdigit(IO=getchar()));
	return _f_?-_s_:_s_;
}
const int P=1e9+7,n2=5e8+4;
int n,m,k,n2m,a1,b1,in[104];
void cmod(int &x){
	x>=P&&(x-=P);
}
int ksm(int x){
	int rst=1;
	for(rint y=P-2;y;y>>=1,x=1ll*x*x%P)
		(y&1)&&(rst=1ll*rst*x%P);
	return rst;
}
struct node{
	int a[105][105];
	node(){MS(a,0);}
	node operator * (const node &_) const{
		node rst;
		rep(i,1,n)
			rep(j,1,n)
				rep(l,1,n)
					cmod(rst.a[i][j]+=1ll*a[i][l]*_.a[l][j]%P);
		return rst;
	}
}st,nw;
bool o2;int main(){
	n=Rd(),m=Rd(),k=Rd();
	n2m=1ll*ksm(m)*n2%P;
	rep(i,1,n)
		st.a[1][i]=Rd();
	rep(i,1,m){
		in[a1=Rd()]++,in[b1=Rd()]++;
		nw.a[a1][b1]=nw.a[b1][a1]=n2m;
	}
	rep(i,1,n)
		cmod(nw.a[i][i]=P+1-1ll*in[i]*n2m%P);
	rep(i,0,29){
		if(k&(1<<i))
			st=st*nw;
		nw=nw*nw;
	}
	rep(i,1,n)
		printf("%d\n",st.a[1][i]);
	return 0;
}

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define endll "\n"
#pragma GCC optimize(1)
#pragma GCC optimize(2)
#define ull unsigned long long
#define rep(i,b) for(int i=0;i<b;i++)
#define For(i, a, b) for(int i=a;i<=b;i++)
#define Rof(i, a, b) for(int i=a;i>=b;i--)
#define rest(a, b) memset(a,b, sizeof(a));
#define recopy(a, b) memcpy(b, a, sizeof(a));
#define IOS ios::sync_with_stdio(false);cin.tie(0);cout.tie(0)
int gcd(int a, int b) {while (b ^= a ^= b ^= a %= b);return a;}//最大公约数
ll gcd(ll a, ll b) {while (b ^= a ^= b ^= a %= b);return a;}
const int inf = 0x3f3f3f3f;
const int mod = 1e9+7;
const int N=1e5+50;
const int maxx=1e7;

int main(){
    int x,y,z;
    cin>>x>>y>>z;
    int d=y*z/x;
    if((y*z)%x==0)  d--;
    cout<<d<<endl;
    return 0;
}


#include <bits/stdc++.h>
using namespace std;
int main() {
  int a, b, c;
  cin >> a >> b >> c;
  if(a == b) {
    cout << c << endl;
  }
  else if(b == c) {
    cout << a << endl;
  }
  else if(c == a) {
    cout << b << endl;
  }
  else {
    cout << 0 << endl;
  }
}

#include <iostream>

using namespace std;
int a, b, c, d, resta_max;
int main()
{
    cin>>a>>b>>c>>d;
    resta_max=max(max(a-c, max(a-d, b-c)), b-d);
    cout<<resta_max;
    return 0;
}


#include <bits/stdc++.h>
#define int int64_t

using namespace std;

int32_t main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    int n;
    cin>>n;
    string s,x;
    cin>>s>>x;
    int curr=1;
    set<int> nope;
    nope.insert(0);
    for (int i=n;i>=1;i--)
    {
        if (i!=n)
        {
            curr=(curr*10)%7;
        }
        int dig=s[i-1]-'0';
        dig=(dig*curr)%7;
        if (x[i-1]=='T')
        {
            set<int> cnt;
            for (auto el:nope)
            {
                cnt.insert(el);
                if (el<dig)
                    el+=7;
                el=el-dig;
                cnt.insert(el);
            }
            nope.clear();
            nope=cnt;
        }
        else
        {
            set<int> cnt;
            for (int i=0;i<=6;i++)
            {
                int nx=i+dig;
                nx=nx%7;
                if (nope.find(i)!=nope.end()&&nope.find(nx)!=nope.end())
                    cnt.insert(i);
            }
            nope.clear();
            nope=cnt;
        }
    }
    if (nope.find(0)!=nope.end())
        cout<<"Takahashi";
    else cout<<"Aoki";
    return 0;
}

#pragma GCC optimize("Ofast")
//#ifndef ONLINE_JUDGE
//#define _GLIBCXX_DEBUG
//#endif
#ifdef ONLINE_JUDGE
#include <atcoder/all>
#endif
#include <bits/stdc++.h>
#include <chrono>
#include <random>
#include <math.h>
#include <complex>

using namespace std;
#ifdef ONLINE_JUDGE
using namespace atcoder;
#endif
#define rep(i,n) for (int i = 0;i < (int)(n);i++)
using ll = int;
#ifdef ONLINE_JUDGE
//using mint = modint998244353;
//using mint = modint;
using mint = modint1000000007;
#endif
const ll MOD=1000000007;
//const ll MOD=998244353;
const long long INF = 1 << 25;
const double pi=acos(-1.0);
int dx[9] = {1, 0, -1, 0, 1, 1, -1, -1, 0};
int dy[9] = {0, 1, 0, -1, 1, -1, -1, 1, 0};

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; }

int uf[1<<18];

int main()
{
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
  // cout << fixed << setprecision(15);

  ll N,M; cin>>N>>M;
  vector<ll> graph(N,0);
  rep(_,M) {
    int a,b; cin>>a>>b; a--; b--;
    graph[a]|=1<<b;
    graph[b]|=1<<a;
  }

  vector<ll> dp(1<<N,INF);
  dp[0]=1;
  rep(i,N) rep(S,1<<N) {
    if(dp[S]==1&&(graph[i]&S)==S) dp[S|1<<i]=1;
  }

  rep(S,1<<N) for(ll T=S;;T=(T-1)&S) {
    chmin(dp[S],dp[T]+dp[S&~T]);
    if(!T) break;
  }

  cout<<dp[(1<<N)-1]<<'\n';

  return 0;
}


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

using namespace std;

#define int long long

int f(string s){
	vector<int> a(10);
	for(char c : s) a[c - '0']++;
	int res = 0;
	for(int i = 1; i <= 9; i++){
		int x = 1;
		for(int j = 0; j < a[i]; j++){
			x *= 10;
		}
		res += x * i;
	}
	return res;
}

signed main(void){
	ios::sync_with_stdio(false);
	cin.tie(nullptr);
	int k;
	cin >> k;
	string s, t;
	cin >> s >> t;
	vector<int> c(10, k);
	c[0] = 0;
	for(int i = 0; i < 4; i++){
		c[s[i] - '0']--;
		c[t[i] - '0']--;
	}
	int cnt = 0;
	for(int a = 1; a <= 9; a++){
		for(int b = 1; b <= 9; b++){
			s[4] = '0' + a;
			t[4] = '0' + b;
			if(f(s) > f(t)){
				if(a == b) cnt += c[a] * (c[a] - 1);
				else cnt += c[a] * c[b];
			}
		}
	}
	int C = 0;
	for(int i = 0; i < 10; i++){
		C += c[i];
	}
	int tot = C * (C - 1);
	double ans = (double) cnt / tot;
	printf("%.10f\n", ans);
	return 0;
}

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef __int128_t LL;
typedef long double ld;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
#define F first
#define S second
#define pb push_back
mt19937 rnd;

const int N = 1e5 + 10;
vector<ll> a[3];

bool is_even(int x) {
    return !(x & 1);
}

int main() {
    ios_base::sync_with_stdio(0); cin.tie(0);
#ifdef LOCAL
    freopen("input.txt", "r", stdin);
#endif

    int n;
    cin >> n;
    n *= 2;
    for (int i = 1; i <= n; i++) {
        ll val;
        char ch;
        cin >> val >> ch;
        if (ch == 'R') a[0].pb(val);
        else if (ch == 'G') a[1].pb(val);
        else a[2].pb(val);
    }
    for (int i = 0; i < 3; i++) {
        sort(a[i].begin(), a[i].end());
    }
    ll ans = 1e18;
    if (is_even(a[0].size()) && is_even(a[1].size()) && is_even(a[2].size())) {
        ans = 0;
    }
    for (int x = 0; x < 3; x++) {
        for (int y = x + 1; y < 3; y++) {
            int z = 3 - x - y;
            if (!is_even(a[x].size()) && !is_even(a[y].size())) {
                assert(is_even(a[z].size()));
                for (int i = 0, j = 0; i < a[x].size(); i++) {
                    while (j + 1 < a[y].size() && a[y][j] < a[x][i]) {
                        j++;
                    }
                    ll cur = 1e18;
                    for (int k = max(0, j - 5); k <= min(int(a[y].size() - 1), j + 5); k++) {
                        cur = min(cur, abs(a[x][i] - a[y][k]));
                    }
                    ans = min(ans, cur);
                }
                if (!a[z].empty()) {
                    vector<pair<ll, int>> lef, rig;
                    for (int i = 0, j = 0; i < a[z].size(); i++) {
                        while (j + 1 < a[x].size() && a[x][j] < a[z][i]) {
                            j++;
                        }
                        ll cur = 1e18;
                        for (int k = max(0, j - 5); k <= min(int(a[x].size() - 1), j + 5); k++) {
                            cur = min(cur, abs(a[z][i] - a[x][k]));
                        }
                        lef.pb({cur, i});
                    }
                    for (int i = 0, j = 0; i < a[z].size(); i++) {
                        while (j + 1 < a[y].size() && a[y][j] < a[z][i]) {
                            j++;
                        }
                        ll cur = 1e18;
                        for (int k = max(0, j - 5); k <= min(int(a[y].size() - 1), j + 5); k++) {
                            cur = min(cur, abs(a[z][i] - a[y][k]));
                        }
                        rig.pb({cur, i});
                    }
                    sort(lef.begin(), lef.end());
                    sort(rig.begin(), rig.end());
                    for (int i = 0; i < lef.size() && i < 10; i++) {
                        for (int j = 0; j < rig.size() && j < 10; j++) {
                            if (lef[i].S != rig[j].S) {
                                ans = min(ans, lef[i].F + rig[j].F);
                            }
                        }
                    }
                }
            }
        }
    }
    cout << ans << "\n";

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


#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef vector<ll> vi;
typedef pair<ll,ll> pi;
typedef vector<pi> vp;
typedef set<ll> si;
typedef map<string, ll> msi;
#define REP(i,a,b) \
for(ll i=ll(a);i<=ll(b);i++)
#define DEP(i,a,b) \
for(ll i=ll(a);i>=ll(b);i--)
#define TR(c, it) \
for (auto it = (c).begin(); it != (c).end(); it++)
#define mp make_pair
#define pb push_back
#define F first
#define S second
ll mod = 1e9+7;
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);

  int T;
  T=1;
  while(T--)
  {
      ll n,i,j,k,l,m;
      cin>>n;
      ll x,y;
      ll a[n],b[n];
      REP(i,0,n-1)cin>>a[i];
      REP(i,0,n-1)cin>>b[i];
      x=a[0];
      y=b[0];
      int flag=0;
      REP(i,1,n-1){
        k=a[i];
        m=b[i];
        x=max(k,x);
        y=min(y,m);
        if(x>y)flag=1;
        //cout<<x<<" "<<y<<endl;
      }
      if(flag)cout<<"0";
      else cout<<y-x+1;
  }
  return 0;
}

#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define inf 1e18
#define IOS ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL)
#define pb push_back
#define ff first
#define ss second
#define vll vector<ll>
#define pii pair<ll,ll>
#define sz(v) (v).size()
#define srt(v) sort(v.begin(),v.end())
#define ull unsigned long long
#define tell(a) cout<<a<<" "
#define el cout<<endl
#define rev(v) reverse(v.begin(),v.end())
#define rep(i,a,n) for(int i=a;i<n;i++)
#define ld long double
#define mem(a,b) memset(a,b,sizeof(a) )
#define M 4000010
#define md 1000000007

ll power(ll x, ll y, ll p){ll res = 1;x = x % p;while (y > 0){   if (y & 1)res = (res*x) % p;y = y>>1;
x = (x*x) % p;}return res;}
/*inline ll add(ll a,ll b){return (a+b)%md;}
inline ll mul(ll a,ll b){return (a*b)%md;}
ll f[M],iv[M];
ll C(ll n,ll r){return mul(f[n],mul(iv[r],iv[n-r]));}
void prep_fac(){
    f[0]=1;
    rep(i,1,M)f[i]=mul(i,f[i-1]);
    iv[M-1]=power(f[M-1],md-2,md);
    for(ll i=M-2;i>=0;--i)iv[i]=mul(i+1,iv[i+1]);
}*/

int main()
{
	IOS;
	ll n;
	cin>>n;
	set<ll>s;
	for(ll i=1;i*i<=n;i++){
		if(n%i==0){
			ll x=n/i;
			ll y=i;
			s.insert(x);
			s.insert(y);
		}
	}
	for(auto it=s.begin();it!=s.end();it++){
		cout<<*it<<endl;
	}
}


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

#ifndef ONLINE_JUDGE
#define dbg(...) cout << "[" << #__VA_ARGS__ << "]: "; cout << to_string(__VA_ARGS__) << endl
template <typename T, size_t N> int SIZE(const T (&t)[N]){ return N; } template<typename T> int SIZE(const T &t){ return t.size(); } string to_string(const string s, int x1=0, int x2=1e9){ return '"' + ((x1 < s.size()) ? s.substr(x1, x2-x1+1) : "") + '"'; } string to_string(const char* s) { return to_string((string) s); } string to_string(const bool b) { return (b ? "true" : "false"); } string to_string(const char c){ return string({c}); } template<size_t N> string to_string(const bitset<N> &b, int x1=0, int x2=1e9){ string t = ""; for(int __iii__ = min(x1,SIZE(b)),  __jjj__ = min(x2, SIZE(b)-1); __iii__ <= __jjj__; ++__iii__){ t += b[__iii__] + '0'; } return '"' + t + '"'; } template <typename A, typename... C> string to_string(const A (&v), int x1=0, int x2=1e9, C... coords); int l_v_l_v_l = 0, t_a_b_s = 0; template <typename A, typename B> string to_string(const pair<A, B> &p) { l_v_l_v_l++; string res = "(" + to_string(p.first) + ", " + to_string(p.second) + ")"; l_v_l_v_l--; return res; } template <typename A, typename... C> string to_string(const A (&v), int x1, int x2, C... coords) { int rnk = rank<A>::value; string tab(t_a_b_s, ' '); string res = ""; bool first = true; if(l_v_l_v_l == 0) res += n_l; res += tab + "["; x1 = min(x1, SIZE(v)), x2 = min(x2, SIZE(v)); auto l = begin(v); advance(l, x1); auto r = l; advance(r, (x2-x1) + (x2 < SIZE(v))); for (auto e = l; e != r; e = next(e)) { if (!first) { res += ", "; } first = false; l_v_l_v_l++; if(e != l){ if(rnk > 1) { res += n_l; t_a_b_s = l_v_l_v_l; }; } else{ t_a_b_s = 0; } res += to_string(*e, coords...); l_v_l_v_l--; } res += "]"; if(l_v_l_v_l == 0) res += n_l; return res; } void dbgm(){;} template<typename Heads, typename... Tails> void dbgm(Heads H, Tails... T){ cout << to_string(H) << " | "; dbgm(T...); }
#define dbgm(...) cout << "[" << #__VA_ARGS__ << "]: "; dbgm(__VA_ARGS__); cout << endl
#endif

#define pb push_back
#define all(x) (x).begin(),(x).end()
#define fi first
#define se second
#define sz(x) ((int)(x).size())
#define forn(i,n) for(int i=0;i<n;i++)
#define for1(i,n) for(int i=1;i<=n;i++)
typedef vector<int> vi;
typedef vector<ll> vl;
typedef pair<int,int> pii;
typedef double db;
typedef vector<vi> vvi;
const ll mod=1000000007;
const ll N=200005; //check this
int dx[] = {-1, 0, 1, 0, 1, 1, -1, -1};
int dy[] = {0, -1, 0, 1, 1, -1, 1, -1};

ll powmod(ll a,ll b) {ll res=1;a%=mod; assert(b>=0); for(;b;b>>=1){if(b&1)res=res*a%mod;a=a*a%mod;}return res;}
ll powb(ll a,ll b) {ll res=1;a ; assert(b>=0); for(;b;b>>=1){if(b&1)res=res*a;a=a*a;}return res;}
ll gcd(ll a,ll b) { return b?gcd(b,a%b):a;}

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

    #ifndef ONLINE_JUDGE
    freopen("inputf.in", "r", stdin);
    freopen("outputf.in", "w", stdout);
    #endif

    int t=1;
    //cin>>t;
    while(t--){
    	int n, k;cin >> n >> k;
    	vi ct(n + 1, 0);
    	vl a(n);
		forn(i,n){
			cin >> a[i];
			ct[a[i]] = min(ct[a[i]] + 1, k);
		}
		vi pre(n+1,0);
		int cur = 1e6;
		for(int i = 0; i <= n; i++){
			cur = min(cur, ct[i]);
			pre[1]++;
			pre[cur+1]--;
		}
		int ans = 0;
		for(int i = 1 ;i <= n; i++){
			pre[i] += pre[i-1];
			ans += pre[i];
		}
		cout << ans;
    }
}

#include<bits/stdc++.h>
using namespace std;
#define MOD 1000000007
//#define MOD 998244353
#define INF 1000000010
#define EPS 1e-9
#define F first
#define S second

#define debug(x) cout<<x<<endl;
#define repi(i,x,n) for(int i=x;i<n;i++)
#define rep(i,n) repi(i,0,n)
#define lp(i,n) repi(i,0,n)
#define repn(i,n) for(int i=n;i>=0;i--)
#define int long long
#define endl "\n"

typedef pair<int,int> PII;
typedef pair<int,string> PIS;
typedef pair<string,int> PSI;

signed main(){
  cin.tie(0);
  ios::sync_with_stdio(false);
  int n,k;
  cin>>n>>k;
  deque<int> a;
  int num;
  rep(i,n){
    cin>>num;
    a.push_back(num);
  }
  sort(a.begin(),a.end());
  int nex=0;
  int ans=0;
  int cnt=0;
  while(!a.empty()){
    //cout<<a[0]<<" "<<nex<<" "<<k<<endl;
    //if(nex==6) break;
    cnt=0;
    while(a[0]==nex){
      cnt++;
      a.pop_front();
    }
    ans+=max( (int)0,k-cnt)*nex;
    k=min(k,cnt);
    nex++;
  }
  if(k!=0){

    ans+=nex*k;
  }
  cout<<ans<<endl;

  return 0;
}


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

void solve(){
    int n ;
    cin>>n;
    int ans = n/100;
    if( n % 100 ) ans ++;
    cout<<ans<<endl;
}

int main(){
    solve();
}

#include <iostream>

using namespace std;

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

  for (int i = 0; i < (int)s.length(); i++) {
    if (s[i] == '.') {
      break;
    }
    cout << s[i];
  }
  cout << endl;

  return 0;
}


// #pragma comment(linker, "/stack:200000000000")
// #pragma GCC optimize("Ofast")
// #pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")

#include <bits/stdc++.h>

using namespace std;
using i128 = __int128_t;
using u128 = __uint128_t;
using u64 = uint64_t;

//define
#define int long long
#define ll int
#define trav(i,v)   for(auto i: v)
#define rep(i,n)    for(int i=0;i<n;i++)
#define repu(i,k,n) for(int i=k;i<=n;i++)
#define repd(i,k,n) for(int i=k;i>=n;i--)
#define se second
#define fi first
#define pb push_back
#define mp make_pair
#define all(v)  v.begin(), v.end()
#define itn int
#define sz(x) (int)x.size()

//typedef
typedef unsigned long long ull;
typedef long double ld;
typedef std::pair<int, int> pii;
typedef std::vector<int> vi;
typedef std::vector< pii > vii;
typedef std::vector< std::vector<int> > vvi;
typedef std::vector< std::pair < pii, int > > vpp;

const long long MOD = 1000000007;
// const long long MOD = 998244353;
const long double PI = 3.141592653589793238;
const long long pi = 31415926;
const long long inf = 1000000000000000000;
const long long small_inf = INT_MAX;
const int N = 500;

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

void init(){

}

void solve()
{
/*Don't hurry, nothing good comes if you rush*/
	int n, q;
	cin>>n>>q;
	vi v(n,0);
	rep(i,n){
		cin>>v[i];
	}
	while(q--){
		itn k;
		cin>>k;
		int l = k, r = k+100005;
		while(l<r){
			int m = (l+r)/2;
			int pos = upper_bound(all(v), m) - v.begin();
			int m1 = m-pos;
			if(m1>=k)
				r = m;
			else
				l = m+1;
		}
		cout<<l<<endl;
	}
}

signed main(){
    // #ifndef ONLINE_JUDGE
    //    freopen("./input.txt", "r", stdin);
    //    freopen("./output.txt", "w", stdout);
    // #endif
    ios_base::sync_with_stdio(0);
    cin.tie(NULL);

    int t23 = 1, tt23 = 1;
    // cin>>t23;
    init();
    while(tt23<=t23)
    {
        // cout<<"Case #"<<tt23<<": ";
        solve();
        tt23++;
    }
    cerr << "Time : " << 1000 * ((double)clock()) / (double)CLOCKS_PER_SEC << "ms\n";
}

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

void solve();
int main() {
    ios::sync_with_stdio(false);
    cin.tie(0);
#ifdef INPUT_FILE
    auto fre = freopen(INPUT_FILE, "r", stdin);
    if (fre == nullptr) {
        cout << "invalid input file path: " << INPUT_FILE << endl;
        return 0;
    }
#endif
    solve();
#ifdef INPUT_FILE
    fclose(fre);
#endif
    return 0;
}

long a[100001];

// index of larget number <= target
int binary_search(int i, int j, long target) {
    while (i <= j) {
        int mid = (j - i) / 2 + i;
        if (target == a[mid]) {
            return mid;
        }
        if (target < a[mid]) {
            j = mid - 1;
        } else {
            i = mid + 1;
        }
    }
    return j;
}

void solve() {
    int n, q;
    while (cin >> n >> q) {
        for (int i = 1; i <= n; ++i) {
            cin >> a[i];
        }
        sort(a + 1, a + n + 1);
        for (int i = 0; i < q; ++i) {
            long k;
            cin >> k;
            int left = 1, right = n;
            do {
                int index = binary_search(left, n, k);
                if (index == left - 1) {
                    break;
                }
                k += index - left + 1;
                left = index + 1;
            } while (true);
            cout << k << endl;
        }
    }
}


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

typedef long long ll;
typedef double ld;

#define FOR(i, a, b, s) for(int i = (a); (s)>0?i<(b):i>(b); i+=(s))
#define F_OR(i, a, b, s) for(int i = (a); (s)>0?i<=(b):i>=(b); i+=(s))
#define EACH(x, a) for(auto& x: a)

#define vt vector
#define pb push_back
#define rev reverse
#define all(x) (x).begin(), (x).end()
#define sz(x) (int)(x).size()

#define getchar_unlocked getchar
#define fastio ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define inputtxt freopen("input.txt", "r", stdin);
#define outputtxt freopen("output.txt", "w", stdout);
#define sf scanf
#define pf printf
#define endl '\n'

#define inf32 2000000000
#define inf64 2000000000000000000
#define mod17 1000000007
#define mod93 998244353
#define mx 1000000
#define eps 1e-9

template <typename T> T max(T& x, T& y){
    return x<y?y:x;
}

template <typename T> T min(T& x, T& y){
    return x>y?y:x;
}

/*
ll modexp(ll b, ll e, ll m){
    ll r = 1;
    while(e > 0){
        if(e & 1) r = (r*b)%m;
        b = (b*b)%m;
        e >>= 1;
    }
}
*/

/*
void GetStr(char* res){
    char c;
    for(;;){
        c=getchar_unlocked();
        if(c==' ' || c=='\n') continue;
        else break;
    }
    *res=c; res++;
    for(;;){
        c=getchar_unlocked();
        if (c==' ' || c=='\n' || c==EOF) break;
        *res=c; res++;
    }
    *res='\0';
}
*/

/*
void Getll(ll &val){
    char ch;bool bo=0;val=0;
    for (ch=getchar_unlocked();ch<'0'||ch>'9';ch=getchar_unlocked())if (ch=='-')bo=1;
    for (;ch>='0'&&ch<='9';val=(val<<1)+(val<<3)+ch-48,ch=getchar_unlocked());
    if (bo)val=-val;
}
*/

void Getint(int &val){
    char ch;bool bo=0;val=0;
    for (ch=getchar_unlocked();ch<'0'||ch>'9';ch=getchar_unlocked())if (ch=='-')bo=1;
    for (;ch>='0'&&ch<='9';val=(val<<1)+(val<<3)+ch-48,ch=getchar_unlocked());
    if (bo)val=-val;
}

int k;
ll ans, tambah;

int main(){
    Getint(k);
    int b1 = cbrt(k);
    F_OR(i,1,b1,1){
        int b2 = sqrt(k/i);
        F_OR(j,i,b2,1){
            if(i == j) tambah = 1;
            else tambah = 3;
            int b3 = k/(i*j);
            if(b3 < j) break;
            tambah = tambah + (b3-j)*(tambah == 1?3:6);
            ans += tambah;
            //printf("%d %d: %lld\n", i, j, tambah);
        }
    }
    printf("%lld\n",ans);
    return 0;
}

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

using namespace __gnu_pbds;
using namespace std;

using ll = long long;
using ld = long double;

typedef tree<
        int,
        null_type,
        less<int>,
        rb_tree_tag,
        tree_order_statistics_node_update>
        ordered_set;

#define mp make_pair

const int p =  1e9 + 7;

int mul(int a, int b) {
    return (1LL * a * b) % p;
}

int add(int a, int b) {
    int s = (a+b);
    if (s>=p) s-=p;
    return s;
}

int sub(int a, int b) {
    int s = (a+p-b);
    if (s>=p) s-=p;
    return s;
}

int po(int a, ll deg)
{
    if (deg==0) return 1;
    if (deg%2==1) return mul(a, po(a, deg-1));
    int t = po(a, deg/2);
    return mul(t, t);
}

int inv(int n)
{
    return po(n, p-2);
}

mt19937 rnd(time(0));

/*
const int N = 1e6 + 5;

vector<int> facs(N), invfacs(N);

void init()
{
    facs[0] = 1;
    for (int i = 1; i<N; i++) facs[i] = mul(facs[i-1], i);
    invfacs[N-1] = inv(facs[N-1]);
    for (int i = N-2; i>=0; i--) invfacs[i] = mul(invfacs[i+1], i+1);
}

int C(int n, int k)
{
    if (n<k) return 0;
    if (n<0 || k<0) return 0;
    return mul(facs[n], mul(invfacs[k], invfacs[n-k]));
}*/

/*struct DSU
{
    vector<int> sz;
    vector<int> parent;
    vector<int> value;
    void make_set(int v) {
        parent[v] = v;
        sz[v] = 1;
        value[v] = 0;
    }

    int find_set(int v) {
        if (v == parent[v])
            return v;
        else
        {
            auto par = find_set(parent[v]);
            value[v]^=value[parent[v]];
            parent[v] = par;
            return par;
        }
    }

    void union_sets(int a, int b, int w) {
        find_set(a);
        find_set(b);

        w^=value[a]; w^=value[b];
        a = find_set(a);
        b = find_set(b);

        if (a != b) {
            if (sz[a] < sz[b])
                swap(a, b);
            parent[b] = a;
            value[b] = w;
            sz[a] += sz[b];
        }
    }

    int val(int v)
    {
        find_set(v); return value[v];
    }

    DSU (int n)
    {
        parent.resize(n);
        sz.resize(n);
        value.resize(n);
        for (int i = 0; i<n; i++) make_set(i);
    }
};*/

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

    int k; cin>>k;
    int ans = 0;
    for (int a = 1; a<=k; a++)
        for (int b = 1; a*b<=k; b++)
            for (int c = 1; a*b*c<=k; c++) ans++;

    cout<<ans;

}


#include <bits/stdc++.h>
using namespace std;
const uint64_t seed = std::chrono::system_clock::now().time_since_epoch().count();
mt19937_64 rnd(seed);
const int MOD = 998244353;

#ifdef VIPJML_LOCAL
template <typename T>
ostream &operator<<(ostream &os, const vector<T> &v)
{
    os << "{";
    for (typename vector<T>::const_iterator vi = v.begin(); vi != v.end(); ++vi)
    {
        if (vi != v.begin())
            os << ", ";
        os << *vi;
    }
    os << "}";
    return os;
}
template <typename A, typename B>
ostream &operator<<(ostream &os, const vector<pair<A, B>> &v)
{
    os << "{";
    for (typename vector<pair<A, B>>::const_iterator vi = v.begin(); vi != v.end(); ++vi)
    {
        if (vi != v.begin())
            os << ", ";
        os << '(' << vi->first << " " << vi->second << ")";
    }
    os << "}";
    return os;
}

template <typename A, typename B>
ostream &operator<<(ostream &os, const pair<A, B> &p)
{
    os << '(' << p.first << ", " << p.second << ')';
    return os;
}

void dbg_out() { cerr << endl; }
template <typename Head, typename... Tail>
void dbg_out(Head H, Tail... T)
{
    cerr << ' ' << H;
    dbg_out(T...);
}
#define dbg(...) cerr << "(" << #__VA_ARGS__ << "):", dbg_out(__VA_ARGS__)
#else
#define dbg(...)
#endif
using LL = long long;

void solve(int caseNum)
{
    int N;
    cin >> N;
    vector<int> P(N);
    vector<int> idx(N);
    for (int i = 0; i < N; i++)
    {
        cin >> P[i];
        P[i]--;
        idx[P[i]] = i;
    }
    vector<int> res;
    bool f = true;
    int cur = 0;
    while (cur + 1 < N && f)
    {
        if (idx[cur] == cur)
        {
            f = false;
            break;
        }
        else
        {
            int ncur = idx[cur];
            for (int j = ncur - 1; j >= cur; j--)
            {
                swap(idx[P[j]], idx[P[j + 1]]);
                swap(P[j], P[j + 1]);
                res.push_back(j);
            }
            for (int j = cur; j < ncur; j++)
            {
                if (j != P[j])
                {
                    f = false;
                    break;
                }
            }
            cur = ncur;
        }
    }
    if (f)
    {
        for (int i = 0; i < N - 1; i++)
            cout << res[i] + 1 << "\n";
    }
    else
        cout << -1 << endl;
}

int main()
{
    std::ios::sync_with_stdio(false);
    cin.tie(NULL);
    cout.precision(10);
    int T = 1;
    // cin >> T;
    for (int i = 1; i <= T; i++)
    {
        solve(i);
    }
    cout.flush();
    return 0;
}

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

template<typename T> struct BIT {
    int mxn;
    vector<T> data;
    const bool zi;
    const T un;
    BIT<T>(int max_n, bool zero_indexed = false, T unit = T(0)) : mxn(max_n), zi(zero_indexed), un(unit) {
        if ( zi ) mxn++;
        data.assign(mxn + 1, unit);
    }
    void add(int i, T x) {
        if ( zi ) i++;
        assert( i > 0 );
        while ( i <= mxn ) {
            data[i] += x;
            i += i & -i;
        }
    }
    T sum(int i) {
        if ( zi ) i++;
        assert( i > 0 );
        T s = un;
        while ( i > 0 ) {
            s += data[i];
            i -= i & -i;
        }
        return s;
    }
    vector<T> get_sum_list(int l, int r) {
        vector<T> a;
        for ( int i = l; i <= r; i++ ) {
            a.push_back(sum(i));
        }
        return a;
    }
};

ll inversion(vector<ll>& v, ll v_max = -1) {
    if ( v_max < 0 ) {
        v_max = *max_element(v.begin(), v.end());
    }
    int nv = v.size();
    BIT<ll> b(v_max, true);
    ll ans = 0;
    for ( int i = 0; i < nv; i++ ) {
        ans += (ll)(i - b.sum(v[i]));
        b.add(v[i], 1);
    }
    return ans;
}

ll solve() {
    ll N;
    cin >> N;
    vector<ll> P(N);
    for ( int i = 0; i < N; i++ ) cin >> P[i];
    ll v = inversion(P, N);
    if ( v != N-1 ) return -1;
    queue<int> q;
    for ( int i = 0; i < N-1; i++ ) {
        if ( P[i] > P[i+1] ) q.push(i);
    }
    vector<int> ans;
    while ( !q.empty() ) {
        int i = q.front();
        q.pop();
        if ( P[i] > P[i+1] ) {
            ans.push_back(i);
            swap(P[i],P[i+1]);
        }
        if ( i > 0 ) {
            if ( P[i-1] > P[i] ) q.push(i-1);
        }
        if ( i+2 < N ) {
            if ( P[i+1] > P[i+2] ) q.push(i+1);
        }
    }
    for ( int i = 0; i < ans.size(); i++ ) {
        cout << ans[i]+1 << "\n";
    }
    return 0;
}

int main() {
    auto ans = solve();
    if ( ans < 0 ) {
        cout << ans << "\n";
    }
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
#define M_PI  3.1415926535
#define ll long long
#define ld long double
#define all(a) a.begin(),a.end()
#define Summon_Tourist ios::sync_with_stdio(false);cin.tie(0);
ll gcd(ll a , ll b) { return b==0?a: gcd( b, a%b); }
ll lcm(ll a , ll b) { return a/gcd(a,b) * b ; }
ll inf = 998244353;
ll modexp( ll base ,ll power)
 {
     if( power == 0  ) return 1;
     if( power & 1) return base*modexp( base , power-1 )%inf;
     return modexp(base*base%inf,power/2);
 }

 int main()
{
  Summon_Tourist
  //freopen("input.txt" , "r" , stdin ) ;
  ll t = 1;
  //cin>>t;
  while(t--)
  {
      ll n,k; cin>>n>>k;
      vector<ll> a(2*n+1,0);
      for( ll i = 2 ; i<=2*n ; i++ ){
        if( i<=n ) a[i] = i - 1 ;
        else{
            a[i] = ( i-1 ) - 2*(i - n - 1) ;
        }
      }
      if ( k<0 ) k *= -1 ;

      ll ans = 0 ;
      for( ll i = k+2 ; i<=2*n ; i++ ){

        ans += ( a[i] * a[i-k] ) ;

      }
      cout<<ans;

  }
  return 0;

}

#include <iostream>
#include <cstdio>
using namespace std;
const int N=5010,mod=998244353;
int fp[N][N],res[N];
int main()
{
	int n,m,ans=0;
	scanf("%d%d",&n,&m);
	for(int i=0;i<=m;i++)
	{
		fp[i][0]=1;
		for(int j=1;j<=n;j++)
		  fp[i][j]=1ll*fp[i][j-1]*i%mod;
	}
	for(int d=1;d<=n-1;d++)
	{
		for(int x=1;x<=m;x++)
			res[d]=(res[d]+fp[m-x][d-1])%mod;
		res[d]=1ll*res[d]*fp[m][n-d-1]%mod;
	}
	ans=1ll*n*fp[m][n]%mod;
	for(int i=1;i<=n;i++)
		for(int j=1;j<i;j++)
			ans=(ans-res[i-j])%mod;
	printf("%d\n",(ans+mod)%mod);
	return 0;
}


#include<bits/stdc++.h>
using namespace std;
int main()
{
    long long int n,sum=0;cin>>n;int a[n],b[n];
    for(int i=0;i<n;i++)
    {
        cin>>a[i];
        //sum+=a[i]+b[i];
    }
    for(int i=0;i<n;i++)
    {
        cin>>b[i];
    }
    for(int i=0;i<n;i++)
    {
        long long m=0;
        m=a[i]*b[i];
        sum+=m;
    }
    if(sum==0)
    {
        cout<<"Yes"<<endl;
    }
    else
        cout<<"No"<<endl;
}

#include <bits/stdc++.h>
using namespace std;
#define repd(i,a,b) for (ll i=(a);i<(b);i++)
#define rep(i,n) repd(i,0,n)
#define all(x) (x).begin(),(x).end()
#define SIZE(x) ll(x.size())
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; }
typedef long long ll;
const long long INF = 1LL << 60;
const long long MOD = 1000000007;
typedef pair<int, int> P;
int main()
{
    int T;
    cin >> T;
    string cp = "atcoder";
    while (T--) {
        string S;
        cin >> S;
        if (S > cp) {
            cout << 0 << endl;
            continue;
        }
        ll ans = INF;
        repd(i, 1, S.size()) {
            if (S[i] > 'a') {
                chmin(ans, i);
                break;
            }
        }
        repd(i, 2, S.size()) {
            if (S[i] > 't') {
                chmin(ans, i - 1);
                break;
            }
        }

        if (ans == INF) ans = -1;
        cout << ans << endl;
    }
    return 0;
}


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

typedef long long ll;
typedef pair<int,int> P;

#define p_ary(ary,a,b) do { cout << "["; for (int count = (a);count < (b);++count) cout << ary[count] << ((b)-1 == count ? "" : ", "); cout << "]\n"; } while(0)
#define p_map(map,it) do {cout << "{";for (auto (it) = map.begin();;++(it)) {if ((it) == map.end()) {cout << "}\n";break;}else cout << "" << (it)->first << "=>" << (it)->second << ", ";}}while(0)

template<typename T1,typename T2>ostream& operator<<(ostream& os,const pair<T1,T2>& a) {os << "(" << a.first << ", " << a.second << ")";return os;}

const char newl = '\n';

int main() {
    int q;
    cin >> q;
    while (q-- ) {
        int n;
        cin >> n;
        vector<int> a(n);
        for (int i = 0;i < n;++i) cin >> a[i];
        bool fi = false;
        if (n%2 == 0) {
            sort(a.begin(),a.end());
            for (int i = 0;i < n/2;++i) if (a[i*2] != a[i*2+1]) {
                fi = true;
                break;
            }
        }
        cout << (fi ? "First" : "Second") << newl;
    }
}

// 解き直し.
// https://atcoder.jp/contests/arc105/editorial/171
// C++(GCC 9.2.1)
#include <bits/stdc++.h>
using namespace std;
using LL = long long;
#define repex(i, a, b, c) for(int i = a; i < b; i += c)
#define repx(i, a, b) repex(i, a, b, 1)
#define rep(i, n) repx(i, 0, n)
#define repr(i, a, b) for(int i = a; i >= b; i--)
#define a first
#define b second

int main(){

    // 1. 入力情報.
    int T;
    scanf("%d", &T);

    // 2. 各テストケースを確認.
    rep(i, T){
        // 2-1. テストパターン.
        int N;
        scanf("%d", &N);
        LL a;
        map<LL, int> m;
        rep(j, N){
            scanf("%lld", &a);
            m[a]++;
        }

        // 2-2. N が 奇数.
        if(N & 1) puts("Second");

        // 2-3. N が 偶数.
        if(!(N & 1)){
            // 任意の整数 n について n 個のコインが入った袋の偶奇をチェック.
            LL e = 0;
            for(auto &p : m) if(!(p.b & 1)) e++;

            // 任意の整数 n について n 個のコインが入った袋が偶数個ある場合(後手必勝).
            if(m.size() == e) puts("Second");

            // それ以外.
            if(m.size() != e) puts("First");
        }
    }
    return 0;

}


#include<bits/stdc++.h>
#include "cmath"
#define ll long long int
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define inf (1<<30)
#define linf 1e18
#define ninf -1e9
#define fore(i, r) for(int i = 1; i <= int(r); i++)
#define loop(i,r) for(int i = 0; i < int(r) ; i++)
#define loop1(i,r) for(int i=1;i<=r;i++)
#define looplr(i,l,r) for(int i=l;i<=r;i++)
#define rloop(i,r) for(int i=r-1;i>=0;i--)
#define min3(x1, x2, x3) (x3 > min(x1, x2) ? min(x2, x1) : x3)
#define max3(x1, x2, x3) (x3 < max(x1, x2) ? max(x1, x2) : x3)
#define sz(a) int((a).size())
#define vi vector< int >
#define vl vector<long long int>
#define vpi vector<pair<int, int> >
#define vpl vector<pair<long long int, long long int> >
#define pb push_back
#define umi unordered_map<int , int>
#define umc unordered_map<char , int>
#define uml unordered_map<long long int , long long int>
#define mpi map<int, int>
#define sti set<int>
#define stl set<long long int>
#define ff first
#define ss second
#define len(x) (int)x.length()
#define ctn continue
#define brk break
#define ub(i,x) upper_bound(i.begin(), i.end(),x)
#define lb(i,x) lower_bound(i.begin(), i.end(),x)
#define ump unordered_map
#define str string
#define memn1(x) memset(x,-1,sizeof(x))
#define mem1(x) memset(x,1,sizeof(x))
#define mem0(x) memset(x,0,sizeof(x))
#define rtn return
#define srt(x) sort(all(x))
#define srtgi(x) sort(all(x), greater<int>())
#define srtgl(x) sort(all(x), greater<ll>())
#define rsz resize
#define ins insert
#define ft front()
#define bk back()
#define nline cout<< "\n"
#define chngl "\n"
#define takei(input) scanf("%d",&input)
#define takel(input) scanf("%lld",&input)
#define pll pair<long long int, long long int>
#define putyes printf("Yes\n")
#define putno printf("No\n")
#define sid int
const int  mod = 1e9 + 7;

using namespace std;

const int N = 1e6 + 5;
int prime[N];

void calPrime() {
	for (int i = 1; i <= 1000000; i++) prime[i] = 1;
	for (int i = 2; i * i <= 1e6 + 1; i++) {
		if (prime[i] == -1) ctn;
		prime[i] = 1;
		for (int j = 2 * i; j <= 1e6 + 1; j +=  i) {
			prime[j] = -1;
		}
	}

}

int pow2(int expo) {
	int val = 1;
	int pp = 1;
	while (pp <= expo) {
		val = ((val % 1000003 ) * 2) % 1000003 ;
		pp++;
	}
	return val % 1000003;
}

int main()
{
	ios_base::sync_with_stdio(0);
	cin.tie(0); cout.tie(0);
	//calPrime();
	int tme = 1;
	//cin >> tme;
	while (tme--) {
		int n; cin >> n;
		vi a(n);
		loop(i, n) cin >> a[i];
		int ans = inf;
		//cout << inf << endl;
		loop(mask, 1 << (n - 1)) {
			int xored = 0;
			int ored = 0;
			loop(i, n ) {
				ored |= a[i];
				if (i == n - 1  || mask & (1 << i)) {
					xored ^= ored;
					ored = 0;
				}
			}
			ans = min(ans, xored);
		}
		cout << ans;
	}
	return 0;
}

#include <bits/stdc++.h>
using namespace std;
const int mod=1e9+7;

int fpow(int a,int b){
	int ans=1;
	while(b){
		if(b&1) ans=1ll*ans*a%mod;
		a=1ll*a*a%mod;
		b>>=1;
	}
	return ans;
}
int main()
{
	int n,m;
	scanf("%d%d",&n,&m);
	int a=0,b=n,c=m+n;
	for(int i=1;i<=n;i++){
		scanf("%d",&a);
		b=(b+a);
	}
	int ans=1;
	for(int i=1;i<=b;i++){
		ans=1ll*ans*(c-i+1)%mod;
		ans=1ll*ans*fpow(i,mod-2)%mod;
	}
	printf("%d",ans);
 }


#include "bits/stdc++.h"
#include <random>
#include <chrono>
#pragma GCC target("avx2")
#pragma GCC optimize("O3")
#pragma GCC optimize("unroll-loops")
#define ALL(x) (x).begin(), (x).end()
#define RALL(x) (x).rbegin(), (x).rend()
#define SZ(x) ((lint)(x).size())
#define FOR(i, begin, end) for(lint i=(begin),i##_end_=(end);i<i##_end_;++i)
#define IFOR(i, begin, end) for(lint i=(end)-1,i##_begin_=(begin);i>=i##_begin_;--i)
#define REP(i, n) FOR(i,0,n)
#define IREP(i, n) IFOR(i,0,n)
#define endk '\n'
using namespace std; typedef unsigned long long _ulong; typedef long long int lint; typedef long double ld; typedef pair<lint, lint> plint; typedef pair<ld, ld> pld;
struct fast_ios { fast_ios() { cin.tie(nullptr), ios::sync_with_stdio(false), cout << fixed << setprecision(20); }; } fast_ios_;
template<class T> auto add = [](T a, T b) -> T { return a + b; };
template<class T> auto f_max = [](T a, T b) -> T { return max(a, b); };
template<class T> auto f_min = [](T a, T b) -> T { return min(a, b); };
template<class T> using V = vector<T>;
using Vl = V<lint>; using VVl = V<Vl>;
template< typename T > ostream& operator<<(ostream& os, const vector< T >& v) {
	for (int i = 0; i < (int)v.size(); i++) os << v[i] << (i + 1 != v.size() ? " " : "");
	return os;
}
template< typename T >istream& operator>>(istream& is, vector< T >& v) {
	for (T& in : v) is >> in;
	return is;
}
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; }
template <class T>
T div_floor(T a, T b) {
	if (b < 0) a *= -1, b *= -1;
	return a >= 0 ? a / b : (a + 1) / b - 1;
}
template <class T>
T div_ceil(T a, T b) {
	if (b < 0) a *= -1, b *= -1;
	return a > 0 ? (a - 1) / b + 1 : a / b;
}
template <class F> struct rec {
	F f;
	rec(F&& f_) : f(std::forward<F>(f_)) {}
	template <class... Args> auto operator()(Args &&... args) const {
		return f(*this, std::forward<Args>(args)...);
	}
};
lint gcd(lint a, lint b) { if (b == 0) return a; else return gcd(b, a % b); }
lint digit(lint a) { return (lint)log10(a); }
lint e_dist(plint a, plint b) { return abs(a.first - b.first) * abs(a.first - b.first) + abs(a.second - b.second) * abs(a.second - b.second); }
lint m_dist(plint a, plint b) { return abs(a.first - b.first) + abs(a.second - b.second); }
bool check_overflow(lint a, lint b, lint limit) { if (b == 0) return false; return a > limit / b; } // a * b > c => true
void Worshall_Floyd(VVl& g) { REP(k, SZ(g)) REP(i, SZ(g)) REP(j, SZ(g)) chmin(g[i][j], g[i][k] + g[k][j]); }
const lint MOD1000000007 = 1000000007, MOD998244353 = 998244353, INF = 1e18;
lint dx[8] = { 0, -1, 0, 1, 1, -1, 1, -1 }, dy[8] = { -1, 0, 1, 0, -1, -1, 1, 1 };
bool YN(bool flag) { cout << (flag ? "YES" : "NO") << endk; return flag; } bool yn(bool flag) { cout << (flag ? "Yes" : "No") << endk; return flag; }
struct Edge {
	lint from, to;
	lint cost, color;
	Edge() {

	}
	Edge(lint u, lint v, lint c, lint col) {
		cost = c;
		color = col;
		from = u;
		to = v;
	}
	bool operator<(const Edge& e) const {
		return cost < e.cost;
	}
};
struct WeightedEdge {
	lint to;
	lint cost, color;
	WeightedEdge(lint v, lint c, lint _color) {
		to = v;
		cost = c;
		color = _color;
	}
	bool operator<(const WeightedEdge& e) const {
		return cost < e.cost;
	}
};
using WeightedGraph = V<V<WeightedEdge>>;
typedef pair<plint, lint> tlint;
typedef pair<plint, plint> qlint;
typedef pair<lint, string> valstr;
typedef pair<ld, plint> _pld;
typedef pair<ld, lint> pidx;

lint N;
int main() {
	cin >> N;
	V<valstr> arr(N);
	REP(i, N) {
		lint T;
		string S;
		cin >> S >> T;
		arr[i] = { T, S };
	}
	sort(RALL(arr));
	cout << arr[1].second << endk;
}

#include <bits/stdc++.h>
using namespace std;
#define F first
#define S second
#define R cin>>
#define ll long long
#define ln cout<<endl
#define in(a) insert(a)
#define pb(a) push_back(a)
#define pd(a) printf("%.10f\n",a)
#define mem(a) memset(a,0,sizeof(a))
#define all(c) (c).begin(),(c).end()
#define iter(c) __typeof((c).begin())
#define rrep(i,n) for(ll i=(ll)(n)-1;i>=0;i--)
#define REP(i,m,n) for(ll i=(ll)(m);i<(ll)(n);i++)
#define rep(i,n) REP(i,0,n)
#define tr(it,c) for(iter(c) it=(c).begin();it!=(c).end();it++)
ll check(ll n,ll m,ll x,ll y){return x>=0&&x<n&&y>=0&&y<m;}void pr(){ln;}
template<class A,class...B>void pr(const A &a,const B&...b){cout<<a<<(sizeof...(b)?" ":"");pr(b...);}
template<class A>void PR(A a,ll n){rep(i,n)cout<<(i?" ":"")<<a[i];ln;}
const ll MAX=1e9+7,MAXL=1LL<<61,dx[8]={-1,0,1,0,-1,-1,1,1},dy[8]={0,1,0,-1,-1,1,1,-1};
typedef pair<ll,ll> P;

vector<string> rotate(vector<string> s) {
  int n=s.size(),m=s[0].size();
  vector<string> t(m);
  rep(i,m)rrep(j,n) t[i]+=s[j][i];
  return t;
}

ll n,m;
string s[1000];

ll calc(vector<string> t) {
  ll cnt=0;
  rep(k,m) {
    ll f=0;
    rep(l,2) {
      rep(i,n) {
        rep(j,n) {
          if(t[i].substr(0,s[k].size())==s[k]) f=1;
          rotate(t[i].begin(),t[i].begin()+1,t[i].end());
        }
      }
      t=rotate(t);
    }
    cnt+=f;
  }
  return cnt;
}

vector<string> ans;
ll MM;

void solve(vector<string> t) {
  ll d=calc(t);
  if(MM<d) {
    MM=d;
    ans=t;
  }
  rep(k,5) {
    random_shuffle(all(t));
    rep(i,n) rotate(t[i].begin(),t[i].begin()+rand()%n,t[i].end());
    ll d=calc(t);
    if(MM<d) {
      MM=d;
      ans=t;
    }
  }
}

void Main() {
  srand((unsigned)time(NULL));
  cin >> n >> m;
  rep(i,m) R s[i];
  vector<string> v[15];
  rep(i,m) v[s[i].size()].pb(s[i]);
  rep(e,30) {
    vector<string> t(n);
    rrep(i,15) {
      random_shuffle(all(v[i]));
      rep(j,v[i].size()) {
        ll M=MAX,x=0;
        string rr;
        rep(k,n) {
          rep(l,t[k].size()+1) {
            string r1=t[k].substr(l);
            if(r1.size()<=v[i][j].size()) {
              string r2=v[i][j].substr(0,r1.size());
              if(r1==r2) {
                ll d=t[k].size()+v[i][j].size()-r1.size();
                if(d<=n&&M>d) {
                  M=d;
                  x=k;
                  rr=t[k]+v[i][j].substr(r1.size());
                }
              }
            }
          }
        }
        if(rand()%6==0) M=MAX;
        if(M!=MAX) t[x]=rr;
      }
    }
    rep(i,n) {
      while(t[i].size()<n) {
        //t[i]+='.';
        t[i]+=(char)(rand()%8+'A');
      }
    }
    solve(t);
  }
  rep(i,n) pr(ans[i]);
}

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


#include <iostream>
#include <string>
#include <vector>
#include <list>
#include <map>
#include <set>
#include <stack>
#include <queue>
#include <algorithm>
#include <iomanip>

using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair<ll, ll> P;

const ll linf = 2e18 + 100;
const int inf = 1e9 + 100;
const ll mod = 1e9 + 7;

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

int main() {

	ll a, b, c, d;
	cin >> a >> b >> c >> d;

	cout << b - c << endl;

	return 0;
}

             /****************#####       بِسْمِ اللَّهِ الرَّحْمَنِ الرَّحِيم       #####********************/

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

#define         endl                "\n"
#define         EPS                 1e-6
#define         F                   first
#define         sf                  scanf
#define         pf                  printf
#define         S                   second
#define         MP                  make_pair
#define         pb                  push_back
#define         PI                  acos(-1.0)
#define         NO                  cout<<"NO\n"
#define         No                  cout<<"No\n"
#define         no                  cout<<"no\n"
#define         YES                 cout<<"YES\n"
#define         Yes                 cout<<"Yes\n"
#define         yes                 cout<<"yes\n"
#define         sz(x)               int(x.size())
#define         all(a)              a.begin(),a.end()
#define         srt(x)              sort(x.begin(),x.end())
#define         clock_start         clock_t tStart = clock()
#define         MEM(a, b)           memset(a, (b), sizeof(a))
#define         dbg(x)              cout << (#x) << " = " << (x) << endl
#define         Fast                ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0)
#define         dbg2(x, y)          cout << #x << " = " << x << " " << #y << " = " << y << endl
#define         dbg3(x, y, z)       cout << #x << " = " << x << " " << #y << " = " << y << " " << #z << " = " << z << endl
#define         show_time           cout<<"\n\nTime Taken: "<<fixed<<setprecision(3)<<(double)(clock() - tStart) /  CLOCKS_PER_SEC<<"s"

                     /******------- Some bit operations ------*****/

long long     SetBit    (long long n, long long X)    { return n | (1LL << X); }//X-1 tomo bit 0 hole 1 korbe, 1 hole unchange
long long     ClearBit  (long long n, long long X)    { return n & ~(1LL << X); }//X-1 tomo bit 1 hole 0 korbe, 0 hole unchange
long long     ToggleBit (long long n, long long X)    { return n ^ (1LL << X); }//X-1 tomo bit 1 hole 0 korbe r 0 hole 1
bool          CheckBit  (long long n, long long X)    { return (bool)(n & (1LL << X)); }//X-1 tomo bit 1 naki 0 bolbe

                    /*******-----------Graph Moves------------*****/

const   int     dx[] = {1, -1, 0, 0};
const   int     dy[] = {0, 0, 1, -1};

const   int     kx[] = {-2, -2, -1, -1, 1, 1, 2, 2};      // Knights Move
const   int     ky[] = {-1, 1, -2, 2, -2, 2, -1, 1};     // Knights Move

const   int     Kx[] = {0, 0, 1, -1, -1, 1, -1, 1};     // Kings Move
const   int     Ky[] = {-1, 1, 0, 0, 1, 1, -1, -1};    // Kings Move

                   /*--------------------------------------------*/

            ///////////////////////////////////////////////////////////////////////////
        ///////////////////////// DO NOT TOUCH BEFORE THIS LINE //////////////////////////
            //////////////////////////////////////////////////////////////////////////

typedef     long long   ll;
typedef     pair<int,int>pi;
typedef     pair<ll,ll>pll;
const       int MAX  = 1e5 + 5;
const       int MOD  = 1e9 + 7;
const       int INF  = 1e9;
const       ll LINF  = 1e18;

void Test_Case();
void File();

void solve()
{
    int a,b,c,d,x,y;
    cin>>a>>b>>c>>d;
    x=max(a,b);
    y=min(c,d);
    cout<<x-y<<endl;

}

int main()
{
    Fast;

    File();
    //Test_Case();
    solve();

    return 0;
}

void Test_Case()
{
    int tc;
    cin>>tc;
    for(int R=1;R<=tc;R++)
    {
        //cout << "Case " << R << ": ";
        solve();
    }
}
void File()
{
    #ifndef ONLINE_JUDGE
        freopen("input.txt", "r", stdin);
        freopen("output.txt", "w", stdout);
    #endif
}


#include <bits/stdc++.h>
template<class T> inline bool chmin(T&a, T b){if(a > b){a = b; return true;}else{return false;}}
template<class T> inline bool chmax(T&a, T b){if(a < b){a = b; return true;}else{return false;}}
#define ll long long
#define double long double
#define rep(i,n) for(int i=0;i<(n);i++)
#define REP(i,n) for(int i=1;i<=(n);i++)
#define mod (ll)(1e9+7)
#define inf (ll)(3e18+7)
#define eps (double)(1e-9)
#define pi (double) acos(-1)
#define P pair<int,int>
#define PiP pair<int,pair<int,int>>
#define all(x) x.begin(),x.end()
#define rall(x) x.rbegin(),x.rend()
using namespace std;

int n;
vector<vector<int>> G(100010);

//ret = First - Second
//rに動かした人がplayer == 0, player == 1なら交代

P solve(int r){
    int ret = 1;
    int player = 1, cnt = 0;
    priority_queue<int> que;
    for(auto v : G[r]){
        P now = solve(v);
        if(!now.second && now.first < 0)ret += now.first;
        if(!now.second && now.first > 0)cnt += now.first;
        if(now.second)que.push(-now.first);
    }
    while(!que.empty()){
        int t = -que.top();
        que.pop();
        if(player)ret += t;
        else ret -= t;
        player ^= 1;
    }
    if(player)ret += cnt;
    else ret -= cnt;
    return {ret, player};
}

int main() {
    cin >> n;
    rep(i, n-1){
        int p;
        cin >> p;
        G[p-1].push_back(i+1);
    }
    cout << (n+solve(0).first)/2 << endl;
}

#include<bits/stdc++.h>
using namespace std;
#define ll long long
int sum=0,n;
int dp[101][100001],a[101];
int f(int i, int t){
    if(i==n) return max(t,sum-t);
    if(dp[i][t]!=-1) return dp[i][t];
    int ret=f(i+1,t);
    ret=min(ret,f(i+1,t+a[i]));
    dp[i][t]=ret;
    return ret;
}
int main(){
    ios_base::sync_with_stdio(false);
    memset(dp,-1,sizeof(dp));
    cin>>n;
    for(int i=0;i<n;i++){
        cin>>a[i];
        sum+=a[i];
    }
    cout<<f(0,0)<<"\n";
    return 0;
}


#include <algorithm>
#include <array>
#include <cassert>
#include <chrono>
#include <cmath>
#include <cstring>
#include <functional>
#include <iomanip>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <random>
#include <set>
#include <vector>
#include <stack>

using namespace std;

#define enviar {ios_base::sync_with_stdio(false);}
#define aiuda {cin.tie(NULL); cout.tie(NULL);}

#define F_OR(i, a, b, s) for (int i=(a); (s)>0?i<(b):i>(b); i+=(s))
#define F_OR1(e) F_OR(i, 0, e, 1)
#define F_OR2(i, e) F_OR(i, 0, e, 1)
#define F_OR3(i, b, e) F_OR(i, b, e, 1)
#define F_OR4(i, b, e, s) F_OR(i, b, e, s)
#define GET5(a, b, c, d, e, ...) e
#define F_ORC(...) GET5(__VA_ARGS__, F_OR4, F_OR3, F_OR2, F_OR1)
#define FOR(...) ;F_ORC(__VA_ARGS__)(__VA_ARGS__)
#define EACH(x, a) for (auto& x: a)
#define exacto(v) cout << setprecision(v) << fixed;

#define ll long long
#define lld long double
#define eb emplace_back
#define em emplace
#define ef emplace_front
#define f first
#define s second
#define big greater<ll>()
#define bpc(x) __builtin_popcount(x)
#define bpc2(x) __builtin_clz(x)
#define bpc3(x) __builtin_ctz(x)
#define DIE(args...) {print(args); return;}
#define lb lower_bound
#define ub upper_bound

#define ar(v)  array<int,v>
#define all(v) v.begin(), v.end()
#define sz(x) (int)(x).size()
#define meminf(v) memset(v,  0x3f , sizeof(v))
#define mem(v,x) memset(v , x , sizeof v);
#define ai(a, n) for (int ele = 0; ele < n; ele++) cin >> a[ele];
#define ao(a, n) {for (int ele = 0; ele < (n); ele++) { if (ele) cout << " "; cout << a[ele]; } cout << '\n';}
#define readgraph(list, edges) for (int i = 0; i < edges; i++) {int n1, n2; cin >> n1 >> n2; n1--; n2--; list[n1].eb(n2); list[n2].eb(n1);}

template <typename T> struct combinator  {   T t_; combinator(T&& t) : t_(std::forward<T>(t)) {} template <typename... Args> auto operator () (Args&&... args) const  { return t_(*this, std::forward<Args>(args)...); } };
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; }
string to_string(bool b) {return b?"true":"false"; }
string to_string(char c) { return string(1, c);}
string to_string(const char* s) { return string(s); }
string to_string(string s) { return s; }
template<class T> string to_string(T v) { bool f=1; string res; EACH(x, v) { if(!f) res+=' '; f=0; res+=to_string(x); } return res; }
template<class A> void write(A x) { cout << to_string(x); }
void print() { write("\n"); }
template<class H, class... T> void print(const H& h, const T&... t) {  write(h); if(sizeof...(t)) write(' '); print(t...); }

typedef vector<int> vi;
typedef vector<ll> vll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef vector<pair<ll, ll>> vpll;
typedef map<ll, ll> mll;
typedef priority_queue<int, std::vector<int>, std::greater<int>> priomin;

const ll mod =   998244353;
//const ll mod =   1e9 + 7;
const ll maxsize =3e5  + 5;
const ll inf = 0x3f3f3f3f3f3f3f3f ;
// size, caracter

ll a[maxsize];
//vll adj[maxsize];
//ll l[maxsize];
ll l[maxsize][2];

ll dp[maxsize][2];

void solve()
{
	ll n;
	cin >> n;
	ai(a, n);

	FOR(i , n)
	{
		if (i%2) a[i]*=-1;
	}

	partial_sum(a , a+ n , a);

	mll cnt;
	ll ans = 0;
	cnt[0]++;
	FOR(i , n)
	{
		ans += cnt[a[i]]++;
	}

	print(ans);

}

int main(){

	enviar aiuda

	int tc = 1;
	//cin >> tc;

	while(tc--)  solve();

	return 0;
}

//Utkarsh.25dec
#include <bits/stdc++.h>
#include <chrono>
#include <random>
#define ll long long int
#define ull unsigned long long int
#define pb push_back
#define mp make_pair
#define mod 1000000007
#define rep(i,n) for(ll i=0;i<n;i++)
#define loop(i,a,b) for(ll i=a;i<=b;i++)
#define vi vector <int>
#define vs vector <string>
#define vc vector <char>
#define vl vector <ll>
#define all(c) (c).begin(),(c).end()
#define max3(a,b,c) max(max(a,b),c)
#define min3(a,b,c) min(min(a,b),c)
#define deb(x) cerr<<#x<<' '<<'='<<' '<<x<<'\n'
using namespace std;
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
#define ordered_set tree<int, null_type,less<int>, rb_tree_tag,tree_order_statistics_node_update>
// ordered_set s ; s.order_of_key(val)  no. of elements strictly less than val
// s.find_by_order(i)  itertor to ith element (0 indexed)
typedef vector<vector<ll>> matrix;
ll power(ll a,ll b) {ll res=1;a%=mod; assert(b>=0); for(;b;b>>=1){if(b&1)res=res*a%mod;a=a*a%mod;}return res;}
ll modInverse(ll a){return power(a,mod-2);}
const int N=5005;
bool vis[N];
string ans[N];
vector <string> recurse(int n)
{
    int x=(1<<(n-1))-1;
    int y=x+1;
    int rounds=(1<<n)-1;
    vs ans;
    if(n==1)
    {
        ans.pb("AB");
        return ans;
    }
    vs fun=recurse(n-1);
    for(auto s:fun)
    {
        string temp="";
        temp=s+s;
        ans.pb(temp);
        temp=s;
        for(auto ch:s)
        {
            if(ch=='A')
                temp+='B';
            else
                temp+='A';
        }
        ans.pb(temp);
    }
    string temp="";
    temp+='A';
    for(int i=1;i<(1<<n);i++)
    {
        int cnt=0;
        for(auto s:ans)
        {
            if(s[i]=='A')
                cnt++;
        }
        if(cnt==x)
            temp+='B';
        else
            temp+='A';
    }
    ans.pb(temp);
    return ans;
}
void solve()
{
    ll n;
    cin>>n;
    cout<<((1<<n)-1)<<'\n';
    vs fun=recurse(n);
    for(auto it:fun)
        cout<<it<<'\n';
}
int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    int T=1;
    //cin>>T;
    int t=0;
    while(t++<T)
    {
        //cout<<"Case #"<<t<<":"<<' ';
        solve();
        //cout<<'\n';
    }
    cerr << "Time : " << 1000 * ((double)clock()) / (double)CLOCKS_PER_SEC << "ms\n";
}


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

#define ll long long
const int N = 2.1e5;

int n, m, tkn[N], ans[N];
vector<pair<int, int>> e[N];
queue<int> q;

void fn(int v) {
    tkn[v] = 1;
    for (auto [u, c] : e[v]) {
        if (!tkn[u]) q.push(u);
    }
}

int main() {
#ifdef LOCAL
    freopen("input.txt", "r", stdin);
#endif
    ios::sync_with_stdio(false);
    cin.tie(0);
    cin >> n >> m;
    for (int i = 0; i < m; i++) {
        int u, v, c;
        cin >> u >> v >> c;
        u--;
        v--;
        c--;
        e[u].push_back({v, c});
        e[v].push_back({u, c});
    }
    q.push(0);
    while (!q.empty()) {
        int v = q.front();
        q.pop();
        if (tkn[v]) continue;
        if (v == 0) ans[v] = 0; else {
            for (auto [u, c] : e[v]) {
                if (tkn[u]) {
                    ans[v] = c == ans[u] ? (c + 1) % n : c;
                    break;
                }
            }
        }
        fn(v);
    }
    for (int i = 0; i < n; i++) cout << ans[i] + 1 << '\n';
    return 0;
}

#include<bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define rrep(i, k, n) for (int i = k; i < (int)(n); i++)
#define repd(i, n) for (int i = n-1; i >= 0; i--)
#define rrepd(i, k, n) for (int i = n-1; i >= (int)(k); i--)
#define all(x) (x).begin(),(x).end()
#define chmax(x,y) x=max(x,y)
#define chmin(x,y) x=min(x,y)
#define F first //pairの一つ目の要素
#define S second //pairの二つ目の要素
#define PB push_back //挿入
#define MP make_pair //pairのコンストラクタ
//V,Pは大文字i,l,bは小文字
using ll = long long;
using Vi = vector<int>;
using VVi = vector<Vi>;
using Vl = vector<ll>;
using VVl = vector<Vl>;
using Vb = vector<bool>;
using VVb = vector<Vb>;
using P = pair<int,int>;
using Pl = pair<ll, ll>;
using Vs = vector<string>;
const ll mod = 1000000007;
const ll inf = 1000000000000;//10の12乗
#define yn {puts("Yes");}else{puts("No");}
#define dame { puts("-1"); return 0;}
int n,m;
vector<vector<P>> v(200005);
vector<bool> seen(200005);
vector<long long> ans(200005,0);
void dfs(int k){
    if(!seen[k]){
        seen[k]=true;
        for(auto next:v[k]){
            if(seen[next.F]) continue;
            if(ans[k]!=next.S&&ans[next.F]==0){
                ans[next.F]=next.S;

            }
            dfs(next.F);
        }
    }

}

int main() {
    cin >> n >> m;
    VVl ng(n);
    map<P,int> mp;
    rep(i,m){
        int x,y,z;
        cin >> x >> y >> z;
        x--;y--;
        if(mp[MP(x,y)]) continue;
        mp[MP(x,y)]++;
        v[x].push_back(MP(y,z));
        v[y].push_back(MP(x,z));
        ng[x].PB(z);
        ng[y].PB(z);
    }
    int now=0;
            rrep(j,1,n+1){
                if(ng[0][now]==j)now++;
                else{
                    ans[0]=j;
                    break;
                }
                if(j==n) ans[0]=n;
            }
    dfs(0);
    rep(i,n){
        sort(all(ng[i]));
        ng[i].PB(-1);
    }
    rep(i,n){
        if(ans[i]==0){
            now=0;
            rrep(j,1,n+1){
                if(ng[i][now]==j)now++;
                else{
                    ans[i]=j;
                    break;
                }
                if(j==n) ans[i]=n;
            }
        }
    }

    rep(i,n) cout << ans[i] << endl;

}


#include <algorithm>
#include <array>
#include <cmath>
#include <iostream>
#include <random>
#include <vector>
using namespace std;

constexpr int N = 30;  // width and height
constexpr int MED_DISTANCE = (1000 + 9000) / 2;
using P = pair<int, int>;
using VPATH = array<array<int, N>, N - 1>;
using HPATH = array<array<int, N - 1>, N>;

mt19937 rng{random_device{}()};

// 上下移動、左右移動の回数を渡すとそこに移動するUDLRパスを返す
// 1,2→DRR
// -2,3→UULLL
string getUDLRpath(int vmove, int hmove) {
    string path;
    path += string(abs(vmove), vmove > 0 ? 'D' : 'U');
    path += string(abs(hmove), hmove > 0 ? 'R' : 'L');
    return path;
}

class Solver {
   private:
    VPATH h{};
    HPATH w{};

    string prev_path;
    P prev_s, prev_t;

    int evaluate(const string &path, P s) {
        int length = 0;
        for (auto &&i : path) {
            switch (i) {
                case 'U':
                    length += h[s.first - 1][s.second];
                    s.first--;
                    break;

                case 'D':
                    length += h[s.first][s.second];
                    s.first++;
                    break;

                case 'L':
                    length += w[s.first][s.second - 1];
                    s.second--;
                    break;

                case 'R':
                    length += w[s.first][s.second + 1];
                    s.second++;
                    break;

                default:
                    break;
            }
        }
        return length;
    }

    void reflectResult(const string &path, P s, int prev_result) {
        if (path.size() == 0) return;
        const int inc = prev_result / path.size() - MED_DISTANCE;

        for (auto &&i : path) {
            switch (i) {
                case 'U':
                    h[s.first - 1][s.second] += inc;
                    s.first--;
                    break;

                case 'D':
                    h[s.first][s.second] += inc;
                    s.first++;
                    break;

                case 'L':
                    w[s.first][s.second - 1] += inc;
                    s.second--;
                    break;

                case 'R':
                    w[s.first][s.second] += inc;
                    s.second++;
                    break;

                default:
                    break;
            }
        }
    }

   public:
    string query(P s, P t, int prev_result) {
        if (prev_path.size() > 0) reflectResult(prev_path, prev_s, prev_result);

        const int vmove = t.first - s.first, hmove = t.second - s.second;

        const string init_path = getUDLRpath(vmove, hmove);

        vector<string> choices;
        string tmp_path = init_path;
        for (int i = 0; i < 2000; i++) {
            shuffle(tmp_path.begin(), tmp_path.end(), rng);
            choices.emplace_back(tmp_path);
        }

        string path = choices.front();
        for (auto &&c : choices) {
            if (evaluate(c, s) < evaluate(path, s)) {
                path = c;
            }
        }

        prev_s = s, prev_t = t;
        prev_path = path;

        return path;
    }
};

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

    int prev_result = 0;
    Solver sol;  // ソルバー

    // 各クエリを処理
    for (int k = 0; k < 1000; k++) {
        // s, t受け取り
        P s, t;
        cin >> s.first >> s.second >> t.first >> t.second;

        // パス計算 出力
        const string path = sol.query(s, t, prev_result);
        cout << path << endl;

        // 結果受け取り
        cin >> prev_result;
    }
}

#include <bits/stdc++.h>
using namespace std;
#define rep0(i,n) for(int (i) = 0; (i) < (n); ++(i))
#define pf(x) cout << (x) << endl
#define all(x) (x).begin(),(x).end()
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; }
const int dx[4]={1,0,-1,0};
const int dy[4]={0,1,0,-1};
const char mc[4]={'U','L','D','R'};
const int max_e = 9000;
const int inf = 1000000000;
int mh[29][29],mv[29][29];

int dijkstra(vector<vector<int> > &m, pair<int, int> s){
    priority_queue<pair<int,pair<int,int> >, vector<pair<int,pair<int,int> > >, greater<pair<int,pair<int,int> > > > next;
    next.push(make_pair(0,s));
    while (!next.empty()) {
        int x = next.top().second.first,y = next.top().second.second;
        int p = next.top().first;
        next.pop();
        if(x > 0){
            if(chmin(m[x - 1][y], p + mv[x - 1][y])){
                next.push(make_pair(p + mv[x - 1][y], make_pair(x - 1, y)));
            }
        }
        if(x < 29){
            if(chmin(m[x + 1][y], p + mv[x][y])){
                next.push(make_pair(p + mv[x][y], make_pair(x + 1, y)));
            }
        }
        if(y > 0){
            if(chmin(m[x][y - 1], p + mv[x][y - 1])){
                next.push(make_pair(p + mv[x][y - 1], make_pair(x, y - 1)));
            }
        }
        if(y < 29){
            if(chmin(m[x][y + 1], p + mv[x][y])){
                next.push(make_pair(p + mv[x][y], make_pair(x, y + 1)));
            }
        }
    }
    return 0;
}

string restore(vector<vector<int> > &m, int x, int y){
    string root = "";
    int s = 0;
    while (m[x][y] != 0) {
        ++s;
        int next_x = x,next_y = y,p = m[x][y];
        rep0(i, 4)if(chmin(p, m[min(max(0,x + dx[i]),29)][min(max(0,y + dy[i]),29)])){
            next_x = x + dx[i];
            next_y = y + dy[i];
            if(s != root.size())root.push_back(mc[i]);
            else root[s - 1] = mc[i];
        }
        x = next_x;
        y = next_y;
    }
    reverse(all(root));
    return root;
}

int update(string s, int p, int x, int y){
    rep0(i, s.size()){
        if(s[i] == 'U'){
            mv[x - 1][y] = (mv[x - 1][y] + p + 1) / 2;
            x--;
        }else if(s[i] == 'D'){
            mv[x][y] = (mv[x][y] + p + 1) / 2;
            x++;
        }else if(s[i] == 'R'){
            mh[x][y] = (mh[x][y] + p + 1) / 2;
            y++;
        }else{
            mh[x][y - 1] = (mh[x][y - 1] + p + 1) / 2;
            y--;
        }
    }
    return 0;
}

//modを確認すること
int main(){
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    rep0(i, 30)rep0(j, 30){
        mh[i][j] = max_e;
        mv[i][j] = max_e;
    }

    rep0(i, 1000){
        vector<vector<int> > m(30,vector<int>(30,inf));
        int sx,sy,gx,gy,p;
        string s = "";
        cin >> sx >> sy >> gx >> gy;
        m[sx][sy] = 0;

        dijkstra(m, make_pair(sx, sy));
        string ans = restore(m, gx, gy);

        pf(ans);

        cin >> p;
        update(ans, int((p + ans.size() - 1) / ans.size()), sx, sy);
    }
    return 0;
}


#ifdef MY_LOCAL
#define MY_NAMESPACE(ns) namespace ns {
#define MY_NAMESPACE_    }
#define MY_DEBUG(s)      s
#else
#define MY_NAMESPACE(ns)
#define MY_NAMESPACE_
#define MY_DEBUG(s)
#endif

#include <algorithm>
#include <bitset>
#include <cmath>
#include <deque>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <random>
#include <set>
#include <string>
#include <tuple>
#include <unordered_map>
#include <utility>
#include <vector>

using namespace std;

typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;

#define EPS (1e-7)

constexpr int IMIN = numeric_limits<int>::min();
constexpr int IMAX = numeric_limits<int>::max();
constexpr ll LLMIN = numeric_limits<ll>::min();
constexpr ll LLMAX = numeric_limits<ll>::max();

MY_NAMESPACE(testbed)
int count_query(vector<int>& dishes, int current_k, vector<int> const& a, vector<int> const& b, vector<int> const& queried, vector<int> const& c, vector<int> const& d)
{
	if (current_k == c.size())
	{
		int ans = 0;
		for (int i = 0; i < (int)a.size(); i++)
		{
			if (dishes[a[i]] == 1 && dishes[b[i]] == 1)
				ans++;
		}
		return ans;
	}

	int this_c = c[current_k];
	int this_d = d[current_k];

	bool either_called = false;
	int ans_c = 0, ans_d = 0, ans_0 = 0;
	if (queried[this_c] == 1)
	{
		if (dishes[this_c] == 0)
		{
			vector<int> this_dishes = dishes;
			this_dishes[this_c] = 1;
			ans_c = count_query(this_dishes, current_k + 1, a, b, queried, c, d);
			either_called = true;
		}
	}
	if (queried[this_d] == 1)
	{
		if (dishes[this_d] == 0)
		{
			vector<int> this_dishes = dishes;
			this_dishes[this_d] = 1;
			ans_d = count_query(this_dishes, current_k + 1, a, b, queried, c, d);
			either_called = true;
		}
	}
	if (!either_called)
		ans_0 = count_query(dishes, current_k + 1, a, b, queried, c, d);

	int retval = ans_0;
	retval = max(retval, ans_c);
	retval = max(retval, ans_d);
	return retval;
}

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

	int k;
	cin >> k;
	vector<int> c(k);
	vector<int> d(k);
	for (int j = 0; j < k; j++)
	{
		cin >> c[j] >> d[j];
		c[j]--;
		d[j]--;
	}

	vector<int> dishes(n);
	int ans = count_query(dishes, 0, a, b, queried, c, d);

	cout << ans << "\n";
	return 0;
}
MY_NAMESPACE_

#include <bits/stdc++.h>

#define repd(i, a, b) for (ll i = (a); i < (b); i++)
#define repb(i, n) for (ll i = (n)-1; i >= 0; i--)
#define rep(i, n) repd(i, 0, n)

using namespace std;

using ll = long long;
using ul = unsigned long long;
using ld = long double;
const ul mod = 1000000007;

int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    ll n, m;
    cin >> n >> m;
    vector<ll> a(m), b(m);
    rep(i, m) {
        cin >> a[i] >> b[i];
        a[i]--;
        b[i]--;
    }
    ll k;
    cin >> k;
    vector<ll> c(k), d(k);
    rep(i, k) {
        cin >> c[i] >> d[i];
        c[i]--;
        d[i]--;
    }

    ll ans = 0;
    rep(i, (1 << k)) {
        vector<ll> table(n);
        rep(j, k) {
            if (i & (1 << j)) {
                table[c[j]]++;
            } else {
                table[d[j]]++;
            }
        }

        ll temp = 0;
        rep(j, m) {
            if (table[a[j]] > 0 && table[b[j]] > 0) {
                temp++;
            }
        }
        ans = max(ans, temp);
    }
    cout << ans << endl;
    return 0;
}


#include <bits/stdc++.h>

#define ll long long
#define pushb push_back
#define popb pop_back
#define min_ min_element
#define max_ max_element
#define mp make_pair
#define fi first
#define se second
#define lb lower_bound
#define ub upper_bound
#define bs binary_search
#define sz(x) (int)(x).size()
#define all(x) x.begin(),x.end()
#define vi vector<int>
#define vli vector<long long>
#define vvi vector<vector<int>>
#define pi pair<int,int>
#define vpi vector<pair<int,int>>
#define vs vector<string>
#define mem(name,val) memset(name,val,sizeof(name))
#define precise fixed<<setprecision(9)

using namespace std;

#define fast ios::sync_with_stdio(false);cin.tie(0);

const ll int INF= 1e18;
const ll int MOD= 1000000007;
const int MX= 100005;
const long double pie= 2*acos(0.0);
vector<ll int> dp(MX,0);

//  check the limits Chutiye
//  read the question correctly ( ll int vs int )

int main()
{
    fast
    //for fast i/o for cp remember "\n" does for next line but it do not flush out the stream
    int test_c=1;
    //cin>>test_c;
    while(test_c--)
    {
        int i,j;
        int n;
        cin>>n;
        string s;
        cin>>s;
        if(s[0]!=s[n-1])
        {
            cout<<1;
            continue;
        }
        int flag=0;
        char a=s[0];
        for(i=2;i<n;i++)
        {
            if(s[i]!=a && s[i-1]!=a)
            {
                flag++;
                break;
            }
        }
        if(flag)
            cout<<2;
        else
            cout<<-1;

    }
	return 0;
}

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

#define rep( i, a, b ) for( int i = (a) ; i <= (b) ; i ++ )
#define per( i, a, b ) for( int i = (a) ; i >= (b) ; i -- )

typedef long long LL;

template<typename _T>
void read( _T &x )
{
    x = 0; char s = getchar(); int f = 1;
    while( s < '0' || '9' < s ) { f = 1; if( s == '-' ) f = -1; s = getchar(); }
    while( '0' <= s && s <= '9' ) { x = ( x << 3 ) + ( x << 1 ) + ( s - '0' ), s = getchar(); }
    x *= f;
}

template<typename _T>
void write( _T x )
{
    if( x < 0 ) putchar( '-' ), x = -x;
    if( 9 < x ) write( x / 10 );
    putchar( x % 10 + '0' );
}

template<typename _T>
inline _T MAX( const _T a, const _T b )
{
	return a > b ? a : b;
}

template<typename _T>
inline _T MIN( const _T a, const _T b )
{
	return a < b ? a : b;
}

template<typename _T>
inline _T ABS( const _T a )
{
	return a < 0 ? -a : a;
}

const int MAXN = 1e5 + 5;

char str[MAXN];
int N;
bool app[30];

int main()
{
	read( N );
	scanf( "%s", str + 1 );
	if( str[1] ^ str[N] ) return puts( "1" ), 0;
	bool flg = false;
	rep( i, 2, N - 2 )
		if( str[i] != str[1] && str[i + 1] != str[1] )
		{ flg = true; break; }
	puts( flg ? "2" : "-1" );
	return 0;
}


#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define chmin(a, b) a = min(a, b)
#define chmax(a, b) a = max(a, b)
#define ALL(v) v.begin(),v.end()
#define sz(v) (ll)v.size()
const ll INF = 1e18;
const ll MOD = 998244353;
// const ll MOD = 1000000007;
ll dx[] = {1, 0, -1, 0};
ll dy[] = {0, 1, 0, -1};
const double PI = acos(-1.0);

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

struct UnionFind{
    vector<int> rank, p;
    UnionFind(int N){
        rank.resize(N, 0);
        p.resize(N, 0);
        for(int i=0; i < N; i++) makeSet(i);
    }
    void makeSet(int x){
        p[x] = x;
        rank[x] = 0;
    }
    bool same(int x, int y){
        return findSet(x) == findSet(y);
    }
    void unite(int x, int y){
        link(findSet(x), findSet(y));
    }
    void link(int x, int y){
        if(rank[x] > rank[y]){
            p[y] = x;
        }else{
            p[x] = y;
            if(rank[x] == rank[y]){
                rank[y]++;
            }
        }
    }
    int findSet(int x){
        if(x != p[x]){
            p[x] = findSet(p[x]);
        }
        return p[x];
    }
};

int main() {
    ll n; cin >> n;
    UnionFind uf = UnionFind(n);
    for(ll i = 0; i < n; i++){
        ll f; cin >> f; f--;
        uf.unite(i, f);
    }
    set<ll> st;
    for(ll i = 0; i < n; i++) st.insert(uf.findSet(i));
    ll ans = 1;
    for(ll i = 0; i < sz(st); i++) ans = (ans * 2) % MOD;
    cout << ans-1 << endl;

    return 0;
}

#include<stdio.h>
#include<math.h>

#define ni(n) ((n) * (n))
#define rep(i,n) for(i=0;i<n;i++)
#define X(a,n) (a<=n)?a+n:a-n
#define N

int main(void){
	char str[6] = "ZONe";
	char s[100];
	int ans = 0;
	int count = 0;
	scanf("%s",s);
	int i;
	rep(i,12){
		if(s[i] == str[0]){
			int j;
			rep(j,4){
				if(s[i+j] == str[j]) count++;
			}
			if(count == 4) ans++;
		}
		count = 0;
	}
	printf("%d",ans);
	return 0;
}


#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <complex>
#include <cassert>
#include <set>
using namespace std;

const long long MOD = 1e9 + 7;
vector<long long> fact, fact_inv, inv;

void init_nCk(long long SIZE) {
    fact.resize(SIZE + 5);
    fact_inv.resize(SIZE + 5);
    inv.resize(SIZE + 5);
    fact[0] = fact[1] = 1;
    fact_inv[0] = fact_inv[1] = 1;
    inv[1] = 1;
    for (long long i = 2; i < SIZE + 5; i++) {
        fact[i] = fact[i - 1] * i % MOD;
        inv[i] = MOD - inv[MOD % i] * (MOD / i) % MOD;
        fact_inv[i] = fact_inv[i - 1] * inv[i] % MOD;
    }
}

long long nCk(long long n, long long k) {
    assert(!(n < k));
    assert(!(n < 0 || k < 0));
    return fact[n] * (fact_inv[k] * fact_inv[n - k] % MOD) % MOD;
}

int main()
{
    long long a, b, c;
    cin >> a >> b >> c;
    if (a * a + b * b < c * c) {
        printf("Yes");
    }else {
        printf("No");
    }
    return 0;
}

#include<bits/stdc++.h> //Ithea Myse Valgulious
namespace chtholly{
typedef long long ll;
#define re0 register int
#define rel register ll
#define rec register char
#define gc getchar
// #define gc() (p1==p2&&(p2=(p1=buf)+fread(buf,1,1<<23,stdin),p1==p2)?-1:*p1++)
#define pc putchar
#define p32 pc(' ')
#define pl puts("")
/*By Citrus*/
char buf[1<<23],*p1=buf,*p2=buf;
inline int read(){
  int x=0,f=1;char c=gc();
  for (;!isdigit(c);c=gc()) f^=c=='-';
  for (;isdigit(c);c=gc()) x=(x<<3)+(x<<1)+(c^'0');
  return f?x:-x;
  }
template <typename mitsuha>
inline bool read(mitsuha &x){
  x=0;int f=1;char c=gc();
  for (;!isdigit(c)&&~c;c=gc()) f^=c=='-';
  if (!~c) return 0;
  for (;isdigit(c);c=gc()) x=(x<<3)+(x<<1)+(c^'0');
  return x=f?x:-x,1;
  }
template <typename mitsuha>
inline int write(mitsuha x){
  if (!x) return 0&pc(48);
  if (x<0) pc('-'),x=-x;
  int bit[20],i,p=0;
  for (;x;x/=10) bit[++p]=x%10;
  for (i=p;i;--i) pc(bit[i]+48);
  return 0;
  }
inline char fuhao(){
  char c=gc();
  for (;isspace(c);c=gc());
  return c;
  }
}using namespace chtholly;
using namespace std;
int main() {
  int a,b,c;
  cin>>a>>b>>c;
  printf("%d\n",int(1.0*b/a*c-0.01));
}


#include <algorithm>
#include <cassert>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <string>
#include <unordered_map>
#include <unordered_set>
#include <vector>
using namespace std;

#define f first
#define s second
#define pb push_back
#define pii pair<int, int>
#define vi vector<int>
#define all(v) (v).begin(), (v).end()
#define sz(v) (int)((v).size())
#define f0(a) memset(a, 0, sizeof(a))
#define ll long long
struct Point {
  void read() {
    cin >> x >> y >> z;
  }

  int dist(const Point &o) const {
    return abs(x - o.x) + abs(y - o.y) + max(0, o.z - z);
  }

  int x = 0, y = 0, z = 0;
};
int dist[18][1<<18];

int main() {
  int n;
  cin >> n;
  vector<Point> points(n);
  for (int i = 0; i < n; ++i) {
    points[i].read();
  }

  using state = tuple<int, int, int>;
  priority_queue<state, vector<state>, greater<state>> pq;
  for (int i = 0; i < n; ++i) {
    fill(dist[i], dist[i] + (1 << 18), (int)1e9);
  }
  dist[0][1] = 0;
  pq.emplace(0, 0, 1);

  while (!pq.empty()) {
    auto [cost, v, mask] = pq.top();
    pq.pop();
    if (dist[v][mask] != cost) continue;

    for (int u = 0; u < n; ++u) {
      int w = points[v].dist(points[u]);
      int nmask = (mask | (1 << u));
      if (dist[u][nmask] > dist[v][mask] + w) {
        dist[u][nmask] = dist[v][mask] + w;
        pq.emplace(dist[u][nmask], u, nmask);
      }
    }
  }
  int ans = dist[0][(1 << n) - 1];
  for (int u = 0; u < n; ++u) {
    ans = min(ans, dist[u][(1 << n) - 1] + points[u].dist(points[0]));
  }
  cout << ans << endl;
	return 0;
}

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define loop(i, a, n) for (int i = a; i < n; i++)
#define loope(i, b, n) for (int i = b; i <= n; i++)
#define loopit(a) for (auto it = a.begin(); it != a.end(); it++)
#define ms(a, b) memset(a, b, sizeof(a))
#define pb(a) push_back(a)
#define MP make_pair
#define pi pair<int, int>
#define ff first
#define ss second
#define bloop(i, a, b) for (int i = a; i > b; i--)
#define bloope(i, a, b) for (int i = a; i >= b; i--)
#define PQ priority_queue<int> pq;
#define vi vector<int>
#define vii vector<vector<int>>
#define si set<int>
#define NO cout<<"NO\n";
#define YES cout<<"YES\n";
#define MPQ priority_queue<pi, vector<int>, greater<pi>> mpq;
#define io                        \
    ios_base::sync_with_stdio(0); \
    cin.tie(NULL);                \
// #include < ext / pb_ds / assoc_container.hpp >
// #include <ext/pb_ds/tree_policy.hpp>
// using namespace __gnu_pbds;
// typedef tree<int, null_type, less<int>, rb_tree_tag,
//         tree_order_statistics_node_update>
//         ordered_set;
ll ceil(ll a, ll b) {
    return (a + b - 1) / b;
}
//graph theory
vector<vi> adj;
vi vis;

int dfs(int cur) {
    int ret = 1;
    vis[cur] = 1;
    // cout << cur << ",";
    for (const auto &v : adj[cur]) {
        if (vis[v])continue;
        ret += dfs(v);
    }
    return ret;
}
const int maxm = 2 * 1e5 + 1;

void solve()
{
    int n; cin >> n;
    vi a(n);
    loop(i, 0, n)cin >> a[i];
    adj = vector<vi>(maxm + 1);
    vis = vi(maxm + 1);

    int ans = 0;
    loop(i, 0, n / 2) {
        if (a[i] == a[n - i - 1])continue;
        adj[a[i]].pb(a[n - i - 1]);
        adj[a[n - i - 1]].pb(a[i]);
    }

    loop(i, 0, n) {
        if (vis[a[i]])continue;
        ans += dfs(a[i]) - 1;
        // cout << "\n";
        // cout << a[i] << " " << ans << "\n";
    }
    cout << ans << "\n";
}
int main()
{
    io;
#ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
#endif
    int test = 1, i = 0;
    // cin >> test;
    while (i++ != test)
    {
        // cout<<"Case #"<<i<<": ";
        solve();
    }
    return 0;
}


#include<bits/stdc++.h>
#define rep(i, n) for(int i=0; i<n; i++)
#define repo(i, n) for(int i=1; i<=n; i++)
#define ssort(a) sort(a.begin(), a.end())
#define INF 1001001001
#define INFll 100100100100100100
// debug用
#define PrintVec(x) for (auto elementPrintVec: x) { cout << elementPrintVec << " "; } cout << endl;

using namespace std;
using ull = unsigned long long;
using ll = long long;
using P = pair<int, int>;
const int mod = 1000000007;

int main(){
  int x;
  cin >> x;
  if(x<0){
    x=0;
  }
  cout << x << endl;
  return 0;
}

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

int main(){
	int n;
	cin>>n;
	vector<int> a(2*n);
	rep(i, 2*n) cin>>a[i];

	vector<P> b;
	rep(i, 2*n) b.push_back(P(a[i], i));
	sort(b.begin(), b.end());
	P mid=b[n];

	vector<P> st;
	string ans;
	auto push=[&](P p){
		st.push_back(p);
		ans+='(';
	};
	auto pop=[&](){
		st.pop_back();
		ans+=')';
	};
	rep(i, 2*n){
		if(st.empty()) push(P(a[i], i));
		else{
			if(st.back()<mid==P(a[i], i)<mid) push(P(a[i], i));
			else pop();
		}
	}

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


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

#define rep(i, n) for(int i = 0, i##_len=(n); i < i##_len; ++i)
#define all(x) (x).begin(), (x).end()
#define len(x) ((int)(x).size())

void _cin() {} template <class Head, class... Tail> void _cin(Head&& head, Tail&&... tail) { cin >> head; _cin(forward<Tail>(tail)...); }
#define cin(Type, ...) Type __VA_ARGS__; _cin(__VA_ARGS__)
#define cinv(Type, xs, n) vector<Type> xs(n); rep(i, n) cin >> xs[i]
#define cinv2(Type, xs, ys, n) vector<Type> xs(n), ys(n); rep(i, n) cin >> xs[i] >> ys[i]
#define cinv3(Type, xs, ys, zs, n) vector<Type> xs(n), ys(n), zs(n); rep(i, n) cin >> xs[i] >> ys[i] >> zs[i]
#define cinvv(Type, xs, h, w) vector<vector<Type>> xs(h, vector<Type>(w)); rep(i, h) rep(j, w) cin >> xs[i][j]

void print() { cout << endl; }
template <class Head, class... Tail> void print(Head&& head, Tail&&... tail) { cout << head; if (sizeof...(tail) != 0) cout << " "; print(forward<Tail>(tail)...); }
template <class Type> void print(vector<Type> &vec) { for (auto& a : vec) { cout << a; if (&a != &vec.back()) cout << " "; } cout << endl; }
template <class Type> void print(vector<vector<Type>> &df) { for (auto& vec : df) { print(vec); } }

void YESNO(bool b) { cout << (b ? "YES" : "NO") << endl; }
void YesNo(bool b) { cout << (b ? "Yes" : "No") << endl; }
void yesno(bool b) { cout << (b ? "yes" : "no") << endl; }
template<class Integer>bool chmax(Integer &a, const Integer &b) { if (a < b) { a = b; return 1; } return 0; }
template<class Integer>bool chmin(Integer &a, const Integer &b) { if (b < a) { a = b; return 1; } return 0; }

using ll = long long;

void Main() {
	cin(int, n,w);
	print(n/w);
}

signed main() {
	cin.tie(0);
	ios::sync_with_stdio(false);
	cout << fixed << setprecision(16);

	Main();
}

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

#define rep(i,a,b) for(int i = a; i < (b);++i)
#define all(x) begin(x), end(x)
#define sz(x) (int) (x).size()

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

const int MAX_N = 1000001;
int n;
ll k;

int main(){
    cin.tie(0)->sync_with_stdio(false);
    cin.exceptions(cin.failbit);
    cin>>n>>k;
    int i = 3;
    ll cur = 1;
    ll sum = 1;
    while(sum < k){
        int ans1,ans2;
        if(i<n+2){
            ans1 = 0;
        }else if(i>= n+2 && i<= 2*n+1){
            ans1 = i-(n+1);
        }else{
            ans1 = 3*n-i+1;
        }
        if(i>2*n){
            ans2 = 0;
        }else if(i>= n+1 && i<= 2*n){
            ans2 = 2*n-i+1;
        }else{
            ans2 = i-1;
        }
        cur = cur - ans1 + ans2;
        sum +=cur;
        i++;
    }
    ll k2 = k - (sum - cur);
    int t = i;
    i = 1;
    sum = 0;
    while(sum<k2){
        if(t-i > 2*n){
            cur = 0;
        }else if(t-i <= 2*n && t-i>= n+1){
            cur = 2*n -(t-i) +1;
        }else{
            cur = t - i -1;
        }
        sum+=cur;
        i++;
    }
    i--;
    int k3 = k2 - (sum - cur);
    int j;
    if((t-i) >= n+1){
        j = k3 + (t-i-n)-1;
    }else{
        j = k3;
    }
    cout << i <<" "<< j <<" "<<t-(i+j)<<endl;
    return 0;
}


#include <bits/stdc++.h>

using namespace std;
int main(){
    int a, b;
    scanf("%d%d", &a, &b);
    int c = (a - b) * 100;
    double d = c * 1.0 / a;
    printf("%.20lf", d);
    return 0;
}

#include<cstdio>
#include<cstring>
#include<cstdlib>
#include<algorithm>
using namespace std;

#define rep(i, l, r) for(int i=(l), i##_end_=(r); i<=i##_end_; ++i)
#define drep(i, l, r) for(int i=(l), i##_end_=(r); i>=i##_end_; --i)
#define fi first
#define se second
#define mp(a, b) make_pair(a, b)
#define Endl putchar('\n')
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
template<class T>inline T fab(T x){ return x<0? -x: x; }
template<class T>inline T readin(T x){
    x=0; int f=0; char c;
    while((c=getchar())<'0' || '9'<c) if(c=='-') f=1;
    for(x=(c^48); '0'<=(c=getchar()) && c<='9'; x=(x<<1)+(x<<3)+(c^48));
    return f? -x: x;
}

int a, b;

signed main(){
    a=readin(1), b=readin(1);
    b=a-b;
    printf("%.15f\n", b*100.0/a);
    return 0;
}


#include<bits/stdc++.h>
#define ll long long
#define r(i,a,b) for(register int i=a;i<=b;i++)
#define mem(d) memset(d,0,sizeof(d))
#define ul unsigned long long
#define IsDigit(c) ('0' <= (c) && (c) <= '9')
const int N=500000;
const ll p=1e9+7;
using namespace std;
inline ll qr()
{
	int x = 0; bool f = true;char c = getchar();
	for (; ! IsDigit(c); c = getchar()) if (c == '-') f = false;
	for (; IsDigit(c); c = getchar()) x = (x << 3) + (x << 1) + (c ^ '0');
	return f ? x : -x;
}
ll res,num,n,a,b,ans;
int main()
{
    int T;
    T=qr();
    while(T--)
	{
        ans=0;n=qr(),a=qr(),b=qr();
        if(n>=a+b)
		{
            res=((n-a-b+1) * (n-a-b+2) )%p;
            num=(2*(n-a+1) * (n-b + 1))%p-res;
            if(num<0)
				num=(p-(-num) )%p;//处理负数
            ans=res*num%p;
        }
        printf("%lld\n",ans);
    }
}

#include<iostream>
using namespace std;
typedef long long li;
#define MOD 1000000007
#define rep(i,n) for(int i=0;i<(n);i++)
#define df 0
template<class T> void print(const T& t){ cout << t << "\n"; }
template<class T, class... Ts> void print(const T& t, const Ts&... ts) { cout << t; if (sizeof...(ts)) cout << " "; print(ts...); }

struct modint{
  li num;

  modint(li a=0){
    num=(a%MOD+MOD)%MOD;
  }
  modint operator+(modint a) {return{(num+a.num)%MOD};}
  modint operator-(modint a) {return{(num+MOD-a.num)%MOD};}
  modint operator*(modint a) {return{num*a.num%MOD};}
  modint inv(const modint& a);
  modint operator/(modint a) {return (*this)*inv(a);}
  modint& operator+=(modint a) {
    (num += a.num)%=MOD;
    return *this;
  }
  modint& operator-=(modint a) {
    (num += MOD-a.num)%=MOD;
    return *this;
  }
  modint& operator*=(modint a) {
    (num*=a.num)%=MOD;
    return *this;
  }
};

std::ostream& operator<<(std::ostream& os, const modint& m){
  // ここでストリームに obj を書き込みます。
  li a=m.num;
  cout << a;
  return os;
}

std::istream& operator>>(std::istream& os,modint& m){
  // ここでストリームに obj を書き込みます。
  li a; cin >>a;
  m=a;
  return os;
}

int main(){
  int q; cin >>q;
  rep(_,q){
    modint n,a,b; cin >>n >>a >>b;
    if(a.num+b.num>n.num){
      print(0); continue;
    }
    if(a.num>b.num){
      a+=b; b=a-b; a-=b;
    }
    modint ans=(n-b+1)*(a+b-1)-(a-1)*a;
    ans=ans*ans;
    ans*=-1;
    ans+=(n-a+1)*(n-b+1)*(n-a+1)*(n-b+1);
    print(ans);
  }
}


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

#define ll long long
#define pii pair<int, int>
#define pll pair<ll, ll>
#define vi vector<int>
#define vll vector<ll>
#define vpii vector<pair<int,int>>
#define vpll vector<pair<ll,ll>>
#define fr(i,k,n) for (int i = k; i < n; ++i)
#define fri(i,k,n) for (int i = k; i >= n; --i)
#define pb push_back
#define mp make_pair
#define all(arr) arr.begin(),arr.end()
#define ff first
#define ss second

const double pi=3.1415926535897932384626433832795;
const int inf=1e9;
const ll inf2=1e18;
const int mod=998244353;

void boost(){
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
}

const int N=2e5+5;
vi nxt(N,0),vis(N,0);

bool found=false;

void dfs(int u){
    vis[u]=1;
    int v=nxt[u];
    if((!found) && vis[v]==0){
        dfs(v);
    }
    else if(vis[v]==1){
        found=true;
    }
    vis[u]=2;
}

inline ll exp(ll x, ll n, ll m = mod) {
    ll r = 1;
    while(n) {
        if(n & 1) r = r * x % m;
        x = x * x % m, n >>= 1;
    }
    return r;
}

void solve(){
    int n;
    cin>>n;
    int cnt=0;
    for(int i=1;i<=n;i++){
        cin>>nxt[i];
    }
    for(int i=1;i<=n;i++){
        if(!vis[i]){
            found=false;
            dfs(i);
            if(found)
                cnt++;
        }
    }
    ll ans=exp(2,cnt);
    ans=(ans-1LL +mod)%mod;
    cout<<ans<<endl;
    return;
}

int main()
{
    boost();

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

#include <bits/stdc++.h>

#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define FOR(i,n,m) for(int i=(int)(n); i<=(int)(m); i++)
#define RFOR(i,n,m) for(int i=(int)(n); i>=(int)(m); i--)
#define ITR(x,c) for(__typeof(c.begin()) x=c.begin();x!=c.end();x++)
#define RITR(x,c) for(__typeof(c.rbegin()) x=c.rbegin();x!=c.rend();x++)
#define setp(n) fixed << setprecision(n)

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

#define ll long long
#define vll vector<ll>
#define vi vector<int>
#define pll pair<ll,ll>
#define pi pair<int,int>

#define all(a) (a.begin()),(a.end())
#define rall(a) (a.rbegin()),(a.rend())
#define fi first
#define se second
#define pb push_back
#define ins insert

#define debug(a) cerr<<(a)<<endl
#define dbrep(a,n) rep(_i,n) cerr<<(a[_i])<<" "; cerr<<endl
#define dbrep2(a,n,m) rep(_i,n){rep(_j,m) cerr<<(a[_i][_j])<<" "; cerr<<endl;}

using namespace std;

template<class A, class B>
ostream &operator<<(ostream &os, const pair<A,B> &p){return os<<"("<<p.fi<<","<<p.se<<")";}
template<class A, class B>
istream &operator>>(istream &is, pair<A,B> &p){return is>>p.fi>>p.se;}

/* Some Libraries */

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

const int N_MAX = 2e5;
vi G[N_MAX];

bool seen[N_MAX];
void dfs(int v)
{
    seen[v]=true;
    for(auto u:G[v]){
        if (seen[u]) continue;
        dfs(u);
    }
}

const ll mod = 998244353;

int main(void)
{
    cin.tie(0);
    ios::sync_with_stdio(false);
    int N; cin>>N;
    vi f(N);
    rep(i,N) cin>>f[i], f[i]--;
    rep(i,N){
        G[i].pb(f[i]);
        G[f[i]].pb(i);
    }
    ll ans=1;
    rep(v,N){
        if (!seen[v]){
            dfs(v);
            (ans*=2)%=mod;
        }
    }
    ans = (ans-1+mod)%mod;
    cout<<ans<<"\n";
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define f(i,a,b,c) for(ll i=a;i<b;i+=c)
#define r(i,a,b,c) for(ll i=a;i>=b;i-=c)
#define mod 1000000007

int main(){
    ios_base::sync_with_stdio(0),cin.tie(0),cout.tie(0);
    ll n; cin >> n;
    vector<ll> ar;
    ll s = sqrt(n);
    // cout << s << "\n";
    f(i,1,s+1,1){
    	if(n%i==0){
    		ar.push_back(i);
    		if(i!=(n/i)) ar.push_back(n/i);
    	}
    }
    sort(ar.begin(),ar.end());
    f(i,0,ar.size(),1){
    	cout << ar[i] << "\n";
    }
    return 0;
}

#include<bits/stdc++.h>
using namespace std;
int main(){
	long n,i;
  	cin>>n;
  	set<long, less<long>> mySet;
  	for(i=1;i*i<=n;i++){
    	if(n%i == 0){
          mySet.insert(i);
            mySet.insert(n/i);
        }
    }
  	for(long j:mySet){
    	cout<<j<<"\n";
    }
	return 0;
}


#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
typedef long long ll;
typedef pair<ll, ll> P;
typedef vector<string> vs;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef vector<P> vp;
typedef vector<vi> vvi;
typedef vector<vl> vvl;
typedef vector<vp> vvp;

const ll MOD = 1e9 + 7;

// input
ll N, M;
vi A;

void input() {
    cin >> N >> M;
    A = vi(N);
    rep(i, N) cin >> A[i];
}

int main() {
    input();
    ll s = accumulate(A.begin(), A.end(), 0LL);
    ll a = 1;
    rep(i, s + N) a = a * (M + N - i) % MOD;
    vl inv(s + N + 1), finv(s + N + 1);
    inv[1] = 1;
    finv[0] = finv[1] = 1;
    for (int i = 2; i <= s + N; i++){
        inv[i] = MOD - inv[MOD % i] * (MOD / i) % MOD;
        finv[i] = finv[i - 1] * inv[i] % MOD;
    }
    ll b = finv[s + N];
    ll ans = a * b % MOD;
    cout << ans << endl;
}

#include <stdio.h>
long long p = 1000000007;
long long n, m, s;
long long x, y, z;
long long a[2000];
long long inv[5000000];
void makeinv(void) {
	long long arraynumber = sizeof inv / sizeof inv[0];
	inv[1] = 1;
	for (int invcount = 2; invcount < arraynumber; invcount++) {
		inv[invcount] = p - inv[p % invcount] * (p / invcount) % p;
	}
}
int main() {
	makeinv();
	scanf("%lld%lld", &n, &m);
	for (int i = 0; i < n; i++) {
		scanf("%lld", a + i);
		s += a[i];
	}
	if (m < s) {
		printf("0\n");
		return 0;
	}
	x = m + n;
	y = s + n;
	z = 1;
	for (long long i = 0; i < y; i++) {
		z *= (x - i);
		z %= p;
	}
	for (long long i = 1; i <= y; i++) {
		z *= inv[i];
		z %= p;
	}
	printf("%lld\n", z);
}


#include<bits/stdc++.h>
#include<stdlib.h>
using namespace std;
typedef long long int ll;
int main()
{
    string s;
    cin>>s;
    int ans=0;
    for(int i=0;i<=9999;i++){
        vector<bool>flag(10,false);
        int x=i;
        for(int j=0;j<4;j++){
            flag[x%10]=true;
            x/=10;
        }
        bool flag1=true;
        for(int j=0;j<10;j++){
            if(s[j]=='o'&&!flag[j]) flag1=false;
            if(s[j]=='x'&&flag[j]) flag1=false;
        }
        ans+=flag1;
    }
    cout<<ans<<endl;
}

#include <bits/stdc++.h>
using namespace std;
//ofstream cout("output.out");

#define fast() {ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);}
#define pb push_back
#define vi vector<int>
#define vl vector<ll>
#define vii vector<vector<int>>
#define mii map<int, int>
#define pii pair<int, int>
#define qii priority_que<int, vector<int>, greater<int>>
#define For(i, n) for(int i = 0; i < n; ++i)
#define For1(i, n) for(int i = 1; i <= n; ++i)
#define Forlr(i, l, r) for(int i = l; i <= r; ++i)
#define Forrl(i, r, l) for(int i = r; i >= l; --i)
#define o(a) { cout << #a << ":" << (a) <<" ";}
#define ov(a) {For(i, a.size()) cout << a[i] <<" ";}
#define ovv(a) {For(i, a.size()) {For(j, a[i].size()) cout << a[i][j] <<" ";cout <<"\n";}}
using ll = long long;
int n, m, k, q;

void solve(){
	string s;
	cin >> s;
	n = s.length();
	ll rs = 0;
	For(i1, 10) For(i2, 10) For(i3, 10) For(i4, 10){
		if(s[i1] == 'x' || s[i2] == 'x'
			|| s[i3] == 'x' || s[i4] == 'x'){
			continue;
		}
		bool check = 0;
		For(i, n) if(s[i] == 'o' && i1 != i &&
			i2 != i && i3 != i && i4 != i) check = 1;
		rs += check == 0 ? 1 : 0;
	}
	cout << rs <<"\n";

}

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