#include <bits/stdc++.h>

using namespace std;

using ll = long long;
using P = pair<ll, ll>;
using V = vector<ll>;
using VV = vector<V>;
using M = map<ll, ll>;
using Q = queue<ll>;
using PQ = priority_queue<ll>;
using ST = stack<ll>;
using Graph = vector< vector<ll> >;
using VP = vector<P>;

#define rep(i, n)     for(ll i=0;i<(ll)(n);i++)
#define rep2(i, m, n) for(ll i=m;i<(ll)(n);i++)
#define rrep(i, n, m) for(ll i=n;i>=(ll)(m);i--)
#define rbfor(v, vec) for(auto const& v : vec)
#define debug(var)  do{std::cout << #var << " : ";view(var);}while(0)

const ll MOD = 1000000007;
const ll INF = 1000000000000000000L;
const int INFI = 1000000000;
template<typename T> bool chmax(T &a, const T &b) {if (a < b){a = b;return true;}else{return false;}}
template<typename T> bool chmin(T &a, const T &b) {if (a > b){a = b;return true;}else{return false;}}
template<typename T> void view(T e){std::cout << e << std::endl;}
template<typename T> void view(const std::vector<T>& v){for(const auto& e : v){ std::cout << e << " "; } std::cout << std::endl;}
template<typename T> void view(const std::vector<std::vector<T> >& vv){ for(const auto& v : vv){ view(v); } }

// for dfs
string s[505];
bool used[505][505];
int d[505][505];

const int di[] = {-1,0,1,0}, dj[] = {0,-1,0,1};

void sample_solve();
bool dfs(int i, int j);
void bfs();
ll gcd(ll m, ll n);
ll lcm(ll x, ll y);
bool compare(P a, P b);
void vp_sort(VP& vp, bool asc);

// =================================
// Main Logic
// =================================
void solve() {
  int ans = 0;
  int n;
  cin >> n;
  vector<int> a(n);
  rep(i,n) cin >> a[i];
  rep(i,n) {
    if (a[i] > 10) ans += (a[i]-10);
  }
  cout << ans << endl;
}
// =================================

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

// ---------------
// https://atcoder.jp/contests/apg4b/tasks_print
// ---------------

typedef tuple<string, int ,int> TUPLE;
bool comp(TUPLE lhs, TUPLE rhs) {
  if (get<0>(lhs) == get<0>(rhs)) {
    return get<1>(lhs) > get<1>(rhs);
  } else {
    return get<0>(lhs) < get<0>(rhs);
  }
}

// 最大公約数
ll gcd(ll m, ll n) {
  if (n == 0) return m;
  return gcd(n, m%n);
}

// 最小公倍数
ll lcm(ll x, ll y) {
    return x / gcd(x, y) * y;//先に割り算をして掛けられる数を小さくして掛け算を行う
}

bool compare(P a, P b) {
  if(a.first != b.first){ return a.first > b.first; }
  if(a.second != b.second){return a.second > b.second;}
  return true;
}

void vp_sort(VP& vp, bool asc) {
  sort(vp.begin(), vp.end(), compare);
  if(asc) reverse(vp.begin(), vp.end());
}

  /*
  // 比較関数の例: tuple 0で辞書順ソート、1で降順ソート
  cout << "-- comp of tuple" << endl;
  vector<TUPLE> vt;
  vt.push_back(make_tuple("khabarovsk", 20, 1));
  vt.push_back(make_tuple("moscow", 10, 2));
  vt.push_back(make_tuple("kazan", 50, 3));
  vt.push_back(make_tuple("kazan", 35, 4));
  vt.push_back(make_tuple("moscow", 60, 5));
  vt.push_back(make_tuple("khabarovsk", 40, 6));
  sort(vt.begin(), vt.end(), comp);

  rep(i, 6) cout << get<0>(vt.at(i)) << ":" << get<1>(vt.at(i)) << ":" << get<2>(vt.at(i)) << endl;
  */

#define _CRT_SECURE_NO_WARNINGS 1
#define _CRT_DECLARE_NONSTDC_NAMES 0 // for using y1 as variable name

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

using ll = long long int;
constexpr ll MOD = 1000000007;

int n;
vector<int> d;
ll res;

int main(void)
{
#ifdef CUBE_PS
    freopen("input.txt", "r", stdin);
#endif
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);

    cin >> n;
    d.resize(n);
    for(int i = 0; i < n; ++i) {
        cin >> d[i];
    }
    sort(d.begin(), d.end());
    d.erase(unique(d.begin(), d.end()), d.end());

    res = d[0] + 1;
    for(int i = 1; i < d.size(); ++i) {
        res *= (d[i] - d[i - 1] + 1);
        res %= MOD;
    }
    cout << res;

    return 0;
}


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

template <typename T>
inline bool chmax(T &current, const T &test){
  if (current < test){
    current = test;
    return true;
  }
  return false;
}
template <typename T>
inline bool chmin(T &current, const T &test){
  if (current > test){
    current = test;
    return true;
  }
  return false;
}

int corner_count(vector<vector<int>> &s, int i, int j){
  int sum = 0;
  sum += s[i][j] + s[i-1][j] + s[i][j-1] + s[i-1][j-1];
  if(sum == 1 || sum == 3){
    return 1;
  }else{
    return 0;
  }
}

int main() {
  int h, w;
  cin >> h >> w;
  vector<vector<int>> s(h, vector<int> (w));
  char c;
  rep(i, h){
    rep(j, w){
      cin >> c;
      if(c =='#'){
        s[i][j] = 1;
      }else{
        s[i][j] = 0;
      }
    }
  }

  int ans = 0;

  for(int i = 1; i < h; i++){
    for(int j = 1; j < w; j++){
      ans += corner_count(s, i, j);
    }
  }

  cout << ans << endl;
}

#include<bits/stdc++.h>
using namespace std;
int mod=1e9+7;
const int N=2e5+5;
int32_t main()
{
    int ans=0;
    int n;
    cin>>n;
    vector<vector<int>  > a(n,vector<int> (5));
    vector<vector<int>  > dp(5);
    for(int i=0;i<n;i++)
    {
        for(int j=0;j<5;j++)
        {
            cin>>a[i][j];
            dp[j].push_back(a[i][j]);
        }
    }
    for(int i=0;i<5;i++)
    {
        sort(begin(dp[i]),end(dp[i]),greater<int> ());
    }
    for(int i=0;i<n;i++)
    {
        for(int j=i+1;j<n;j++)
        {
            int ind;
            int mini=1e9;
            for(int k=0;k<5;k++)
            {
                if(max(a[i][k],a[j][k])<mini)
                {
                    ind=k;
                    mini=max(a[i][k],a[j][k]);
                }
            }
            int val=1e9;
            for(int k=0;k<5;k++)
            {
                if(k!=ind)
                val=min(val,max(a[i][k],a[j][k]));
            }
            val=min(val,dp[ind][0]);
            ans=max(ans,val);
        }
    }
    cout<<ans<<endl;
}


#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
using namespace std;
#define f(i,a,b) for( ll i = a; i < b ; i++ )
#define af(i,a,b) for( ll i = a; i >= b ; i--)
#define rep(i,a,b,k) for(ll i = a; i < b ; i+= k )
#define arep(i,a,b,k) for( ll i = a; i >= b ; i-= k)
#define ones(ini) (ll) __builtin_popcountll(x)
#define todo(y,val) all_of(all(y),[&val](ll x) {return (x == ((ll)val));})
#define nada(y,val) none_of(all(y),[&val](ll x) {return (x == ((ll)val));})
#define algu(y,val) any_of(all(y),[&val](ll x) {return (x == ((ll)val));})
#define cuantos(a,x) count(all(a),x)
#define fs first
#define sc second
#define pb push_back
#define sz(a) (ll) a.size()
#define all(a) a.begin(), a.end()
#define sor(a) sort( a.begin(), a.end() )
#define fastio ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0)
#define ller ios::sync_with_stdio(false);cin.tie(nullptr);cout.tie(nullptr)
#define watch(x) cout << (#x) << " is " << (x) <<"\n"
#define test ll deftestcases;cin>>deftestcases;while(deftestcases--)
#define PI acos(-1)
using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair<ll,ll> ii;
typedef vector<ll>  vi;
typedef vector<ii> vii;
template<class T> using ordered_set =tree<T, null_type, less<T>, rb_tree_tag,tree_order_statistics_node_update> ;
const ll inf = 2e9;
const ll mod = 1e9+7;
const ll MAX = 6e2+10;

struct celda{
    ll u=0,v=0,dis=0;
    bool operator<(const celda& other) const{
        return dis>other.dis;
    }
};

ll dis[MAX][MAX],a[MAX][MAX],b[MAX][MAX];
ll n,m;
priority_queue<celda> pq;

void fun(ll u,ll v,ll dd){
    if(dis[u][v]>dd){
        dis[u][v] = dd;
        celda aux;
        aux.u = u,aux.v = v,aux.dis = dd;
        pq.push(aux);
    }
}

void dijkstra(){
    f(i,0,n+4){
        f(j,0,m+4){
            dis[i][j] = inf;
        }
    }
    fun(0,0,0);
    while(sz(pq)){
        auto pos = pq.top();
        if(pos.u==n-1 && pos.v == m-1){
            cout<<dis[pos.u][pos.v]<<"\n";return;
        }
        pq.pop();
        if(dis[pos.u][pos.v]<pos.dis) continue;
        if(pos.v<m-1){
            fun(pos.u,pos.v+1,pos.dis+a[pos.u][pos.v]);
        }
        if(pos.v>0){
            fun(pos.u,pos.v-1,pos.dis+a[pos.u][pos.v-1]);
        }
        if(pos.u<n-1){
            fun(pos.u+1,pos.v,pos.dis+b[pos.u][pos.v]);
        }
        f(uwu,1,pos.u+1){
            fun(pos.u-uwu,pos.v,pos.dis+uwu+1);
        }
    }
}

int main(){
    fastio;
    cin>>n>>m;
    f(i,0,n){
        f(j,0,m-1) cin>>a[i][j];
    }
    f(i,0,n-1){
        f(j,0,m) cin>>b[i][j];
    }
    dijkstra();
}

#include <iostream>
#include <algorithm>
#include <stack>
#include <queue>
#include <vector>
#include <bitset>
#include <iomanip>
#include <cmath>
#include <set>
#include <unordered_set>
#include <functional>
#include <map>
#include <unordered_map>
#include <string>
#include <tuple>
using namespace std;
using ll = long long;
const int MOD=1e9+7;
const int MAX=100009;
ll fac[100009],finv[100009],inv[100009];

#define pi 3.14159265358979323846
#define ee 2.71828182845904523536
#define INF 5e18

ll gcd(ll x, ll y) { // 最大公約数
    if (y == 0)return x;
    else return gcd(y, x % y);
}

bool prime(ll x) { //素数判定
    if(x==1)return false;
    if (x!=2&&x % 2 == 0)return false;
    for (ll i = 3; i <= sqrt(x); i+=2) {
        if (x % i == 0)return false;
    }
    return true;
}

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

ll modpow(ll a, ll n, ll mod) { //二分累乗法
    ll res = 1;
    while (n) {
        if (n % 2)res = res * a % mod;
        a = a * a % mod;
        n /= 2;
    }
    return res;
}

void COMinit() { //二項係数計算の前処理
    fac[0] = fac[1] = 1;
    finv[0] = finv[1] = 1;
    inv[1] = 1;
    for (int i = 2; i < MAX; i++){
        fac[i] = fac[i - 1] * i % MOD;
        inv[i] = MOD - inv[MOD%i] * (MOD / i) % MOD;
        finv[i] = finv[i - 1] * inv[i] % MOD;
    }
}

ll COM(int n, int k){ //二項係数計算
    if (n < k) return 0;
    if (n < 0 || k < 0) return 0;
    return fac[n] * (finv[k] * finv[n - k] % MOD) % MOD;
}

struct UnionFind {   // UnionFind
    vector<int> par;
    vector<int> siz;

    UnionFind(int N) : par(N), siz(N, 1) {
        for (int i = 0; i < N; i++) par[i] = i;
    }

    int root(int x) {
        if (par[x] == x) return x;
        return par[x] = root(par[x]);
    }

    void unite(int x, int y) {
        int rx = root(x);
        int ry = root(y);
        if (rx == ry) return;
        if (par[rx] > par[ry])swap(rx, ry);
        siz[rx] += siz[ry];
        par[ry] = rx;
    }

    bool same(int x, int y) {
        int rx = root(x);
        int ry = root(y);
        return rx == ry;
    }
    int size(int x) {
        return siz[root(x)];
    }
};

int main() {
    int r,c;
    cin>>r>>c;
    int a[500][500];
    int b[500][500];
    for(int i=0;i<r;i++){
        for(int j=0;j<c-1;j++)cin>>a[j][i];
    }
    for(int i=0;i<r-1;i++){
        for(int j=0;j<c;j++)cin>>b[j][i];
    }
    priority_queue<tuple<int,int,int>,vector<tuple<int,int,int>>,greater<tuple<int,int,int>>> pq;
    pq.push(make_tuple(0,0,0));
      vector<vector<int>> co(c+1,vector<int>(r+1,5e9));
    --r;--c;
    co[0][0]=0;
    while(!pq.empty()){
        auto cur=pq.top();
        pq.pop();
        int x=get<1>(cur);
        int y=get<2>(cur);
        int cost=get<0>(cur);
        if(x==c&&y==r){
            cout<<cost<<endl;
            return 0;
        }
        if(x<c&&co[x+1][y]>cost+a[x][y]){
            pq.push(make_tuple(cost+a[x][y],x+1,y));
            co[x+1][y]=cost+a[x][y];
        }
        if(x>0&&co[x-1][y]>cost+a[x-1][y]){
            pq.push(make_tuple(cost+a[x-1][y],x-1,y));
            co[x-1][y]=cost+a[x-1][y];
        }
        if(y<r&&co[x][y+1]>cost+b[x][y]){
            pq.push(make_tuple(cost+b[x][y],x,y+1));
            co[x][y+1]=cost+b[x][y];
        }
        for(int i=1;i<=y;i++){
            if(co[x][y-i]>cost+1+i){
                pq.push(make_tuple(cost+1+i,x,y-i));
                co[x][y-i]=cost+1+i;
            }
        }
    }
}


#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define pb push_back
#define rep(i,a)  for(ll i=0; i< a; i++)
#define rep1(i,a)   for(ll i = 1; i< a; i++)
#define foi(i, a, b)    for(ll i = a; i<b ; i++)
#define fod(i, a, b)    for(ll i = a; i>=b ; i--)
#define max3(a, b, c)   max(max(a, b), c)
#define min3(a, b, c)   min(min(a, b), c)
#define MAX 1000005
#define MOD 1000000007

ll findgcd(ll n,ll m){
    return __gcd(n,m);
}
ll findlcm(ll n,ll m){
    return (n*m)/findgcd(n,m);
}

ll nodig(ll n){
    int ans =0;
    while(n!=0){
        ans+=1;
        n=n/10;
    }
    return ans;
}

int main(){
    ios::sync_with_stdio(0);
    cin.tie(0);
    int n,a,b;
    cin>>n>>a>>b;
    cout<<n-a+b<<"\n";
return 0;
}

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

int main() {

  int N = 0 ,A = 0 ,B = 0;

  cin >> N >> A >> B;

  cout<< N - A + B << endl;

}


#include<bits/stdc++.h>
#pragma GCC optimize("Ofast")
using namespace std;
#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> indexed_set;

#define forn(i,x1,n)     for(int i=x1; i<n; i++)
#define forit(it, m)    for(decltype(m)::iterator it = m.begin(); it!=m.end(); ++it)
#define ff              first
#define ss              second
#define int             long long
#define pb              push_back
#define mp              make_pair
#define pii             pair<int,int>
#define vi              vector<int>
#define mii             map<int,int>
#define pqb             priority_queue<int>
#define pqs             priority_queue<int,vi,greater<int> >
#define setbits(x1)      __builtin_popcountll(x1)
#define zrobits(x1)      __builtin_ctzll(x1)
#define mod             1000000007
// #define mod             998244353
#define inf             1e18
#define ps(x1,y)         fixed<<setprecision(y)<<x1
#define mk(arr,n,type)  type *arr=new type[n];
#define w(x1)            int x1; cin>>x1; while(x1--)
mt19937                 rng(chrono::steady_clock::now().time_since_epoch().count());

void zeus()
{
	ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#ifndef ONLINE_JUDGE
	freopen("input.txt", "r", stdin);
	freopen("output.txt", "w", stdout);
#endif
}

int maxi = 2000001;
int fac[2000001];

int fast_pow(long long base, long long n, long long M)
{
	if (n == 0)
		return 1;
	if (n == 1)
		return base;
	long long halfn = fast_pow(base, n / 2, M);
	if (n % 2 == 0)
		return ( halfn * halfn ) % M;
	else
		return ( ( ( halfn * halfn ) % M ) * base ) % M;
}
int findMMI_fermat(int n, int M)
{
	//only for prime
	return fast_pow(n, M - 2, M);
}

int nCr(int n, int r, int M) { //For small n,r use GCD technique, find on GFG

	int ans = (fac[n] * findMMI_fermat(fac[n - r], M) % M) * findMMI_fermat(fac[r], M);
	ans = ans % M;

	return ans;
}
int32_t main() {

	zeus();
	fac[0] = 1;

	forn(i, 1, maxi) {
		fac[i] = fac[i - 1] * i;
		fac[i] %= mod;
	}
	int n, m, k; cin >> n >> m >> k;

	if (n > m + k) {
		cout << 0 << endl;
	}
	else if (k > n) {
		cout << nCr(n + m, m, mod);
	}
	else {
		cout << (nCr(n + m, m, mod) - nCr(n + m, m + k + 1, mod) + mod) % mod << endl;
	}

}

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

const int mn=2e6+6,mod=1e9+7;
int n,m,k;
LL fac[mn],inv[mn];

LL qpow(LL a,LL b) {LL ans=1;while(b) {if(b&1) ans=ans*a%mod;a=a*a%mod;b>>=1;}return ans;}

void init()
{
    fac[0]=inv[0]=1;
    for(int i=1;i<mn;++i) fac[i]=fac[i-1]*i%mod;
    inv[mn-1]=qpow(fac[mn-1],mod-2);
    for(int i=mn-2;i;--i) inv[i]=inv[i+1]*(i+1)%mod;
}

LL C(int n,int m)
{
    if(m>n) return 0;
    return (fac[n]*inv[m]%mod)*inv[n-m]%mod;
}

int main()
{
    init();
    cin>>n>>m>>k;
    if(n>m+k) {puts("0");return 0;}
    cout<<(C(n+m,n)+mod-C(n+m,m+k+1))%mod;
}


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

#define  all(x)        (x).begin(),(x).end()
#define  pb            push_back
#define  lb            lower_bound
#define  ub            upper_bound
#define  fi            first
#define  se            second
#define  pii           pair<int,int>
#define  fastIO        ios_base::sync_with_stdio(false); cin.tie(NULL);
#define  mp            make_pair
#define endl '\n'
#define int long long

typedef double db;
typedef long long ll;

const int N = 2e5 + 5;
const int MOD = 1e9 + 7;
const int INF = 1e9;

void solve() {

	string s; cin >> s;
	reverse(all(s));
	for (int i = 0; i < (int)s.length(); i++) {
		if (s[i] == '6') s[i] = '9';
		else if (s[i] == '9') s[i] = '6';
	}
	cout << s;
}

signed main() {

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

	fastIO

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

	for (int tt = 1; tt <= t; tt++) {
		solve();
	}
}

#include<iostream>
#include<vector>
#include<string>
#include<algorithm>
#include<math.h>
#define ll long long
using namespace std;
int main()
{
	string s;
	cin>>s;
	if(s[0]==s[1]&&s[1]==s[2])
	cout<<"Won"<<endl;
	else
	{
		cout<<"Lost"<<endl;
	}

}


#include<bits/stdc++.h>
// #include<atcoder/all>
// #include<boost/multiprecision/cpp_int.hpp>

using namespace std;
// using namespace atcoder;
// using bint = boost::multiprecision::cpp_int;
using ll = long long;
using ull = unsigned long long;
using P = pair<int,int>;
#define rep(i,n) for(ll i = 0;i < (ll)n;i++)
#define ALL(x) (x).begin(),(x).end()
#define MOD 1000000007

// 2020/12/06 rechecked
long long modpow(long long n,long long r,const int mod = 1000000007){
  long long res = 1;
  while(r){
    if(r & 1)res = res*n%mod;
    n = n*n%mod;
    r >>= 1;
  }
  return res;
}

int main(){

  ll n,p;
  cin >> n >> p;
  cout << (p-1)*modpow(p-2,n-1)%MOD << "\n";

  return 0;
}

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

#define ff first
#define ss second
#define PI acos(-1)
#define pb push_back
#define int long long
#define ld long double
#define sp fixed<<setprecision
#define bp __builtin_popcountll
#define all(x) x.begin(),x.end()
#define pii pair<long long,long long>
#define FAST ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);

const int M = (1e9)+7;
const int N = 400005;
const int INF = 1e12;

int mpower(int x, int y)
{
    int res = 1;
    while(y)
    {
        if(y&1) res *= x, res %= M;
        y = y/2;
        x = x*x, x %= M;
    }
    return res;
}

signed main()
{
    FAST
    int tc=1;
    // cin>>tc;
    for(int ti=1;ti<=tc;ti++)
    {
        int n,p;
        cin>>n>>p;
        int ans = (p-1)%M;
        ans *= mpower(p-2, n-1);
        ans %= M;
        cout<<ans<<endl;
    }
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
#define mod 1000000007
main()
{
      ll x,y,a,b,ans=0;
      cin>>x>>y>>a>>b;
      while(1)
      {
          if(x>=1e9)
          {
              break;
          }
          else
          {
              if((a-1)*x<b)
              {
                  x=x*a;
              }
              else
              {
                  break;
              }
          }
          if(x<y)
          {
              ans++;
          }
          else
          {
              break;
          }
      }
      ans+=(y-1-x)/b;
      cout<<ans<<endl;
}

#include<bits/stdc++.h>
#include<vector>
#include<map>
#include<unordered_set>
#include<set>
using namespace std;
#define flush
#define pb push_back
#define ed endl
#define cout1(a) cout<<a
#define cout2(a,b) cout<<a<<b
#define cout3(a,b,c) cout<<a<<b<<c
#define ll long long
#define ld long double
#define db double
#define ull unsigned long long
#define mk make_pair
#define pll pair<ll,ll>
#define pldb pair<ldb,ldb>
#define ff first
#define ss second
#define vull vector<ull>
#define ub upper_bound
#define lb lower_bound
#define sorts(v) sort(v.begin(),v.end())
#define sortg(v) sort(v.begin(),v.end(),greater<ll>())
#define vll vector<ll>//vll v; means vector<long long>v;
#define vb vector<bool>
#define vldb vector<ldb>
#define vpll vector<pll>
#define vpldb vector<pldb>
#define pqmin priority_qrueue<ll,vector<ll>,greater<ll>>  //minheap
#define pq priority_qrueue<ll> //maxheap
#define pqrpll priority_qrueue<pll>//pqr with pairs
#define mll map<long,long>
#define mldb map<ldb,ldb>
#define umll unordered_map<ll>
#define sll set<ll>
#define usll unordered_set<ll>
#define ppc(x) __builtin_popcount(x)
#define pp(x) __builtin_parity(x)
#define ppll(x) __builtin_parityll(x)
#define clz(x) __builtin_clz(x)
#define ctz(x) __builtin_ctz(x)
#define clzll(x) __builtin_clzll(x)
#define ctzll(x) __builtin_ctzll(x)
#define ppcll(x) __builtin_popcountll(x)
#define maxx 1e9+7
#define minn -(1e9+7)
ll mod=1000000000+7;
ll inf=1e17;
 //memset(dp, -1, sizeof dp);
//1<log(n)<sqrrt(n)<n<nlog(n)<n^2<n^3<........<2^n<3^n.....<n^n
/* n<=22    O((2^n)*n)                                           //__gcd(a,b) gives gcd of two numbers
n<=100   O(n^4)
n<=400  O(n^3)                                                //no of digits=floor(log10(n))+1;
n<=2000  O(n^2logn)
n<=10^4   O(n^2)                                              return(x&&(!(x&(x-)))); tell if x is power of 2;
n<=10^5or6 O(nlogn)                                           accumulate(v.begin(),v.end(),0);
n<=10^8    O(n),O(3.2*log(10)n),O(1)
n<=10^18   O(logn),O(1)

vector<int>::iterator it;
__lg(10)=3   to know
log(i)=log(i/2) + 1 recurrance relation to calculate the log value
log(10)=2.3059*log10(10)
log10(10)=1
cout<<setw(2)<<setfill('0')<<h<<':'<<setw(2)<<setfill('0')<<m<<ed;  set the feild width to 2 and default value is 0
*/
/*
NOTE-pow() funtion is not so precise

*/
const int N=1e5+5;
bool prime[N];

void solve()
{
int x,y,z;
cin>>x>>y>>z;
db val=(db)y/x;
int res=INT_MIN;
// cout<<val<<ed;
// cout<<res<<ed;
for(int i=0;i<1e6 + 5;i++)
{
if((db)i/z <val)
{
    if(i>res)
    {
      res=i;
    }
}
else
{
    break;
}
}
cout<<res<<ed;
}
int main()
{
ios::sync_with_stdio(false);
cin.tie(NULL);
// prime[1]=false;
// for(int i=0;i*i<=N;i++)
// {
//  for(int j=i*i;j<=N;j+=i)
//  {
//     prime[j]=true
//  }
// }

solve();
return(0);
}


    #include <bits/stdc++.h>
    using namespace std;
    #include <math.h>
    #include <iomanip>
    #include <cstdint>
    #include <string>
    #include <sstream>
    template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
    template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }
    #define rep(i,n) for (int i = 0; i < (n); ++i)
    typedef long long ll;
    using P=pair<ll,ll>;
    const int INF=1001001001;
    const int mod=998244353;

    vector<int>G[200005],r[200005];
    int in[200005],out[200005],depth[200005];
    int id;

    void dfs(int i,int d=0){
      in[i]=id++;
      depth[i]=d;
      for(int u:G[i]){dfs(u,d+1);}
      out[i]=id;
    }

    void solve(){
      int n;
      cin>>n;
      rep(i,n-1){
        int p;
        cin>>p;
        p--;
        G[p].push_back(i+1);
      }
      dfs(0);
      rep(i,n){r[depth[i]].push_back(in[i]);}
      rep(i,n){sort(r[i].begin(),r[i].end());}
      int Q;
      cin>>Q;
      rep(i,Q){
        int u,d;
        cin>>u>>d;
        u--;
        int ans=lower_bound(r[d].begin(),r[d].end(),out[u])-lower_bound(r[d].begin(),r[d].end(),in[u]);
        cout<<ans<<endl;
      }
    }
    int main(){
      ios_base::sync_with_stdio(false);
      cin.tie(NULL);
      solve();
      return 0;
    }

#include <bits/stdc++.h>

using namespace std;

const int O = 2e5 + 1;

vector <int> c, dp, g[O], Max;

int t = 1;

bool how_sort(int x, int y){
    return Max[x] < Max[y];
}

int dfs(int u, int par = 0){
    Max[u] = 0;
    for (int v : g[u]){
        if (v == par) continue;
        dp[v] = dp[u] + 1;
        Max[u] = max(Max[u], dfs(v, u) + 1);
    }
    return Max[u];
}

void dfs1(int u, int par = 0){
    c[u] = t;
    for (int v : g[u]){
        if (v == par) continue;
        t += 1;
        dfs1(v, u);
        t += 1;
    }
}

main(){
    ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);
    int n; cin >> n;
    c.resize(n + 1);
    dp.resize(n + 1);
    Max.resize(n + 1);
    for (int i = 1; i < n; ++ i){
        int u, v; cin >> u >> v;
        g[u].push_back(v);
        g[v].push_back(u);
    }
    dfs(1);
    int compare = 0;
    int root = 1;
    for (int i = 1; i <= n; ++ i){
        if (dp[i] > compare){
            compare = dp[i];
            root = i;
        }
    }
    dfs(root);
    for (int i = 1; i <= n; ++ i){
        sort(g[i].begin(), g[i].end(), how_sort);
    }
    dfs1(root);
    for (int i = 1; i <= n; ++ i) cout << c[i] << " ";
}
/***
10
1 2
2 3
2 4
4 5
5 6
6 7
6 8
8 10
8 9
**/


#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
#define all(x) (x).begin(),(x).end()
template<typename T1,typename T2> bool chmin(T1 &a,T2 b){if(a<=b)return 0; a=b; return 1;}
template<typename T1,typename T2> bool chmax(T1 &a,T2 b){if(a>=b)return 0; a=b; return 1;}
int dx[4]={0,1,0,-1}, dy[4]={1,0,-1,0};
long double eps = 1e-9;
long double pi = acos(-1);

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

    string s;
    cin>>s;
    int n = s.size();
    deque<char> q;
    bool f = false;
    for(int i=0;i<n;i++){
        if(s[i] == 'R')f^=1;
        else if(f)q.push_front(s[i]);
        else q.push_back(s[i]);
    }
    stack<char> ans;
    while(q.size()){
        char c = q.front();
        q.pop_front();
        if(ans.size() && ans.top()==c){
            ans.pop();
            continue;
        }
        ans.push(c);
    }
    string ret = "";
    while(ans.size()){
        ret += ans.top();
        ans.pop();
    }
    if(f==false && ret.size())reverse(all(ret));
    cout << ret << endl;
}

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

using namespace std;
using namespace chrono;

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

#define pb push_back
#define odd(x) ((x)&1)
#define even(x) (!odd(x))
#define all(v) (v).begin(),(v).end()
#define rep(i,n) for(auto i=0;i<n;++i)
#define FASTIO ios::sync_with_stdio(false);cin.tie(0);cout.tie(0);
#define TEST_CASE int tc;cin>>tc;while(tc--)
#define Clock high_resolution_clock::now()

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

#ifdef LOCAL
#define cerr cout
#else
#endif

#define TRACE

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

void __print(int x) {cerr << x;}
void __print(long x) {cerr << x;}
void __print(long long x) {cerr << x;}
void __print(unsigned x) {cerr << x;}
void __print(unsigned long x) {cerr << x;}
void __print(unsigned long long x) {cerr << x;}
void __print(float x) {cerr << x;}
void __print(double x) {cerr << x;}
void __print(long double x) {cerr << x;}
void __print(char x) {cerr << '\'' << x << '\'';}
void __print(const char *x) {cerr << '\"' << x << '\"';}
void __print(const string &x) {cerr << '\"' << x << '\"';}
void __print(bool x) {cerr << (x ? "true" : "false");}

template<typename T, typename V>
void __print(const pair<T, V> &x) {cerr << '{'; __print(x.first); cerr << ','; __print(x.second); cerr << '}';}
template<typename T>
void __print(const T &x) {int f = 0; cerr << '{'; for (auto &i: x) cerr << (f++ ? "," : ""), __print(i); cerr << "}";}
void _print() {cerr << "]\n";}
template <typename T, typename... V>
void _print(T t, V... v) {__print(t); if (sizeof...(v)) cerr << ", "; _print(v...);}
#ifndef ONLINE_JUDGE
#define debug(x...) cerr << "[" << #x << "] = ["; _print(x)
#else
#define debug(x...)
#endif
// #define TIME

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

const ll inf = 2e18;
const ll mod = 998244353;
const ll N = 5e3+3;

int main()
{
    auto start_time = Clock;
    FASTIO

    string s;
    cin >> s;

    int n = s.size();
    deque<char> ans;
    bool f = 0;
    rep(i,n) {
        if(s[i] == 'R') {
            f ^= 1;
            continue;
        }
        if(f) {
            if(ans.empty() || ans.front() != s[i])
                ans.push_front(s[i]);
            else
                ans.pop_front();
        }
        else {
            if(ans.empty() || ans.back() != s[i])
                ans.pb(s[i]);
            else ans.pop_back();
        }
    }
    if(f) reverse(all(ans));
    for(auto i: ans) cout << i;
    cout << "\n";

    auto end_time = Clock;
    #ifndef TIME
        return 0;
    #endif
    cout << "\nTime elapsed: "
    << (double)duration_cast<milliseconds>(end_time-start_time).count()
    << "ms";

    return 0;
}


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

// a^n (mod.MOD)を求める。計算量はO(logn)
ll modpow(ll a, ll n, ll MOD = mod) {
    if(n == 0) {
        return 1;
    }
    if(n%2 == 1) {
        return (a * modpow(a, n-1, MOD))%MOD;
    }
    return (modpow(a, n/2, MOD) * modpow(a, n/2, MOD))%MOD;
}

// nCrをO(r)で求める。
ll Comb(ll n, ll r) {
    if(n < r) {
        return 0;
    }
    if(r > n-r) {
        return Comb(n, n-r);
    }
    ll Mul = 1;
    ll Div = 1;
    rep(i, r) {
        Mul *= (n-i);
        Div *= (i+1);
        Mul %= mod;
        Div %= mod;
    }
    ll res = Mul*modpow(Div, mod-2)%mod;
    return res;
}

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

    ll s = 0;
    rep(i, n) {
        ll a;
        cin >> a;
        s += a;
    }

    out(Comb(n+m, n+s));
    re0;
}

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

typedef pair<int, int> ii;

int V[400005];
vector<int> A;
vector<int> B;

int main(){
    int N;
    scanf("%d", &N);

    long long ans = 0;
    for(int i = 0; i < 2*N; i ++){
        scanf("%d", &V[i]);
        ans += V[i];
    }

    for(int i = 0; i < N; i ++){
        A.push_back(V[i]);
    }

    for(int i = N; i < 2*N; i ++){
        B.push_back(V[i]);
    }

    reverse(A.begin(), A.end());

    priority_queue<int, vector<int>, greater<int> > pq;

    for(int i = 0; i < N; i ++){
        pq.push(A[i]);
        pq.push(B[i]);

        assert(!pq.empty());
        ans -= pq.top();
        pq.pop();
    }

    printf("%lld\n", ans);
    return 0;
}


#include <bits/stdc++.h>
//#include <iostream>
//#include <vector>

using namespace std;

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

#include <bits/stdc++.h>
//#include <atcoder/all>
#define rep(i, n) for (int i=0; i < (n); i++)
using namespace std;
//using namespace atcoder;
typedef long long ll;
typedef unsigned int uint;
typedef unsigned long long ull;
typedef pair<int, int> P;
const int INF = 1 << 30;
const ll LINF = 1LL << 61;
const int NIL = -1;
const int MAX = 10000;
const int MOD = 1000000007;
const double pi = 3.141592653589;

double dp[110][110][110];

int main() {
    int a, b, c; cin >> a >> b >> c;
    dp[a][b][c] = 1;
    double ans = 0;
    for(int i=a;i<=100;i++){
        for(int j=b;j<=100;j++){
            for(int k=c;k<=100;k++){
                if(i==100 || j == 100 || k == 100){
                    int count = i+j+k -(a+b+c);
                    ans += dp[i][j][k]*count;
                    continue;
                }
                dp[i+1][j][k] += dp[i][j][k] * i/(i+j+k);
                dp[i][j+1][k] += dp[i][j][k] * j/(j+i+k);
                dp[i][j][k+1] += dp[i][j][k] * k/(k+i+j);
            }
        }
    }
    /*double ans = 0;
    for(int j=b;j<100;j++){
        for(int k=c;k<100;k++){
            int count = 100-a + j-b + k-c;
            ans += dp[100][j][k] * count;
        }
    }
    for(int i=a;i<100;i++){
        for(int k=c;k<100;k++){
            int count = i-a + 100-b + k-c;
            ans += dp[i][100][k] * count;
        }
    }
    for(int i=a;i<100;i++){
        for(int j=b;j<100;j++){
            int count = i-a + j-b + 100-c;
            ans += dp[i][j][100] * count;
        }
    }*/
    cout << setprecision(15) << ans << endl;
    return 0;
}


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

vector<pair<ll, ll> > prime_factorize(ll n) {
    vector<pair<ll, ll> > res;
    for (ll i = 2; i*i <= n; i++) {
        if (n % i != 0) continue;
        ll ex = 0;
        while (n % i == 0) {
            ++ex;
            n /= i;
        }
        res.push_back({i, ex});
    }
    if (n != 1) res.push_back({n, 1});
    return res;
}

int modPow(ll a, ll n, ll p) {
    if (n == 0) return 1;
    if (n == 1) return a % p;
    if (n % 2 == 1) return (a * modPow(a, n - 1, p)) % p;
    ll t = modPow(a, n / 2, p);
    return (t * t) % p;
}

int main() {
    long double x, y, r;
    cin >> x >> y >> r;
    r += 1e-14;
    ll low = ceil(x-r), high = floor(x+r);
    ll ans = 0;
    for (ll i = low-2; i < high+2; i++) {
        if (pow(r,2)-pow((x-(long double)i),2) < 0.0) continue;
        long double p = sqrt(pow(r,2)-pow((x-(long double)i),2));
        ll bt = (ll)ceil(y-p), tp = (ll)floor(y+p);
        ans+=(tp+1-bt);
    }
    cout << ans << endl;
    return 0;
}

#include <iostream>
#include <iomanip>
#include <algorithm>
#include <vector>
#include <set>
#include <map>
#include <math.h>
#include <string>
#include <numeric>
#include <queue>
#include <cstdio>
#include <cstring>
#define ll long long
#define rep(i,n) for(ll i=0;i<n;++i)
#define rep1(i,n) for(ll i=1;i<n;++i)
#define mrep(i,n) for(ll i=n;i>=0;--i)
#define all(a) (a).begin(),(a).end()
#define vl vector<ll>
#define vvl vector<vector<ll> >
#define vb vector<bool>
#define vvb vector<vector<bool> >
#define pl pair<ll,ll>
#define inf 1001001001001001000
#define mod 1000000007
//#define mod 998244353
#define pi 3.1415926535
using namespace std;
struct __INIT{
    __INIT(){
        cin.tie(0);
        ios::sync_with_stdio(false);
        cout<<fixed<<setprecision(15);
    }
}__init;

ll gcd(ll a,ll b){
    if(a<b) return gcd(b,a);
    ll r;
    while((r=a%b)){
        a = b;
        b = r;
    }
    return b;
}

//necessary gcd
ll gcds(vl a){
    ll ret = a[0];
    rep1(i,a.size()){
        ret = gcd(ret,a[i]);
    }
    return ret;
}

int main(){
    ll n;
    cin>>n;
    vl a(n);
    rep(i,n) cin>>a[i];
    cout<<gcds(a)<<endl;
}


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

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

const int CM = 1 << 17, CL = 12;
char cn[CM + CL], * ci = cn + CM + CL, * owa = cn + CM, ct;
const ll ma0 = 1157442765409226768;
const ll ma1 = 1085102592571150095;
const ll ma2 = 71777214294589695;
const ll ma3 = 281470681808895;
const ll ma4 = 4294967295;
inline int getint() {
	if (ci - owa > 0) {
		memcpy(cn, owa, CL);
		ci -= CM;
		fread(cn + CL, 1, CM, stdin);
	}
	ll tmp = *(ll*)ci;
	if ((tmp & ma0) ^ ma0) {
		int dig = 68 - __builtin_ctzll((tmp & ma0) ^ ma0);
		tmp = tmp << dig & ma1;
		tmp = tmp * 10 + (tmp >> 8) & ma2;
		tmp = tmp * 100 + (tmp >> 16) & ma3;
		tmp = tmp * 10000 + (tmp >> 32) & ma4;
		ci += (72 - dig >> 3);
	}
	else {
		tmp = tmp & ma1;
		tmp = tmp * 10 + (tmp >> 8) & ma2;
		tmp = tmp * 100 + (tmp >> 16) & ma3;
		tmp = tmp * 10000 + (tmp >> 32) & ma4;
		ci += 8;
		if ((ct = *ci++) >= '0') {
			tmp = tmp * 10 + ct - '0';
			if (*ci++ == '0') {
				tmp = tmp * 10;
				ci++;
			}
		}
	}
	return tmp;
}

const int MAX = 100000;
class shuturyoku_unko {
public:
	char C[MAX * 5];
	constexpr shuturyoku_unko() : C() {
		rep(i, MAX) {
			int X = i;
			rep(j, 5) {
				C[i * 5 + 4 - j] = '0' + X % 10;
				X /= 10;
			}
		}
	}
};
constexpr shuturyoku_unko f;
const int dm = 1 << 17;
char dn[dm], * di = dn, * owad = dn + dm - 20;
void putint(ll A) {
	if (owad < di) {
		fwrite(dn, 1, di - dn, stdout);
		di = dn;
	}
	int dig = 1;
	if (A >= 100000) {
		if (A >= 1000000000) dig = 5;
		else if (A >= 100000000) dig = 4;
		else if (A >= 10000000) dig = 3;
		else if (A >= 1000000) dig = 2;
		memcpy(di + dig, f.C + A % 100000 * 5, 5);
		A /= 100000;
		memcpy(di, f.C + A * 5 + 5 - dig, dig);
		di += 5 + dig;
	}
	else {
		if (A >= 10000) dig = 5;
		else if (A >= 1000) dig = 4;
		else if (A >= 100) dig = 3;
		else if (A >= 10) dig = 2;
		memcpy(di, f.C + A * 5 + 5 - dig, dig);
		di += dig;
	}
	*di++ = '\n';
}
const int mod = 1e9 + 7;

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

	int T = getint();
	rep(t, T) {
		ll N = getint(), A = getint(), B = getint();

		ll a = min(A, N - B + 1);
		ll b = min(A + B - 1, N - B + 1);

		ll are = (a + b) * (b - a + 1) + b * (N - A + 1 - (b - a + 1) * 2);
		ll atti = (N - A + 1) * (N - B + 1);

		ll kotae = (atti + are) % mod * ((atti - are) % mod) % mod;
		putint(kotae);
	}
	fwrite(dn, 1, di - dn, stdout);

	Would you please return 0;
}

#include <stdio.h>
#define _USE_MATH_DEFINES
#include <math.h>
#include <vector>
#include <algorithm>
//#include <atcoder/All>

using namespace std;
//using namespase atcoder;

int main(){
    const long nPrime = 1000000007;
    int t;
    scanf("%d", &t);
    for(int iCount = 0; iCount < t; iCount++){
        long n,a,b;
        scanf("%ld %ld %ld", &n, &a, &b);
        if(a+b > n){
            printf("0\n");
            continue;
        }
        if(a < b){
            swap(a,b);
        }
        long k = (n-a-b+1) * (n-a-b+2) / 2;
        k %= nPrime;
        long nAns = k * (n-b+1);
        nAns %= nPrime;
        nAns *= (n-a+1);
        nAns %= nPrime;
        nAns *= 4;
        nAns %= nPrime;
        nAns -= (k*k*4);
        nAns %= nPrime;
        if(nAns < 0){
            nAns += nPrime;
        }
        printf("%ld\n", nAns);
    }

    return 0;
}


/**
 *    author:  pankaj_m05
 *    created: 06.02.2021 17:35:00
**/
#include<bits/stdc++.h>

using namespace std;

int main(void) {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);
  int v, t, s, d;
  cin >> v >> t >> s >> d;
  if (d < v * t || d > v * s) {
    cout << "Yes";
  } else {
    cout << "No";
  }
  return 0;
}

#include <iostream>
#include <fstream>
#include <set>
#include <map>
#include <string>
#include <vector>
#include <queue>
#include <deque>
#include <stack>
#include <functional>
#include <algorithm>
#include <climits>
#include <cmath>
#include <iomanip>
using namespace std;
#define ll long long int
#define rep(i,n) for( int i = 0; i < n; i++ )
#define rrep(i,n) for( int i = n; i >= 0; i-- )
#define REP(i,s,t) for( int i = s; i <= t; i++ )
#define RREP(i,s,t) for( int i = s; i >= t; i-- )
#define dump(x)  cerr << #x << " = " << (x) << endl;
#define INF 2000000000
#define mod 1000000007
#define INF2 1000000000000000000

int main(void)
{
    cin.tie(0);
    ios::sync_with_stdio(false);
    int V, S, T, D;
    cin >> V >> S >> T >> D;
    int L = V * S;
    int R = V * T;
    if(L <= D && D <= R) {
        cout << "No" << endl;
    } else {
        cout << "Yes" << endl;
    }

    return 0;
}


/*************************************************************************
    > File Name: F.cpp
    > Author: Bran
    > Mail: 1811161330@qq.com
    > Created Time: 2020/12/19 23:11:30
 ************************************************************************/

#include <bits/stdc++.h>

#define all(x) x.begin(), x.end()
#define fr first
#define sc second
#define rep(i,x,n) for (int i = x; i < n; ++i)

using namespace std;
using LL = long long;
const int INF = 0x3f3f3f3f;
const int mod = 1e9 + 7;

struct segtree {
        int size;
        vector<int> sums;

        void init(int n) {
                size = 1;
                while (size < n) size <<= 1;
                sums.assign(2 * size, 0);
        }

        void build(vector<int>& a, int cur, int l, int r) {
                if (l + 1 == r) {
                        if (l < a.size()) sums[cur] = a[l];
                        return ;
                }

                int m = (l + r) / 2;
                build(a, cur * 2 + 1, l, m);
                build(a, cur * 2 + 2, m, r);
                sums[cur] = sums[cur * 2 + 1] ^ sums[cur * 2 + 2];
        }

        void build(vector<int>& a) {
                build(a, 0, 0, size);
        }

        void set(int i, int val, int cur, int l, int r) {
                if (l + 1 == r) {
                        sums[cur] ^= val;
                        return ;
                }

                int m = (l + r) / 2;
                if (i < m) set(i, val, cur * 2 + 1, l, m);
                else set(i, val, cur * 2 + 2, m, r);
                sums[cur] = sums[cur * 2 + 1] ^ sums[cur * 2 + 2];
        }

        void set(int i, int val) {
                set(i, val, 0, 0, size);
        }

        int query(int a, int b, int cur, int l, int r) {
                if (r <= a || l >= b) return 0;
                if (l >= a && r <= b) return sums[cur];

                int m = (l + r) / 2;
                return query(a, b, cur * 2 + 1, l, m) ^ query(a, b, cur * 2 + 2, m, r);
        }

        int query(int a, int b) {
                return query(a, b, 0, 0, size);
        }
}st;

void solve() {
        int n, q;
        scanf("%d%d", &n, &q);
        vector<int> a(n);
        rep(i, 0, n) scanf("%d", &a[i]);
        st.init(n);
        st.build(a);
        rep(i, 0, q) {
                int t, b, c;
                scanf("%d%d%d", &t, &b, &c);
                if (t == 1) st.set(b - 1, c);
                else printf("%d\n", st.query(b - 1, c));
        }
}

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

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

using namespace std;
//using namespace atcoder;

//https://algo-logic.info/segment-tree/#toc_id_3_2
template <typename X>
struct SegTree {
    using FX = function<X(X, X)>; // X•X -> X となる関数の型
    int n;
    FX fx;
    const X ex;
    vector<X> dat;
    SegTree(int n_, FX fx_, X ex_) : n(), fx(fx_), ex(ex_), dat(n_ * 4, ex_) {
        int x = 1;
        while (n_ > x) {
            x *= 2;
        }
        n = x;
    }
    void set(int i, X x) { dat[i + n - 1] = x; }
    void build() {
        for (int k = n - 2; k >= 0; k--) dat[k] = fx(dat[2 * k + 1], dat[2 * k + 2]);
    }
    void update(int i, X x) {
        i += n - 1;
        dat[i] = x;
        while (i > 0) {
            i = (i - 1) / 2;  // parent
            dat[i] = fx(dat[i * 2 + 1], dat[i * 2 + 2]);
        }
    }
    X query(int a, int b) { return query_sub(a, b, 0, 0, n); }
    X query_sub(int a, int b, int k, int l, int r) {
        if (r <= a || b <= l) {
            return ex;
        } else if (a <= l && r <= b) {
            return dat[k];
        } else {
            X vl = query_sub(a, b, k * 2 + 1, l, (l + r) / 2);
            X vr = query_sub(a, b, k * 2 + 2, (l + r) / 2, r);
            return fx(vl, vr);
        }
    }
};

int main(){
    int N,Q;
    cin>>N>>Q;
    auto fx = [](int x1, int x2) -> int { return x1^x2; };
    int ex = 0;
    SegTree<int> rmq(N+5, fx, ex);

    for(int i=1;i<=N;i++){
        int A;
        cin>>A;
        rmq.update(i,A);
    }

    for(int i=0;i<Q;i++){
        int T,X,Y;
        cin>>T>>X>>Y;
        if(T==1){
            rmq.update(X,rmq.query(X,X+1)^Y);
        }
        else{
            cout<<rmq.query(X,Y+1)<<endl;
        }
    }
}


#include<bits/stdc++.h>
#define ll long long
#define N 200005
using namespace std;
int read() {
	int x=0,f=1;char c=getchar();
	while(c<'0'||c>'9'){if(c=='-')f=-1;c=getchar();}
	while('0'<=c&&c<='9'){x=x*10+c-'0';c=getchar();}
	return x*f;
}
int n,m,K,cnt,h[N],c[N],fp[N];
struct Edge {
	int to,next;
}a[N*2];
void Add(int x,int y) {
	cnt++;a[cnt].to = y;a[cnt].next = h[x];h[x] = cnt;
}
bool vst[N];
int ind,ans = 0;
#define inf 0x7fffffff/2
queue<int>q;
int d[20][N],inq[N];
void bfs(int id) {
	for(int i=1; i<=n; ++i)d[id][i] = inf;
	q.push(c[id]);d[id][c[id]] = 0;
	inq[c[id]] = 1;
	while(!q.empty()) {
		int x = q.front();q.pop();
		for(int i=h[x]; i; i=a[i].next) {
			int y = a[i].to;
			if(!inq[y])d[id][y] = d[id][x]+1,q.push(y),inq[y] = 1;
		}
	}
	memset(inq,0,sizeof(inq));
}
int sta,f[1<<17][18];;
void deal() {
	for(int i=1; i<=K; ++i)bfs(i);
//	for(int i=1; i<=K; ++i){
//
//		for(int j=1; j<=n; ++j)
//		cout << d[i][j] << ' ';
//		cout << '\n';
//	}
	memset(f,0x3f,sizeof(f));
	for(int i=1; i<=K; ++i)f[1<<i-1][i] = 0;
	for(int i=0;i<(1<<K);i++)
	{
		for(int j=1;j<=K;j++)
		{
			if(f[i][j]>1e9)continue;
			for(int t=1;t<=K;t++)
			{
				if(i&(1<<t-1))continue;
				f[i+(1<<t-1)][t]=min(f[i+(1<<t-1)][t],f[i][j]+d[j][c[t]]);
			}
		}
	}

	for(int j=1;j<=K;j++)
	{
		ans=min(ans,f[(1<<K)-1][j]);
	}

}
int main() {
	n = read();m = read();
	for(int i=1; i<=m; ++i) {
		int x = read(),y = read();
		Add(x,y);Add(y,x);
	}
	K = read();sta = 0;
	for(int i=1; i<=K; ++i) {
		sta |= 1<<i-1;
	}
	ans = inf;
	for(int i=1; i<=K; ++i)c[i] = read(),fp[c[i]] = i-1;
	deal();
	if(ans >= 1e9)puts("-1");
	else cout << ans+1;
}

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

void chmin(int& x, int y) { x = min(x,y);}

int main() {
  int n, m;
  cin >> n >> m;
  vector<vector<int>> to(n);
  rep(i,m) {
    int a, b;
    cin >> a >> b;
    --a; --b;
    to[a].push_back(b);
    to[b].push_back(a);
  }
  int k;
  cin >> k;
  vector<int> c(k);
  rep(i,k) {
    cin >> c[i];
    c[i]--;
  }
  vector<vector<int>> dist(k,vector<int>(k));

  const int INF = 1001001001;
  auto bfs = [&](int sv) {
    vector<int> dist(n, INF);
    queue<int> q;
    dist[sv] = 0;
    q.push(sv);
    while (!q.empty()) {
      int v = q.front(); q.pop();
      for (int u : to[v]) {
        if (dist[u] != INF) continue;
        dist[u] = dist[v]+1;
        q.push(u);
      }
    }
    return dist;
  };
  rep(i,k) {
    vector<int> d = bfs(c[i]);
    rep(j,k) dist[i][j] = d[c[j]];
  }

  int k2 = 1<<k;
  vector<vector<int> > dp(k2, vector<int>(k, INF));
  rep(i,k) dp[1<<i][i] = 1;
  rep(s,k2)rep(i,k) {
    if (~s>>i&1) continue;
    rep(j,k) {
      if (s>>j&1) continue;
      chmin(dp[s|1<<j][j], dp[s][i]+dist[i][j]);
    }
  }
  int ans = INF;
  rep(i,k) chmin(ans, dp[k2-1][i]);
  if (ans == INF) cout << -1 << endl;
  else cout << ans << endl;
  return 0;
}


//x<<y=x*2^y,x>>y=x/2^y
//1e5+3 is prime
// in a matrix, all elements of a primary diagonal have constant diff of coordinates
// and a secondary diagonal has constant sum of coordinates
//use ll() for using an integer in self-built fn
//(x&-x) bitwise and of (x and its 2's complement) returns (last set bit)
//eg if x=1010 then it will return 0010
// careful dont print empty container(run time error)
//v.erase O(n)
//use ("\n") instead of endl as endl flushes the output buffer
//every time so takes more time than \n (TLE)
//stoll() and to_string((less than 1e19))
//INT_MAX is approx 3e10
//For sets use set_name.lower_bound(x)(strictly O(logn))
//NOT lb(all(s),x)(O(logn) for random access (eg vector) but for sets it is O(n));
#include<bits/stdc++.h>
typedef long long int ll;
#define ull unsigned long long int
#define lld long double
#define endl "\n"
#define fi first
#define sec second
#define sp setprecision
#define lb lower_bound
#define ub upper_bound
#define For(i, a, b) for(long long int i = (a); i <= (b); i++)
#define Forr(i, a, b) for(long long int i = (a); i >= (b); i--)
#define pb push_back
#define mp(a,b) make_pair(a,b)
#define vll vector<ll>
#define pll pair<ll,ll>
#define vlld vector<lld>
#define vi vector<int>
#define vch vector<char>
#define sll set<ll>
#define sch set<ch>
#define vpll vector< pair<ll,ll> >
#define vpii vector< pair<int,int> >
#define all(v) v.begin(),v.end()
#define rall(v) v.rbegin(),v.rend()
#define mll map<ll, ll>
#define mcll map<char,ll>
#define sz(container) ll((container).size())
#define fill(a,b) memset(a, b, sizeof(a))
#define fast_io ios_base::sync_with_stdio(false),cin.tie(NULL),cout.tie(NULL)
using namespace std;
lld pi=3.1415926535897932;
const ll mod=1000000007;
const ll dx[4]={-1, 0, 1, 0} , dy[4]={0, 1, 0, -1};
const ll dxx[8]={-1, -1, 0, 1, 1, 1, 0, -1} , dyy[8]={0, 1, 1, 1, 0, -1, -1, -1};
string ds="RLDU";
/***************************************
struct cmp
{
    bool operator() (const pll &a, const pll &b)  const
    {
        ll lena = a.sec - a.fi + 1;
        ll lenb = b.sec - b.fi + 1;
        if (lena == lenb) return a.fi < b.fi;
        return lena > lenb;
    }
};
********************************/

ll lcm(ll a, ll b)
{
    ll g=__gcd(a, b);
    return a/g*b;
}

ll binpow(ll a, ll b,ll m)
{
    a %= m;
    ll res = 1;
    while (b > 0)
    {
        if (b & 1)
            res = res * a % m;
        a = a * a % m;
        b >>= 1;
    }
    return res;
}
ll modinv(ll n)
{
    return binpow(n, mod - 2,mod);
}

/**************coding****************************************/
int main()
{
    #ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
    #endif
    fast_io;
    ll T=1;//cin>>T;
    For(i,1,T)
    {
        ll n;cin>>n;
        char caa,cab,cba,cbb;cin>>caa>>cab>>cba>>cbb;
        ll fib[n+1]={};
        fib[1]=2;fib[0]=1;
        For(j,2,n) fib[j]=(fib[j-1]+fib[j-2])%mod;
        if(cab=='B')
        {
            if(cab==cbb||n<4)
            {
                cout<<1;return 0;
            }
            if(cbb==cba)
            {
                cout<<binpow(2,n-3,mod);return 0;
            }
            if(cba=cab)
            {
                cout<<fib[n-3];
            }
        }
        else
        {
            if(cab==caa||n<4)
            {
                cout<<1;return 0;
            }
            if(caa==cba)
            {
                cout<<binpow(2,n-3,mod);return 0;
            }
            if(cba=cab)
            {
                cout<<fib[n-3];
            }
        }
    }
}

#include <bits/stdc++.h>
using namespace std;
#define rep(i,n)for(int i=0;i<(n);i++)
#define ALL(a) (a).begin(), (a).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define pb push_back
#define int ll
using ll = long long;
using P = pair<int, int>;
using int128 = __int128_t;//cin coutはできない

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

    mint inv() const {
        return pow(mod - 2);
    }
    mint& operator/=(const mint a) {
        return (*this) *= a.inv();
    }
    mint operator/(const mint a) const {
        mint res(*this);
        return res /= a;
    }
};
istream& operator>>(istream& is, mint& a) { return is >> a.x;}
ostream& operator<<(ostream& os, const mint& a) { return os << a.x;}

struct UnionFind {
    //vector d
    //親のノードを記録する
    //親の場合は-(木の要素数)を記録する
    vector<int> d;
    UnionFind(int n = 0) : d(n, -1) {} //constructor
    int find(int x){
        //find root
        if(d[x] < 0){
            return x;
        }
        return d[x] = find(d[x]);
    }
    bool unite(int x, int y){
        x = find(x);
        y = find(y);
        if(x == y)
            return false;
        //xの木の方が、yの木よりも小さくないといけない
        if(-d[x] > -d[y]){
            swap(x, y);
        }
        d[x] += d[y];//yの木の要素数をxの木の要素数に合算する
        d[y] = x;//yの親をxにする
        return true;
    }
    bool same(int x, int y){
        return find(x) == find(y);
    }
    int size(int x){
        return -d[x];
    }
};

signed main(){
    int n, k;
    cin >> n >> k;
    vector<vector<int>> a(n, vector<int>(n));
    rep(i,n)rep(j,n) cin >> a[i][j];
    UnionFind ufx(n), ufy(n);
    for(int x = 0; x < n - 1; x++){
        for(int y = x+1; y < n ; y++){
            bool isOK = true;
            for(int i = 0; i < n; i++){
                if(a[i][x] + a[i][y] > k) isOK = false;
            }
            if(isOK) ufx.unite(x, y);
        }
    }
    for(int x = 0; x < n - 1; x++){
        for(int y = x+1; y < n ; y++){
            bool isOK = true;
            for(int i = 0; i < n; i++){
                if(a[x][i] + a[y][i] > k) isOK = false;
            }
            if(isOK) ufy.unite(x, y);
        }
    }
    vector<mint> fact(n+1);
    fact[0] = 1;
    rep(i,n) fact[i+1] = fact[i] * (i+1);
    mint ans = 1;
    rep(i,n){
        if(ufx.find(i) == i) ans *= fact[ufx.size(i)];
    }
    rep(i,n){
        if(ufy.find(i) == i) ans *= fact[ufy.size(i)];
    }
    cout << ans << endl;
}


#include <bits/stdc++.h>

using namespace std;

//basic input and data type
#define ll long long
#define loop(a,b) for(ll int i=a;i<b;i++)
#define si(x) scanf("%d",&x)
#define sl(x) scanf("%lld",&x)
#define ss(s) scanf("%s",s)
#define pi(x) printf("%d\n",x)
#define pl(x) printf("%lld\n",x)
#define ps(s) printf("%s\n",s)

//debugging
#define deb(x) cout << #x << "=" << x << endl
#define deb2(x, y) cout << #x << "=" << x << "," << #y << "=" << y << endl

//vector functions
#define pb push_back
#define mp make_pair
#define F first
#define S second
typedef pair<int, int>pii;
typedef pair<ll, ll>pl;
typedef vector<int>vi;
typedef vector<ll>vl;
typedef vector<pii>vpii;
typedef vector<pl>vpl;
typedef vector<vi>vvi;
typedef vector<vl>vvl;
// solution

void solve()
{
    string s;
    cin>>s;
    ll int cnt=0;
    ll int i;
    for(i=0;i<s.size();i++)
    {
        if(i+3<s.size()&&s[i]=='Z'&&s[i+1]=='O'&&s[i+2]=='N'&&s[i+3]=='e')
        {
            cnt++;
            i=i+3;
        }
    }
    cout<<cnt<<endl;
}

//main function
int main()
{
    ll int t=1;
    //sl(t);
    while(t--)
    {
        solve();
    }

   return(0);
}

#include<bits/stdc++.h>
using namespace std;
int const maxn=2e5+10;
int noded=0,tot,cou,son[maxn],head[maxn],n,m,deep[maxn],fa[maxn],ans[maxn];
struct edge{
    int v,nxt;
}e[maxn<<1];
void build(int x,int y){
    e[++tot].v=y;
    e[tot].nxt=head[x];
    head[x]=tot;
}
void getans(int x){
	ans[x]=++cou;
	for(int i=head[x];i;i=e[i].nxt){
        int v=e[i].v;
        if(v==fa[x]||v==son[x])continue;
        getans(v);
        ++cou;
    }
    if(son[x])getans(son[x]);
}
void dfs(int x,int f,int d){
	deep[x]=d;
	fa[x]=f;
	if(deep[noded]<=d){
		noded=x;
	}
	for(int i=head[x];i;i=e[i].nxt){
        int v=e[i].v;
        if(v==f)continue;
        dfs(v,x,d+1);
    }
}
int main(){
    scanf("%d",&n);
    tot=0,cou=0;
    int a,b;
    for(int i=1;i<n;i++){
        scanf("%d%d",&a,&b);
        build(a,b);
        build(b,a);
    }
    dfs(1,0,0);
    int s=noded;
    dfs(s,0,0);
    // cout<<s<<' '<<noded<<endl;
    for(int i=noded;i;i=fa[i]){
    	son[fa[i]]=i;
    }
    getans(s);
    for(int i=1;i<n;i++)printf("%d ",ans[i]);
    printf("%d\n",ans[n]);
    return 0;
}
/*
10
1 2
2 3
3 5
2 4
1 6
1 7
7 8
8 9
7 10
*/


#include "bits/stdc++.h"

using namespace std;
typedef long long ll;
ll num[200100];
int mi = 100099;
bool cmp(int a,int b){
    return a > b;
};
int main() {
//    ios::sync_with_stdio(0);
//    freopen("in.txt", "r", stdin);
//    freopen("out.txt", "w", stdout);
//    memset(s1, 0, sizeof(s1));
//    memset(s2, 0, sizeof(s2));
    int n;
    cin >> n;
    for (int i = 1; i <= n; ++i) {
        cin >> num[i];
    }
    ll sum = 0;
    sort(num+1,num+1+n,cmp);
    ll ans= 0;
    sum = num[1];
    for (ll j = 2; j <= n; ++j) {
        ans += abs(sum - (j-1)*num[j]);
        sum += num[j];
    }
    cout << ans;

}

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

#ifdef LOCAL
#include "../debug.h"
#else
#define debug(x...) 141
#endif
#define forn(i,x,n) for(int i = x; i < n; ++i)
#define forit(it, m) for(auto it = m.begin(); it!=m.end(); ++it)
typedef long long ll;

int main(){
    ios::sync_with_stdio(0);
    cin.tie(0);
    int n;
    ll ans=0;
    cin>>n;
    vector<ll> a(n),sum(n+1);
    forn(i,0,n)
    	cin>>a[i];
    sort(a.begin(),a.end());
    forn(i,1,n+1)
    	sum[i]=sum[i-1]+a[i-1];
    forn(i,0,n)
    	ans+=sum[n]-sum[i+1]+(n-i-1)*(-a[i])+i*a[i]-sum[i];

    cout<<ans/2<<'\n';

    return 0;
}


#include<bits/stdc++.h>
using namespace std;
const int MAX = 3010;
bool dp[MAX][4][32];

void init(){
  for(int i=0; i<MAX; i++){
    for(int j=0; j<4; j++){
      for(int k=0; k<32; k++){
        dp[i][j][k] = false;
      }
    }
  }
  dp[0][0][0] = true;
}

int main(){
  int N;
  cin >> N;
  vector<vector<int>> vec(N,vector<int>(5));
  for(int i=0; i<N; i++){
    for(int j=0; j<5; j++){
      cin >> vec[i][j];
    }
  }
  int ok = 0;
  int ng = 1e9+10;
  while(ng - ok > 1){
    int mid = (ok+ng)/2;
    init();
    for(int i=0; i<N; i++){
      int B = 0;
      for(int j=0; j<5; j++){
        if(vec[i][j] >= mid){
          B = B | (1<<j);
        }
      }
      for(int j=0; j<4; j++){
        for(int k=0; k<32; k++){
          if(dp[i][j][k]){
            //使う
            if(j < 3){
              dp[i+1][j+1][k|B] = true;
            }
            //使わない
            dp[i+1][j][k] = true;
          }
        }
      }
    }
    if(dp[N][3][31]){
      ok = mid;
    }
    else{
      ng = mid;
    }
  }
  cout << ok << endl;
}

#include<bits/stdc++.h>
//#pragma GCC optimize "trapv"
//#include<ext/pb_ds/assoc_container.hpp>
//#include<ext/pb_ds/tree_policy.hpp>
#define fast_az_fuk      ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
#define ll               int
#define lll              __int128
#define ull              unsigned ll
#define ld               long double
#define pb               push_back
#define pf               push_front
#define dll              deque<ll>
#define vll              vector<ll>
#define vvll             vector<vll>
#define pll              pair<ll,ll>
#define vpll             vector<pll>
#define dpll             deque<pll>
#define mapll            map<ll,ll>
#define umapll           umap<ll,ll>
#define endl             "\n"
#define all(v)           v.begin(),v.end()
#define ms(a,x)          memset(a,x,sizeof(a))
#define random(l,r,T)    uniform_int_distribution<T>(l,r)(rng)

//#define ordered_set tree<ll, null_type,less<ll>, rb_tree_tag,tree_order_statistics_node_update>

using namespace std;

mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
//using namespace __gnu_pbds;

template<typename T> istream& operator >>(istream &in,vector<T> &v){ for(auto &x:v) in>>x; return in;}
template<typename T> ostream& operator <<(ostream &out,vector<T> &v){ for(auto &x:v) out<<x<<' '; return out;}
template<typename T1,typename T2> istream& operator >>(istream &in,pair<T1,T2> &p){ in>>p.first>>p.second; return in;}
template<typename T1,typename T2> ostream& operator <<(ostream &out,pair<T1,T2> &p){ out<<p.first<<' '<<p.second; return out;}
struct custom_hash {
    static uint64_t splitmix64(uint64_t x) {
        // http://xorshift.di.unimi.it/splitmix64.c
        x += 0x9e3779b97f4a7c15;
        x = (x ^ (x >> 30)) * 0xbf58476d1ce4e5b9;
        x = (x ^ (x >> 27)) * 0x94d049bb133111eb;
        return x ^ (x >> 31);
    }

    size_t operator()(uint64_t x) const {
        static const uint64_t FIXED_RANDOM = chrono::steady_clock::now().time_since_epoch().count();
        return splitmix64(x + FIXED_RANDOM);
    }
};
template<class T, class H>using umap=unordered_map<T,H,custom_hash>;
template<class T>using uset=unordered_set<T,custom_hash>;

int32_t main()
{
    clock_t clk = clock();
    fast_az_fuk
    ll n; cin>>n;  vvll v(n,vll(5,0)); cin>>v;
    ll l = 1,r = 1e9; ll ans;
    while(l <= r){
        ll p = (r + l) /2;
        vll mask(n,0);
        for(ll i=0;i<n;i++){
            for(ll j=0;j<5;j++) if(v[i][j] >= p) mask[i] += (1<<j);
        }
        const ll M = (1<<5)-1;
        vvll hash(n,vll(1<<5,0)); bool flag=0;
        for(ll i=0;i<n;i++){
            for(ll j=i+1;j<n;j++){
                hash[j][mask[j]|mask[i]]=1;
            }
        }
        for(ll i=1;i<n;i++){
            for(ll j=0;j<=M;j++){
                hash[i][j] |= (hash[i-1][j]);
            }
        }
        for(ll i=2;i<n;i++){
            ll msk = (mask[i]^M); stack<ll> st; st.push(msk);
            while(!st.empty()){
                msk = st.top(); st.pop();
                if(hash[i-1][msk]) {flag=1; break;}
                for(ll k=0;k<5;k++) if(!(msk&(1<<k))) {
                    msk^=(1<<k); st.push(msk); msk^=(1<<k);
                }
            }
        }
        if(flag) {
            ans = p; l = p+1;
        }
        else r = p-1;
    }
    cout<<ans;
    // cerr << '\n'<<"Time (in s): " << double(clock() - clk) * 1.0 / CLOCKS_PER_SEC << '\n';
    return 0;
}


#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp> // Common file
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
using namespace std;
#define ordered_set tree<ll, null_type,less<ll>, rb_tree_tag,tree_order_statistics_node_update>
#define MOD 1000000007
#define INF 1000000000
#define ff first
#define ss second
typedef long long ll;
ll power(ll a, ll b){//a^b
    ll res=1;
    a=a%MOD;
    while(b>0){
        if(b&1){res=(res*a)%MOD;b--;}
        a=(a*a)%MOD;
        b>>=1;
    }
    return res;
}
ll fermat_inv(ll y){return power(y,MOD-2);}
ll gcd(ll a, ll b){return (b==0)?a:gcd(b,a%b);}
int main(){
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    int t1=1;
    //cin>>t;
    while(t1--){
        int n,k;
        cin>>n>>k;
        string s;
        cin>>s;
        for(int j=0;j<k;j++){
            string t=s+s;
            s="";
            for(int i=0;i<2*n;i+=2){
                if(t[i]==t[i+1])
                    s+=t[i];
                else if((t[i]=='R'&&t[i+1]=='S')||(t[i]=='S'&&t[i+1]=='R'))
                    s+='R';
                else if((t[i]=='S'&&t[i+1]=='P')||(t[i]=='P'&&t[i+1]=='S'))
                    s+='S';
                else if((t[i]=='R'&&t[i+1]=='P')||(t[i]=='P'&&t[i+1]=='R'))
                    s+='P';
            }
        }
        cout<<s[0]<<"\n";
    }
    return 0;
}


#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for (int i = 0; i < n; ++i)
using ll = long long;
using P = pair<int,int>;
// auto mod int
const int mod = 1000000007;//998244353;
struct mint {
  ll x; // typedef long long ll;
  mint(ll x=0):x((x%mod+mod)%mod){}
  mint operator-() const { return mint(-x);}
  mint& operator+=(const mint a) {
    if ((x += a.x) >= mod) x -= mod;
    return *this;
  }
  mint& operator-=(const mint a) {
    if ((x += mod-a.x) >= mod) x -= mod;
    return *this;
  }
  mint& operator*=(const mint a) { (x *= a.x) %= mod; return *this;}
  mint operator+(const mint a) const { return mint(*this) += a;}
  mint operator-(const mint a) const { return mint(*this) -= a;}
  mint operator*(const mint a) const { return mint(*this) *= a;}
  mint pow(ll t) const {
    if (!t) return 1;
    mint a = pow(t>>1);
    a *= a;
    if (t&1) a *= *this;
    return a;
  }

  // for prime mod
  mint inv() const { return pow(mod-2);}
  mint& operator/=(const mint a) { return *this *= a.inv();}
  mint operator/(const mint a) const { return mint(*this) /= a;}
};
istream& operator>>(istream& is, const mint& a) { return is >> a.x;}
ostream& operator<<(ostream& os, const mint& a) { return os << a.x;}
ll dp1[2001][2001];
ll dp2[2001][2001];
int main() {
   int h,w;cin>>h>>w;
   vector<string> v;
   string last(w+1,'#');
   rep(i,h){
      string s;cin>>s;
      v.push_back(s);
      v[i].push_back('#');
   }
   int sum=0;
   rep(i,h)rep(j,w)sum+=(v[i][j]=='.');
   rep(i,h){
      rep(j,w){
         dp1[i][j]=dp2[i][j]=(v[i][j]=='.');
      }
   }
   rep(i,h){
      rep(j,w-1){
         if(v[i][j+1]=='.'&&v[i][j]=='.'){
            dp1[i][j+1]=dp1[i][j]+1;
         }
      }
   }
   rep(i,h){
      for (int j = w - 1; j > 0; j--)
      {
         if(v[i][j-1]=='.'&&v[i][j]=='.'){
            dp1[i][j-1]=dp1[i][j];
         }
      }
   }
   rep(j,w){
      rep(i,h-1){
            if(v[i+1][j]=='.'&&v[i][j]=='.'){
            dp2[i+1][j]=dp2[i][j]+1;
         }
      }
   }
   rep(j,w){
      for (int i = h-1; i > 0; i--)
      {
         if(v[i-1][j]=='.'&&v[i][j]=='.'){
            dp2[i-1][j]=dp2[i][j];
         }
      }
   }
   mint ans=0;
   mint two=2;
   rep(i,h){
      rep(j,w){
         if(v[i][j]=='.')
         ans+=(two.pow(dp1[i][j]+dp2[i][j]-1)-1)*two.pow(sum-dp1[i][j]-dp2[i][j]+1);
      }
   }
   cout<<ans<<endl;
}

/**
 * Written by : Ujjawal Pabreja [cuber_coder]
 * Email : ujjawalpabreja99@gmail.com
*/
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define ll long long
#define ld long double
#define endl "\n"
const int mod = 1e9 + 7;
const int MAX = 2e5 + 1;
ll power(ll x, ll p) {
    ll ans = 1;
    while (p) {
        if (p & 1) {
            ans = (ans * x) % mod;
            p--;
        }
        x = (x * x) % mod;
        p >>= 1;
    }
    return ans;
}
ll add(ll x, ll y) {
    return ((x % mod) + (y % mod)) % mod;
}
ll mul(ll x, ll y) {
    return ((x % mod) * (y % mod)) % mod;
}
ll sub(ll x, ll y) {
    return ((x % mod) - (y % mod) + mod) % mod;
}

void Solve() {
    ll n, m;
    cin >> n >> m;
    string s[n];
    ll tidy = 0;
    for (int i = 0; i < n; i++) {
        cin >> s[i];
        for (int j = 0; j < m; j++) {
            tidy += (s[i][j] == '.');
        }
    }
    vector <vector <ll>> a(n, vector <ll>(m));
    for (int j = 0; j < m; j++) {
        for (int i = 0; i < n; ) {
            if (s[i][j] == '#') {
                i++;
                continue;
            }
            int k = i + 1, len = 1;
            while (k < n and s[k][j] == '.') {
                len++;
                k++;
            }
            while (i < k) {
                a[i][j] = len;
                i++;
            }
        }
    }
    for (int i = 0; i < n; i++) {
        for (int j = 0; j < m;) {
            if (s[i][j] == '#') {
                j++;
                continue;
            }
            int k = j + 1, len = 1;
            while (k < m and s[i][k] == '.') {
                len++;
                k++;
            }
            while (j < k) {
                a[i][j] += len;
                j++;
            }
        }
    }
    // for (int i = 0; i < n; i++) {
    //     for (int j = 0; j < m; j++) {
    //         cout << a[i][j] << " ";
    //     }
    //     cout << endl;
    // }
    ll ans = 0;
    for (int i = 0; i < n; i++) {
        for (int j = 0; j < m; j++) {
            if (s[i][j] == '#') {
                continue;
            }
            ll tot = a[i][j] - 1;
            ll ways = sub(power(2, tot), 1);
            ans = add(ans, mul(ways, power(2, tidy - tot)));
        }
    }
    cout << ans;
}

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

    int testcases = 1;
    // cin >> testcases;

    while (testcases--) {
        Solve();
    }
}


#include <iostream>
#include <algorithm>
#include <string>
#include <complex>
#include <vector>
#include <set>
#include <cmath>
#include <queue>
#include <map>
#include <stack>
#include <bitset>
#include <numeric> //lcm
#include <iomanip> //double精度 setprecision

#include <chrono>
#include <random>
#include <cassert>

//#include <atcoder/all>

using namespace std;
//using namespace atcoder;

#define rep(i,n) for(int i = 0; i < (n); ++i)
#define rrep(i,n) for(int i = (n)-1; i >= 0; --i)
#define rep1(i,n) for(int i = 1; i <= (n); ++i)
#define rrep1(i,n) for(int i = (n); i >= 1; --i)
#define REP(i,n,m) for(int i = (n); i < (m); ++i)
#define all(vec) (vec).begin(),(vec).end()

#define debug(a) { cerr << #a << " = " << a << endl;}
#define debugV(vec) { cerr << #vec << " : "; for(auto v : vec) cerr << v << " "; cerr << endl; }
#define debug2D(vec2D, w) { cerr << #vec2D << endl;  for(auto vec : vec2D) { for (auto v : vec) cerr << setw(w) << v << " "; cerr << endl; } }
#define debugVP(vec) { cerr << #vec << " : ";  for(auto v : vec) cerr << "(" << v.first << "," << v.second << ") "; cerr << endl;}
#define debug2DP(vec2D) { cerr << #vec2D << endl;  for(auto vec : vec2D) { for (auto v : vec) cerr << "(" << v.first << "," << v.second << ") "; cerr << endl; } }

typedef long long ll;

constexpr ll INF = 1e14; //32 ~2*10^10 //64 ~9*10^19
//constexpr ll MOD = 998244353;
constexpr ll MOD = 1000000007;
const double EPS = round(1e-6);
const char en = '\n';

struct Edge {
	Edge(int _s, int _t, ll _cost = 1) : from(_s), to(_t), cost(_cost) {};
	int from, to;
	ll cost;
	//ll fee;
};

typedef vector<vector<Edge>> Graph;

void add_edge(Graph& g, int from, int to, ll cost = 1) {
	g[from].push_back(Edge(from, to, cost));
}

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

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

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

	ll ans = 0;
	auto f = [&](int a, int m) {
	  bool ok = true;
		while (a > 0) {
			if (a % m == 7) { ok = false; break;}
			a /= m;
		}
		return ok;
	};

	rep1(i, n) {
		if (f(i,10) && f(i,8)) ++ans;
	}
	cout << ans <<en;

}

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

	//rep(i,3)
	solve();

}

#include<bits/stdc++.h>
using namespace std;
#define ll long long
bool decimal(ll n)
{
    while(n)
    {
        int r=n%10;
        if(r==7)
        return true;
        n/=10;
    }
    return false;
}
bool octal(ll n)
{
    while(n)
    {
        int r=n%8;
        if(r==7)
        return true;
        n/=8;
    }
    return false;
}
int main()
{
        ll n;
        cin>>n;
        int a[n+1];
        memset(a,0,sizeof(a));

        for(int i=1;i<=n;i++){
          if(a[i]==0){
              if(decimal(i))
                  a[i]=1;
              else if(octal(i))
                  a[i]=1;
          }
        }
  		int ans = 0;
        for(int i=1;i<=n;i++)
        	if(a[i]==0)
        		ans++;
        cout<<ans<<endl;
        return 0;
}


#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<ll, ll> P;
const ll MOD = 1e9+7;
const ll INF = 1e18;
#define rep(i,m,n) for(ll i = (m); i <= (n); i++)
#define zep(i,m,n) for(ll i = (m); i < (n); i++)
#define rrep(i,m,n) for(ll i = (m); i >= (n); i--)
#define print(x) cout << (x) << endl;
#define printa(x,m,n) for(int i = (m); i <= n; i++){cout << (x[i]) << " ";} cout<<endl;

ll scnt[10], tcnt[10];

bool win(){
    ll a = 0;
    rep(i, 1, 9){
        a += i * pow(10, scnt[i]);
    }

    ll b = 0;
    rep(i, 1, 9){
        b += i * pow(10, tcnt[i]);
    }
    //cout << a << " " << b << endl;
    return a > b;
}

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

    ll k; cin >> k;
    string s, t; cin >> s >> t;

    vector<ll> cnt(10, k);
    zep(i, 0, 4){
        scnt[s[i] - '0']++;
        cnt[s[i] - '0']--;
    }

    zep(i, 0, 4){
        tcnt[t[i] - '0']++;
        cnt[t[i] - '0']--;
    }
    //printa(scnt, 1, 9)
    ll ans = 0;
    rep(i, 1, 9){
        if(cnt[i] > 0){
            ll x = cnt[i];
            cnt[i]--;
            scnt[i]++;
            rep(j, 1, 9){
                if(cnt[j] > 0){
                    ll tmp = x * cnt[j];
                    cnt[j]--;
                    tcnt[j]++;
                    //cout << i << " " << j << endl;
                    if(win())ans += tmp;
                    tcnt[j]--;
                    cnt[j]++;
                }
            }
            scnt[i]--;
            cnt[i]++;
        }
    }
    cout << fixed << setprecision(20) << double(ans) / ((9 * k - 8) * (9 * k - 9)) << endl;

    return 0;
}

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

using namespace std;
typedef long long ll;
typedef vector<ll> v;
typedef vector<vector<ll>> vv;

#define MOD 1000000007
#define INF 1001001001
#define MIN -1001001001
#define rep(i,k,N) for(int i=k;i<N;i++)
#define MP make_pair
#define MT make_tuple //tie,make_tuple は別物
#define PB push_back
#define PF push_front
#define all(x) (x).begin(),(x).end()

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

int main(){
    ll H,W,N,M;
    cin>>H>>W>>N>>M;
    v A(N),B(N);
    v C(M),D(M);
    vv ans_grid(H,v(W,0));
    rep(i,0,N){
        cin>>A[i]>>B[i];A[i]--;B[i]--;
        ans_grid[A[i]][B[i]] = 2;
    }
    rep(i,0,M){
        cin>>C[i]>>D[i];C[i]--;D[i]--;
        ans_grid[C[i]][D[i]] = -1;
    }

    rep(i,0,H){
        bool br = false;
        rep(j,0,W){
            if(ans_grid[i][j] == 2)br = true;
            else if(ans_grid[i][j] == -1)br = false;
            else if(br) ans_grid[i][j] = 1;
        }
    }
    rep(i,0,H){
        bool br = false;
        for(ll j = W-1;j >= 0; j--){
            if(ans_grid[i][j] == 2)br = true;
            else if(ans_grid[i][j] == -1)br = false;
            else if(br)ans_grid[i][j] = 1;
        }
    }
    rep(j,0,W){
        bool br = false;
        rep(i,0,H){
            if(ans_grid[i][j] == 2)br = true;
            else if(ans_grid[i][j] == -1)br = false;
            else if(br)ans_grid[i][j] = 1;
        }
    }
    rep(j,0,W){
        bool br = false;
        for(ll i = H-1;i >= 0; i--){
            if(ans_grid[i][j] == 2)br = true;
            else if(ans_grid[i][j] == -1)br = false;
            else if(br)ans_grid[i][j] = 1;
        }
    }
    ll ans = 0;
    rep(i,0,H)rep(j,0,W){
        if(ans_grid[i][j] >= 1)ans++;
        //cout<<ans_grid[i][j];
    }
    cout<<ans;
    return 0;
}


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

// #include <ext/pb_ds/assoc_container.hpp>
// #include <ext/pb_ds/tree_policy.hpp>
// using namespace __gnu_pbds;
// #define ordered_set tree<int, null_type,less<int>, rb_tree_tag,tree_order_statistics_node_update>

#define codeWizard      ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0)
#define testCase(tc)    while(tc--)
#define vi              vector<int>
#define vvi             vector<vi>
#define pi              pair<int,int>
#define int             long long
#define lb              lower_bound
#define ub              upper_bound
#define mod             1000000007
//#define mod           998244353
#define ff              first
#define ss              second
#define inf             (int)1e17
#define ninf            -inf
#define endl            "\n"
#define fill(a,b)       memset(a,b,sizeof(a))
#define all(v)          v.begin(),v.end()                               //codeWizard
int LCM(int a, int b) {return (a * b) / __gcd(a, b);}

void init_code() {
#ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
#endif
}
int n;
vvi player;
bool check(int x){
    set<int> st;

    for(auto k:player){
        int bit=0;
        int i=0;
        for(auto i:k){
            bit <<= 1;
                bit |= i >= x;

        }
        st.insert(bit);
    }

    for(auto x:st){
        for(auto y:st){
            for(auto z:st){
                if((x|y|z)==31)
                    return true;
            }
        }
    }
    return false;
}
void solve(){
   cin>>n;
   for(int i=1;i<=n;i++){
    vector<int> temp(5);
    for(int j=0;j<5;j++)
        cin>>temp[j];
    player.push_back(temp);
   }
   int low=1,high=1000000001;
   int ans=0;
   while(high>low+1){
    //cout<<low<<" "<<high<<endl;
    int mid=(low+high)/2;
    if(check(mid)){
        low=mid;
    }
    else
        high=mid;
   }
   cout<<low<<endl;
}
signed main()
{
    codeWizard;
    init_code();
    int tc = 1;
    //cin >> tc;
    int num=1;
    testCase(tc) {
        //cout<<"Case #"<<num<<": ";

        num++;
        solve();
    }

    //cout << "Time execute: " << clock() / (double)CLOCKS_PER_SEC << " sec" << endl;

}

#include<bits/stdc++.h>
using namespace std;
int mod=1e9+7;
const int N=2e5+5;
int32_t main()
{
    int ans=0;
    int n;
    cin>>n;
    vector<vector<int>  > a(n,vector<int> (5));
    vector<vector<int>  > dp(5);
    for(int i=0;i<n;i++)
    {
        for(int j=0;j<5;j++)
        {
            cin>>a[i][j];
            dp[j].push_back(a[i][j]);
        }
    }
    for(int i=0;i<5;i++)
    {
        sort(begin(dp[i]),end(dp[i]),greater<int> ());
    }
    for(int i=0;i<n;i++)
    {
        for(int j=i+1;j<n;j++)
        {
            int ind;
            int mini=1e9;
            for(int k=0;k<5;k++)
            {
                if(max(a[i][k],a[j][k])<mini)
                {
                    ind=k;
                    mini=max(a[i][k],a[j][k]);
                }
            }
            int val=1e9;
            for(int k=0;k<5;k++)
            {
                if(k!=ind)
                val=min(val,max(a[i][k],a[j][k]));
            }
            if(dp[ind][0]!=a[i][ind]&&dp[ind][0]!=a[j][ind])
            val=min(val,dp[ind][0]);
            else if(dp[ind][1]!=a[i][ind]&&dp[ind][1]!=a[j][ind])
            val=min(val,dp[ind][1]);
            else
            val=min(val,dp[ind][2]);
            ans=max(ans,val);
        }
    }
    cout<<ans<<endl;
}


#include <sys/time.h>

#include <iostream>
#include <iomanip>
#include <algorithm>
#include <utility>
#include <cmath>
#include <string>
#include <vector>
#include <set>
#include <map>
#include <queue>
#include <stack>
#include <deque>
#include <utility>
#include <cctype>
#include <cstdlib>
#include <typeinfo>

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

/*
#include <boost/multiprecision/cpp_int.hpp>

namespace mp = boost::multiprecision;
using BigInt = mp::cpp_int;
*/
// https://yamakasa.net/atcoder-abc-029-d/

using namespace std;

using ll = long long;
using i_i = pair<int, int>;
using l_l = pair<ll, ll>;
using ld = long double;

#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define mkp(a, b) make_pair(a, b)

const ll MOD = 1000000007LL;
const ll INF = 1e9;

const ld gomi = 0.0000000000001;

int main() {
	ll k;
	cin >> k;
	ll count = 0;

	for(ll a = 1; a <= k; a++) {
		for(ll b = 1; b <= k; b++) {
			if (a * b > k) break;
			int c_max = k / (a * b);
			count += c_max;
		}
	}
	cout << count << endl;

	return 0;
}

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

#define INI_1(N) N
#define INI_5(N) N, N, N, N, N
#define INT_10(N) INT_5(N), INT_5(N)
#define INT_20(N) INT_10(N), INT_10(N)
#define INT_50(N) INT_10(N), INT_20(N), INT_20(N)
#define INT_100(N) INT_50(N), INT_50(N)
#define INT_1000(N) INT_100(N), INT_100(N), INT_100(N), \
                    INT_100(N), INT_100(N), INT_100(N), \
                    INT_100(N), INT_100(N), INT_100(N), \
                    INT_100(N)

template <typename T>
using vector = std::vector<T>;

template <typename T, std::size_t N>
using array = std::array<T, N>;

using string = std::string;

template <typename T>
using set = std::set<T>;

template <typename T, typename U>
using map = std::map<T, U>;

template <typename T, typename U>
using pair = std::pair<T, U>;

using std::cin;
using std::cout;

int main(void) {
    int n;
    cin >> n;
    cout << (n / 100) + (n%100 != 0) << '\n';
}


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

bool solve(int v, int c, vector<vector<int>>& G, vector<int>& color) {
    if (color[v] != -1) {
        if (color[v] != 2 && color[v] != c) {
            color[v] = -2;
            return false;
        } else {
            return true;
        }
    }

    bool res = true;
    int n = G.size();
    color[v] = c;

    rep(i, n) {
        if (G[v][i] == 0) continue;
        res &= solve(i, c ^ 1, G, color);
    }

    return res;
}

int main() {
    ll n, m;
    cin >> n >> m;
    vector<int> a(m), b(m);
    vector<vector<int>> G(n, vector<int>(n, false));
    rep(i, m) {
        cin >> a[i] >> b[i];
        a[i]--, b[i]--;
        G[a[i]][b[i]] = 1;
        G[b[i]][a[i]] = 1;
    }

    ll ans = 0;
    for (int bit = 0; bit < (1 << n); bit++) {
        vector<vector<int>> G2 = G;
        vector<int> color(n, -1);
        rep(i, n) {
            if (bit >> i & 1) {
                color[i] = 2;
                rep(j, n) {
                    G2[i][j] = 0;
                    G2[j][i] = 0;
                }
            }
        }

        bool ok = true;
        rep(i, m) if (color[a[i]] == 2 && color[b[i]] == 2) ok = false;
        if (!ok) continue;

        ll tmp = 1;
        rep(i, n) {
            if (color[i] == -1 && solve(i, 0, G, color)) {
                tmp *= 2;
            }
        }

        rep(i, n) if (color[i] == -2) ok = false;
        if (ok) ans += tmp;
    }

    cout << ans << endl;
}

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

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

    int n, m; cin >> n >> m;
    vector<vector<int>> adj(n);
    for (int i = 0; i < m; ++i) {
        int u, v; cin >> u >> v; --u, --v;
        adj[u].push_back(v);
        adj[v].push_back(u);
    }

    vector<bool> vis(n, 0);
    int sz;
    function<void(int)> dfs1 = [&](int u) {
        sz++;
        vis[u] = 1;
        for (int v : adj[u])
            if (!vis[v]) dfs1(v);
    };

    int offset, pos;
    vector<int> colour(n);
    function<bool(int)> dfs2 = [&](int u) {
        pos++;
        for (int v : adj[u]) {
            if (colour[v] == colour[u]) {
                return false;
            }
            if (colour[v] == -1) {
                colour[v] = (colour[u] + ((offset >> pos) & 1) + 1) % 3;
                if (!dfs2(v)) return false;
            }
        }
        return true;
    };

    long long ans = 1;
    for (int i = 0; i < n; ++i) {
        if (vis[i]) continue;
        sz = 0;
        dfs1(i);
        int cur = 0;
        for (offset = 0; offset < (1 << (sz - 1)); ++offset) {
            colour.assign(n, -1);
            colour[i] = 0;
            pos = -1;
            if (dfs2(i)) cur += 3;
        }
        ans *= cur;
    }
    cout << ans << '\n';

    return 0;
}


#include<bits/stdc++.h>
#define endl '\n'
#define ll long long
#define ld long double
#define ull unsigned long long
using namespace std;
struct _IO{_IO(){ios::sync_with_stdio(0);cin.tie(0);}}_io;
const ll mod=10;
int g=0;
int a[100000][2];

ld cmp(ld a,ld b){
    return a>b;
}

ll qpow(ll a,ll b){
    ll ans=1,x=a,y=b;
    while(y!=0){
        if(y%2==1){
            ans*=x;
        }
        ans%=mod;
        y/=2;
        x%=mod;
        x*=x;
        x%=mod;
    }
    return ans;
}

int main(){
    int n;
    cin>>n;
    int a[n];
    int maxn=0;
    for(int i=0;i<n;i++){
        cin>>a[i];
        maxn=max(maxn,a[i]);
    }
    int ans=1,anss=0;
    for(int i=2;i<=maxn;i++){
        int g=0;
        for(int j=0;j<n;j++){
            if(a[j]%i==0&&a[j]/i>=1){
                g++;
            }
        }
        if(g>=anss){
            ans=i;
            anss=g;
        }
    }
    cout<<ans<<endl;
}

///ShzFahad
#include<bits/stdc++.h>
using namespace std;
#define ll long long int
#define ld long double
int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    ll n;
    cin >> n;
    map<string,ll>mp;
    while(n--)
    {
        string s;
        cin >> s;
        mp[s]++;
    }
    for(auto it=mp.begin();it!=mp.end();it++)
    {
        string k = it->first;
        if(k[0]=='!')
        {
            string x = k.substr(1,k.size()-1);
            auto it2 = mp.find(x);
            if(it2!=mp.end())
            {
                cout << x << endl;
                return 0;
            }
        }
    }
    cout << "satisfiable" << endl;

}


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

typedef long long ll;

int main() {
    const ll INF = 1e18;
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    int n; ll x;
    cin >> n >> x;
    vector<ll> a(n);
    for (int i = 0; i < n; i++)
        cin >> a[i];
    // number of possible values of y
    // y, y-x use no overlapping coins
    reverse(a.begin(), a.end());
    vector<ll> X(n);
    vector<ll> B(n);
    for (int i = 0; i < n; i++) {
        if (x >= a[i]) {
            X[i] = x / a[i];
            x %= a[i];
        }
        if (i == 0) {
            B[i] = INF;
        } else {
            B[i]= a[i - 1] / a[i];
        }
    }
    vector<vector<ll>> dp(n + 1, vector<ll>(2, 0));
    // you did up to that place, and there was carry over or not, and you only want carry over if next digit will be 0
    X.insert(X.begin(), -1);
    B.insert(B.begin(), -1);
    a.insert(a.begin(), -1);
    dp[0][0] = 1;
    for (int i = 1; i <= n; i++) {
        // there is carry, then current digit is 0
        dp[i][1] += dp[i - 1][1];
        if (X[i] != 0)
            dp[i][0] += dp[i - 1][1];
        // there is no carry
        dp[i][0] += dp[i - 1][0];
        if (X[i] != B[i] - 1)
            dp[i][1] += dp[i - 1][0];
    }
    ll ans = dp[n][0];
    cout << ans << '\n';
    return 0;
}

//Author: Fuadul Hasan(fuadul202@gmail.com)
//BSMRSTU,Gopalganj
//#include<bits/stdc++.h>
#define _USE_MATH_DEFINES
#include <set>
#include <map>
#include <list>
#include <queue>
#include <stack>
#include <cmath>
#include <ctime>
#include <cstdio>
#include <string>
#include <vector>
#include <bitset>
#include <random>
#include<iomanip>
#include <cassert>
#include <cstring>
#include <sstream>
#include <complex>
#include <numeric>
#include <iostream>
#include <algorithm>
#include <functional>
#include <unordered_set>
#include <unordered_map>
using namespace std;

//debug..........
#define error(args...) {vector<string>_v=split(#args,',');err(_v.begin(),args);cout<<endl;}
vector<string> split(const string &s, char c) {vector<string>v; stringstream ss(s); string x;while (getline(ss, x, c))v.emplace_back(x); return move(v);} void err(vector<string>::iterator it) {}
template<typename T, typename... Args>void err(vector<string>::iterator it, T a, Args...args) {cout << it->substr((*it)[0] == ' ', it->length()) << " = " << a << " "; err(++it, args...);}

//............ignore it..................//
#define F first
#define S second
#define Pi atan(1)*4
#define mp make_pair
#define pb  push_back
const int M	= 1e9 + 7;
#define ld  long double
#define ll  long long int
#define happy cin.tie(0);
#define point(x) cout<<fixed<<setprecision(x)
int length(string s){return (int)s.size();}
#define mem(a)  memset(a , 0 ,sizeof a)
#define memn(a) memset(a , -1 ,sizeof a)
#define coding ios::sync_with_stdio(false);
#define Unique(c) (c).resize(unique(all(c))-(c).begin())
#define vout(v) for (auto z: v) cout << z << " "; cout << endl;

int length(long long x){int l = 0;for(long long i=x;i;i/=10)l++;return l;}
int dx[8]= {1,0,-1,0,-1,-1,1,1};
int dy[8]= {0,1,0,-1,-1,1,-1,1};

#define rep(i,b,e)  for(__typeof(e) i = (b) ; i != (e + 1) - 2 * ((b) > (e))  ; i += 1 - 2 * ((b) > (e)))

long long Inv_pow(long long a,long long n){ll res = 1;while(n){if(n&1) res = ((res%M)*(a%M))%M;a = ((a%M)*(a%M))%M;n>>=1;}return res%M;}
// suffix_prefix....
std::vector<ll> prefix_sum(std::vector<ll> a){int n = a.size();std::vector<ll> prf(n,0);for(int i=0;i<n;i++){
if(i == 0){prf[i] = a[i];}else{prf[i] = prf[i-1]+a[i];}}return prf;}
std::vector<ll> suffix_sum(std::vector<ll> a){int n = a.size();std::vector<ll>suf(n,0);for(int i=n-1;i>=0;i--){
if(i == n-1){suf[i] = a[i];}else{suf[i] = suf[i+1]+a[i];}}return suf;}

long long Lcm(long long a,long long b){return (((a)*(b)))/__gcd(a,b);}

#define Test cout<<"Case #"<<tc++<<": ";
int tc = 1;

inline void read(std::vector<int> &v){for(int i=0;i<(int)v.size();i++){cin>>(v[i]);}}
inline void readl(std::vector<ll> &v){for(int i=0;i<(int)v.size();i++){cin>>(v[i]);}}

template<class T> bool remin(T& a, const T& b) { return a > b ? a = b, 1 : 0; }
template<class T> bool remax(T& a, const T& b) { return a < b ? a = b, 1 : 0; }

inline void read(int v[],int n){for(int i=0;i<n;i++){cin>>(v[i]);}}
inline void readl(ll v[],int n){for(int i=0;i<n;i++){cin>>(v[i]);}}

inline int add(int a, int b, int mod) {a += b ; return a >= mod ? a - mod : a ;}
inline int sub(int a, int b, int mod) {a -= b ; return a < 0 ? a + mod : a ;}
inline int mul(int a, int b, int mod) {return (ll)a * b % mod ;}

#define   pr 	pair<int, int>
#define   vpr 	vector<pr>
#define   vi   	std::vector<int>
#define   vll  	std::vector<ll>
#define   all(n) n.begin(),n.end()

const int Inf           = (int)2e9 + 5;
const ll  Lnf           = (ll)2e18 + 5;
const int N             = 5e5 + 5;
const int NN            = 1e6 + 5;

int solve()
{

	//Test

	int a,b;
	cin>>a>>b;
	double x = (double)b / 100.0;
	cout<<(double)a*x<<endl;

	return 0;
	//error();
}
int main(){

	happy coding
	int test = 1;
	//cin>>test;
	while (test--)solve();return 0;
}

/*
1. Everything happens for something good.
2. Don't expect anything from anyone except yourself.
3. Self discipline is the magic power that makes you unstoppable.
*/


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

class Node {
  public:
    int x;
    int y;
    int cost;
    Node() {}
    Node(int _x, int _y, int _cost) {
      x = _x;
      y = _y;
      cost = _cost;
    }
};

class Point {
  public:
    int x;
    int y;
    Point() {}
    Point(int _x, int _y) {
      x = _x;
      y = _y;
    }
};

int main()
{
  int h, w;
  cin >> h >> w;
  vector<vector<char>> board(h, vector<char>(w, ' '));
  vector<vector<int>> cost(h, vector<int>(w, 1e9));
  vector<vector<Point>> tele(26);
  int startx = -1, starty = -1, goalx = -1, goaly = -1;
  for (int x = 0; x < h; x++) {
    for (int y = 0; y < w; y++) {
      char ch = getchar();
      while (ch == '\n') {
        ch = getchar();
      }
      board.at(x).at(y) = ch;
      switch (ch) {
        case 'S':
          startx = x;
          starty = y;
          break;
        case 'G':
          goalx = x;
          goaly = y;
          break;
        case '#':
          cost[x][y] = -1;
          break;
        case '.':
          break;
        default:
          tele.at(ch - 'a').emplace_back(x, y);
          break;
      }
    }
    getchar(); // LF
  }
  vector<bool> tele_is_alive(26, true);
  queue<Node> q;
  q.emplace(startx, starty, 0);
  while (!q.empty()) {
    auto n = q.front();
    q.pop();
    if (n.x < 0 || h <= n.x || n.y < 0 || w <= n.y) {
      continue;
    }
    if (cost.at(n.x).at(n.y) <= n.cost) {
      continue;
    }
    cost.at(n.x).at(n.y) = n.cost;
    if (n.x == goalx && n.y == goaly) {
      break;
    }
    char ch = board.at(n.x).at(n.y);
    if ('a' <= ch && ch <= 'z' && tele_is_alive.at(ch-'a')) {
      for (auto p : tele.at(ch-'a')) {
        q.emplace(p.x, p.y, n.cost+1);
      }
      tele_is_alive.at(ch-'a') = false;
    }
    q.emplace(n.x+1, n.y, n.cost+1);
    q.emplace(n.x-1, n.y, n.cost+1);
    q.emplace(n.x, n.y+1, n.cost+1);
    q.emplace(n.x, n.y-1, n.cost+1);
  }
  if (cost.at(goalx).at(goaly) == 1e9) {
    cout << "-1\n";
  } else {
    cout << cost.at(goalx).at(goaly) << '\n';
  }
  return 0;
}

#include <iostream>
#include <fstream>
#include <vector>
#include <algorithm>
#include <stack>
#include <cassert>
#include <map>
#include <numeric>
#include <cstring>
#include <set>
#include <ctime>
#include <queue>
#include <cmath>
#include <iomanip>
#include <iterator>

using namespace std;

class InputReader {
public:
    InputReader() {}
    InputReader(const char *file_name) {
        input_file = fopen(file_name, "r");
        cursor = 0;
        fread(buffer, SIZE, 1, input_file);
    }
    inline InputReader &operator >>(int &n) {
        while((buffer[cursor] < '0' || buffer[cursor] > '9') && buffer[cursor] != '-') {
            advance();
        }
        int sign = 1;
        if (buffer[cursor] == '-') {
            sign = -1;
            advance();
        }
        n = 0;
        while('0' <= buffer[cursor] && buffer[cursor] <= '9') {
            n = n * 10 + buffer[cursor] - '0';
            advance();
        }
        n *= sign;
        return *this;
    }
private:
    FILE *input_file;
    static const int SIZE = 1 << 17;
    int cursor;
    char buffer[SIZE];
    inline void advance() {
        ++ cursor;
        if(cursor == SIZE) {
            cursor = 0;
            fread(buffer, SIZE, 1, input_file);
        }
    }
};

const int MAXN = 200000;

char s[1 + MAXN];
char t[3];

bool check(int start, int n) {
    t[0] = t[1] = '1';
    t[2] = '0';
    for (int i = start, j = 0; i <= n; i++, j = (j + 1) % 3) {
        if (s[i] != t[j]) {
            return false;
        }
    }
    return true;
}

int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    //ifstream cin("input.txt");
    int n;
    long long p = 10000000000L;
    cin >> n >> (s + 1);
    if (n == 1) {
        if (s[1] == '0') {
            cout << p << "\n";
        } else {
            cout << p * 2 << "\n";
        }
    } else if (n == 2) {
        if (s[1] == '0' && s[2] == '0') {
            cout << "0\n";
        } else if (s[1] == '0' && s[2] == '1') {
            cout << p - 1 << "\n";
        } else {
            cout << p << "\n";
        }
    } else {
        if (s[1] == '0') {
            if (check(2, n)) {
                int m = 1 + (n - 2) / 3 + 1;
                cout << p - m + 1 << "\n";
            } else {
                cout << "0\n";
            }
        } else if (s[1] == '1' && s[2] == '0') {
            if (check(3, n)) {
                int m = 1 + (n - 3) / 3 + 1;
                cout << p - m + 1 << "\n";
            } else {
                cout << "0\n";
            }
        } else if (s[1] == '1' && s[2] == '1' && s[3] == '0') {
            if (n == 3) {
                cout << p << "\n";
            } else if (check(4, n)) {
                int m = 1 + (n - 4) / 3 + 1;
                cout << p - m + 1 << "\n";
            } else {
                cout << "0\n";
            }
        } else {
            cout << "0\n";
        }
    }
    return 0;
}


/*
	In the name of ALLAH
	Author : Raashid Anwar
*/

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

#define int int64_t
#define mod 1000000007

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

int32_t main() {
	ios_base::sync_with_stdio(false);
	cin.tie(0);
	int n,k,m,x,sum=0;
	cin>>n>>k>>m;
	for(int i=1;i<=n-1;i++) {
		cin>>x;
		sum+=x;
	}
	if((n*m-sum<=k))
		cout<<max(int(0),n*m-sum)<<"\n";
	else
		cout<<"-1\n";
}

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

signed main() {
  int N,K,M;
  cin >> N >> K >> M;

  int sum=0;
  for(int i=0; i<N-1; i++) {
    int ai;
    cin >> ai;
    sum += ai;
  }

  for(int i=0; i<=K; i++) {
    if((sum + i)/N >= M) {
      cout << i << endl;
      return 0;
    }
  }
  puts("-1");
}