#include <bits/stdc++.h>
using namespace std;
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n) FOR(i,0,n)
#define ALL(v) begin(v),end(v)
template<typename A, typename B> inline bool chmax(A &a, B b) { if (a<b) { a=b; return 1; } return 0; }
template<typename A, typename B> inline bool chmin(A &a, B b) { if (a>b) { a=b; return 1; } return 0; }
using ll = long long;
using pii = pair<int, int>;
constexpr ll INF = 1ll<<30;
constexpr ll longINF = 1ll<<60;
constexpr ll MOD = 1000000007;
constexpr bool debug = 0;
//---------------------------------//

int main() {
	ll S, P;
	cin >> S >> P;
	puts([&] {
		for (ll i = 1; i * i <= P; ++i) {
			ll n = i, m = S - i;
			if (n > 0 && m > 0 && n * m == P) return true;
		}
		return false;
	}() ? "Yes": "No");
	return 0;
}

#include <bits/stdc++.h>
using namespace std;
#define ll long long int
#define pb push_back
#define mp make_pair
#define asort(a,n) sort(a,a+n)
#define vsort(v) sort(v.begin(),v.end())
#define all(v) v.begin(),v.end()
#define run ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);cerr.tie(0);
#define mod 1000000007
#define endl "\n"
#define LL_MAX LLONG_MAX
#define yes cout<<"Yes"<<endl
#define no cout<<"No"<<endl

//********************************* mekch ************************************//

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

}

ll binExp(ll x,ll n)
{
   ll res=1;
    while(n)
    {
        if(n&1) res=(res*x)%mod;
        x=(x*x)%mod;
        n>>=1;
    }
    return res;
}

bool isPerfectSquare(long double x)
{
  long double sr = sqrt(x);

  return ((sr - floor(sr)) == 0);
}

int main()
 {
  run;
  ll t;

  // ALWAYS UES LL_MAX
  long double  n,i,x,y,ok=0,sum=0,ans=0,res;
  ll res1,res2,res3,res4;

        cin>>x>>y;
        res=x*x-4*y;
    if (isPerfectSquare(res))
    {
        res1=sqrt(res);
        res2=x+res1;
        res3=x-res1;
       // cout<<"jdc";

        if(res2%2==0)
          res2=res2/2;
          else
          res2=-1;
          if(res3%2==0)
            res3=res3/2;
            else
            res3=-1;

            if(res2>0||res3>0)
            {
                if(res2>0)
                res4=x-res2;
                else
                res4=x-res3;

                if(res4>0)
                yes;
                else
                no;
            }
        else
        no;
    }
    else
    no;

 }


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

/*---------macro---------*/
#define rep(i, n) for (int i = 0; i < (int)(n); ++i)
#define rep2(i, s, n) for (int i = s; i < (int)(n); ++i)
#define Clear(a) a = decltype(a)()
#define all(a) begin(a),end(a)
#define rall(a) rbegin(a),rend(a)
#define bit(i,j) ((i>>j)&1)

/*---------type/const---------*/
typedef long long ll;
typedef unsigned long long ull;
typedef string::const_iterator state; //構文解析
const ll big=1000000007;
//const ll big=998244353;
const double PI=acos(-1);
const double EPS=1e-8;//適宜変える
const int dx[4]={1,0,-1,0};
const int dy[4]={0,1,0,-1};
const char newl='\n';
struct{
    constexpr operator int(){return -int(1e9)-1;}
    constexpr operator ll(){return -ll(1e18)-1;}
}neginf;
struct{
    constexpr operator int(){return int(1e9)+1;}
    constexpr operator ll(){return ll(1e18)+1;}
    constexpr auto operator -(){return neginf;}
}inf;

/*---------debug---------*/
#ifdef LOGX
#include <template/debug.hpp>
#define _GLIBCXX_DEBUG
#else
#define dbg(x) ;
#define prt(x) ;
#define _prt(x) ;
#endif

/*---------function---------*/
template<typename T,typename U> T max(const T x,const U y){if(x>y)return x;else return y;}
template<typename T,typename U> T min(const T x,const U y){if(x<y)return x;else return y;}
template<typename T> T max(const vector<T> &a){T ans=a[0];for(T elem:a){ans=max(ans,elem);}return ans;}
template<typename T> T min(const vector<T> &a){T ans=a[0];for(T elem:a){ans=min(ans,elem);}return ans;}
template<typename T,typename U> bool chmin(T &a,const U b){if(a>b){a=b;return true;}return false;}
template<typename T,typename U> bool chmax(T &a,const U b){if(a<b){a=b;return true;}return false;}
bool valid(int i,int j,int h,int w){return (i>=0 && j>=0 && i<h && j<w);}
template<typename T,typename U>
T expm(T x,U y,const ll mod=big){
    T res=1;
    while(y){
        if(y&1)(res*=x)%=mod;
        (x*=x)%=mod;
        y>>=1;
    }
    return res;
}
template<typename T,typename U>
T exp(T x,U y){
    T res=1;
    while(y){
        if(y&1)res*=x;
        x*=x;
        y>>=1;
    }
    return res;
}

int n;
vector<int> p;
vector<vector<int>> g;//g[i][0]がiの親.
vector<vector<bool>> notmy;
vector<int> ans;

//「自分」「相手」の辺を決定する.
bool dfs(int i){
    if(i!=0 && g[i].size()==1)return true;
    bool res=false;
    rep2(j,int(i!=0),g[i].size()){
        res^=(notmy[i][j]=dfs(g[i][j]));
    }
    return !res;
}

//その頂点「に」移動させることを選択した人がどれだけ獲得するか？
int calc(int i){
    if(g[i].size()==1 && i!=0){
        return ans[i]=-1;
    }

    vector<int> mine;
    vector<int> ene;
    rep2(j,int(i!=0),g[i].size()){
        if(notmy[i][j])ene.emplace_back(calc(g[i][j]));
        else mine.emplace_back(calc(g[i][j]));
    }

    sort(rall(mine));
    sort(rall(ene));

    int res=-1;
    //「ene」の個数が偶数個なら, mineは全て自分でとることになる.
    if(ene.size()%2==0){
        for(auto &e:mine)res+=e;
        rep(j,ene.size()){
            if(j%2==0)res+=ene[j];
            else res-=ene[j];
        }
    }
    else{
        for(auto &e:mine)res+=abs(e);
        rep(j,ene.size()){
            if(j%2==0)res+=ene[j];
            else res-=ene[j];
        }
    }
    return ans[i]=res;
}

int main(){
    ios::sync_with_stdio(false);
    std::cin.tie(nullptr);
    cout.precision(10);
    /*--------------------------------*/

    cin >> n;
    p.resize(n);
    g.resize(n);
    rep(i,n-1){
        cin >> p[i+1];
        p[i+1]--;
        g[i+1].emplace_back(p[i+1]);
        g[p[i+1]].emplace_back(i+1);
    }
    notmy.resize(n);
    rep(i,n){
        notmy[i].resize(g[i].size());
    }
    ans.resize(n,0);
    dfs(0);
    dbg(notmy);
    calc(0);
    dbg(ans);
    cout << (n-ans.front())/2 << newl;
}

    //For higher stack size use g++ -O2 -std=c++11 -Wall -Wl,--stack=268435456 a.cpp -o a.exe in cmd
    #include <bits/stdc++.h>
    #include <cstdio>
    #include <cstring>
    #include <cmath>
    #include <cstring>
    #include <chrono>
    #include <complex>
    #define ll long long
    #define ld long double
    #define vi vector<int>
    #define vll vector<ll>
    #define vvi vector < vi >
    #define pii pair<int,int>
    #define pll pair<long long, long long>
    #define mod 1000000007
    #define inf 1000000000000000001;
    #define all(c) c.begin(),c.end()
    #define mp(x,y) make_pair(x,y)
    #define mem(a,val) memset(a,val,sizeof(a))
    #define eb emplace_back
    #define pb push_back
    #define f first
    #define s second

    using namespace std;
    int main()
    {
        std::ios::sync_with_stdio(false);
        int T;
        T=1;
        // cin.ignore(); must be there when using getline(cin, s)
        while(T--)
        {
            ll l,i,j,k;
            cin>>l;
            ll dp[l+1][13];
            for(i=0;i<=l;++i)
            {
                for(j=0;j<=12;++j)
                    dp[i][j]=0;
            }
            for(i=1;i<=l;++i)
            {
                dp[i][1]=1;
                for(j=2;j<=12;++j)
                {
                    for(k=i-1;k>=1;--k)
                    {
                        dp[i][j]=dp[i][j]+dp[k][j-1];
                    }
                    // cout<<i<<" "<<j<<" "<<dp[i][j]<<endl;
                }
            }
            cout<<dp[l][12]<<endl;
        }
        return 0;
    }


// #pragma GCC optimize("Ofast,unroll-loops")
// #pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,avx2,tune=native")
#include <bits/stdc++.h>
#define ll long long int
#define vi vector<int>
#define vvi vector<vector<int>>
#define vll vector<long long>
#define vs vector<string>
#define vc vector<char>
#define vb vector<bool>
#define forn(i, s, n)  for(ll i=(ll)s; i<(ll)(n); i++)
#define all(c) c.begin(),c.end()
#define pb push_back
#define pll pair<long long int, long long int>
#define pii pair<int, int>
#define pss pair<string, string>
#define ull unsigned long long int
#define lld long double
#define F first
#define S second
#define PI 3.141592653589793238
#define prec(n) fixed<<setprecision(n)
#define ordered_set tree<ll, null_type,less_equal<ll>, rb_tree_tag,tree_order_statistics_node_update>
#define debug(...) fprintf(stderr, __VA_ARGS__), fflush(stderr)
#define itsval(args...) { string _s = #args; replace(_s.begin(), _s.end(), ',', ' '); stringstream _ss(_s); istream_iterator<string> _it(_ss); itval(_it, args); }
using namespace std;
// #include <ext/pb_ds/assoc_container.hpp>
// #include <ext/pb_ds/tree_policy.hpp>
// using namespace __gnu_pbds;

void itval(istream_iterator<string> it) {}
template<typename T, typename... Args>
void itval(istream_iterator<string> it, T a, Args... args) {
    cerr << *it << " = " << a << endl;
    itval(++it, args...);
}
const ll MOD = 1e9 + 7;
template <typename T>
inline void print(T x) {cout << x << "\n";}
template <typename T>
inline void printvec(T x) {for (auto a : x) cout << a << ' '; cout << '\n';}
// -----------------------------------------------------------------------

struct custom {
    bool operator()(const pair<int, string> &p1, const pair<int, string> &p2)const {
        if (p1.F == p2.F)
            return p1.S < p2.S;
        return p1.F > p2.F;
    }
};

// Calculate a^b % MOD -------------------------------------------------
ll get_pow(ll a, ll b, ll M = MOD) {
    ll res = 1;
    while (b) {
        if (b & 1) res = (res * a) % M;
        a = (a * a) % M;
        b >>= 1;
    }
    return res;
}
// ---------------------------------------------------------------------
const ll N = 1e5 + 5, inf = 2e18;
ll n, m, X, Y;
std::vector<std::vector<pair<ll, pll>>> adj(N); // u, t,k
void bfs()
{
    vll dist(n, inf);
    dist[X] = 0;
    priority_queue<pll, std::vector<pll> , greater<pll>> s;
    s.push({0, X});
    while (!s.empty())
    {
        auto t = s.top();
        s.pop();
        if (t.F > dist[t.S])
            continue;
        for (auto x : adj[t.S])
        {
            ll to = x.F;
            ll m = (x.S.S - t.F % x.S.S) % x.S.S;
            if (dist[to] > t.F + m + x.S.F)
            {
                dist[to] = t.F + m + x.S.F;
                s.push({dist[to], to});
            }
        }
    }
    if (dist[Y] == inf)
        cout << -1;
    else
        cout << dist[Y];
}
void solve()
{
    cin >> n >> m >> X >> Y;
    X--; Y--;
    ll x, y, t, k;
    forn(i, 0, m)
    {
        cin >> x >> y >> t >> k;
        x--; y--;
        adj[x].pb({y, {t, k}});
        adj[y].pb({x, {t, k}});
    }
    bfs();
}

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);
#ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin);
    freopen("output1.txt", "w", stdout);
#endif
    int test = 1;
    //cin >> test;
    clock_t z = clock();
    forn(tes, 0, test)
    {
        solve();
    }
    debug("Total Time:%.4f\n", (double)(clock() - z) / CLOCKS_PER_SEC);
    return 0;
}

#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include <cstdio>
#include <cstring>
#include <cmath>
using namespace std;
using ll = long long;

constexpr int P = 1000000007;

ll powmod(ll n, ll k) {
    ll r = 1, t = n % P;
    for (; k != 0; k /= 2) {
        if (k & 1) r = r * t % P;
        t = t * t % P;
    }
    return r;
}
ll modinv(ll n) {
    return powmod(n, P - 2);
}

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

    //char aa, ab, ba, bb;
    //cin >> aa >> ab >> ba >> bb;

    constexpr int M = 4;
    char c[M];
    for (int i = 0; i < M; i++) {
        cin >> c[i];
        c[i] -= 'A';
    }

    if (c[1] == 1) {
        for (int i = 0; i < M; i++) {
            c[i] ^= 1;
        }
        swap(c[0], c[3]);
    }

    if (c[0] == 0 || n <= 3) {
        cout << 1 << endl;
        quick_exit(0);
    }

    //10??
    n -= 3;

    if (c[2] == 0) {
        ll dp[1000][2];
        dp[0][0] = 1;
        dp[0][1] = 0;
        for (int i = 0; i < n + 1; i++) {
            dp[i + 1][0] = (dp[i][0] + dp[i][1]) % P;
            dp[i + 1][1] = dp[i][0];
        }

        cout << dp[n + 1][0] << endl;

    } else {
        cout << powmod(2, n) << endl;
    }

    /*
    * 挿入していくだけなのでA[AB]*Bの形
    * 難しいのはAABからABABになったあと BAがBのときBも好きなだけ伸ばせる（お尻のBは1個のまま）
    * BAがAのときBは1個のまま Aは好きな長さ
    */

    return 0;
}


#ifdef __LOCAL
  #define _GLIBCXX_DEBUG
#endif
#include <bits/stdc++.h>
using namespace std;
template<typename T> bool chmax(T &a,T b) {if(a<b) {a=b; return true;} return false;}
template<typename T> bool chmin(T &a,T b) {if(a>b) {a=b; return true;} return false;}
#define itn int
#define fi first
#define se second
#define intmax numeric_limits<int>::max()
#define llmax numeric_limits<ll>::max()
#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define rep1(i,n) for(int i=1;i<=(int)(n);i++)
#define rrep(i,n) for(int i=(int)(n)-1;i>=0;i--)
#define rrep1(i,n) for(int i=(int)(n);i>=1;i--)
#define all(vec) vec.begin(),vec.end()
#define sortt(vec) sort((vec).begin(),(vec).end())
#define rsort(vec) sort((vec).rbegin(), (vec).rend())
typedef long long ll;
typedef long double ld;
typedef pair<ll,ll> pll;
typedef pair<int,int> pii;
typedef tuple<ll,ll,ll> tlll;
typedef tuple<int,int,int> tiii;
const ll mod=1e9+7;
const int inf=1<<30;
const ll lnf=1ll<<60;

int main(){
  vector<int> cnt(2000000,0);
  ll n,m; cin >> n >> m;
  vector<ll> a(n);
  rep(i,n){
    cin >> a[i];
    cnt[a[i]]++;
  }
  ll ans=inf;
  rep(i,2e6){
    if(cnt[i]==0){
      ans=i;
      break;
    }
  }
  map<ll,vector<ll> > mp;
  rep(i,n){
    mp[a[i]].push_back(i);
  }
  for(auto c:mp)if(c.fi<ans){
    auto v=c.se;
    rep(i,v.size()){
      if(i==0&&v[i]-(-1)>m){
        cout << c.fi << endl;
        return 0;
      }
      if(i==v.size()-1&&n-v[i]>m){
        cout << c.fi << endl;
        return 0;
      }
      if(i!=v.size()-1&&v[i+1]-v[i]>m){
        cout << c.fi << endl;
        return 0;
      }
    }
  }
  cout << ans << endl;
}

#include<bits/stdc++.h>
using namespace std;
int h[1600000] = { 0 };
int num[1600000] = { 0 };
int main()
{

	int n;
	cin >> n;
	int size;
	cin >> size;
	for (int i = 1;i <= n;i++)
	{
		cin >> h[i];
		if (i <= size)num[h[i]]++;
	}
	int mina;
	for (int i = 0;;i++)
	{
		if (num[i] == 0)
		{
			mina = i;
			break;
		}
	}
	for (int i = 2;i <= n - size + 1;i++)
	{
		if (num[h[i - 1]] == 1 && h[i - 1] < mina&&h[i+size-1]!=h[i-1])
		{
			mina = h[i - 1];
		}
		num[h[i - 1]] = 0;
		num[h[i + size - 1]]++;
	}
	cout << mina<< endl;
}


#include <bits/stdc++.h>

using namespace std;

int main()
{
    int a,b;
    cin>>b>>a;
    cout<<b*2+100-a<<endl;
    return 0;
}

#include <bits/stdc++.h>
#define rep(i,a,b) for(int i=(a);i<=(b);++i)
#define per(i,a,b) for(int i=(a);i>=(b);--i)
using namespace std;
int n,m;
int main(){
    scanf("%d%d",&n,&m);
    printf("%d",2*n+100-m);
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
typedef int64_t ll;
typedef long double ld;
const ll MOD=1000000007;
const ll MODA=998244353;
#define rep(i,n) for(ll i=0;i<(ll)(n);i++)
long long gcd(long long a,long long b){
    ll gcdmax=max(a,b);
    ll gcdmin=min(a,b);
    while(true){
        if(gcdmax%gcdmin==0)break;
        else gcdmax%=gcdmin;
        swap(gcdmin,gcdmax);
    }
    return gcdmin;
}
ll powerup(ll N,ll P,ll M){
    if(P==0)return 1;
    else if(P%2==0){
        ll t=powerup(N,P/2,M);
        return t*t%M;
    }
    else return N*powerup(N,P-1,M)%M;
}
vector<ll> find_divisor(ll N){
  ll k=1;
  while(k*k<=N){
    k++;
  }
  vector<ll> A(1);
  rep(i,k){
    if(i==1)A.at(0)=1;
    else if(i>=2){
      if(N%i==0)A.push_back(i);
    }
  }
  ll t=0;
  t=A.size();
  rep(i,t){
    if(A.at(t-i-1)*A.at(t-i-1)!=N)A.push_back(N/A.at(t-1-i));
  }
  return A;
}
vector<ll> fac;
vector<ll> finv;
vector<ll> inv;
void COMinit(ll N,ll P){
    rep(i,N+1){
        if(i==0){
            fac.push_back(1);
            finv.push_back(1);
            inv.push_back(1);
        }
        else if(i==1){
            fac.push_back(1);
            finv.push_back(1);
            inv.push_back(1);
        }
        else{
            fac.push_back(fac.at(i-1)*i%P);
            inv.push_back(P-inv.at(P%i)*(P/i)%P);
            finv.push_back(finv.at(i-1)*inv.at(i)%P);
        }
    }
}

ll COM(ll n,ll k,ll P){
    if(n<k)return 0;
    if(n<0||k<0)return 0;
    return fac.at(n)*(finv.at(k)*finv.at(n-k)%P)%P;
}

struct UnionFind {
    vector<ll> par; // par[i]:iの親の番号　(例) par[3] = 2 : 3の親が2

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

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

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

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

int main(){
    ll N,W;
    ll time=400000;
    vector<ll> A(time);
    cin>>N>>W;
    ll wmax=0;
    rep(i,N){
        ll S,T,P;
        cin>>S>>T>>P;
        A.at(S)+=P;
        A.at(T)-=P;
    }
    rep(i,time){
        if(i>0){
            A.at(i)+=A.at(i-1);
        }
        wmax=max(A.at(i),wmax);
    }
    if(W>=wmax)cout<<"Yes"<<endl;
    else cout<<"No"<<endl;
}

/*
      Ashraful Islam Paran
      11-April-2021
      18:14:49
*/
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define f(n) for (int i = 0; i < n; i++)
#define show(x, y) cout << x << "         " << y << "\n"
#define fo(i, x, n) for (int i = x; i < n; i++)
#define fb(i, x, n) for (int i = n - 1; i >= x; i--)
#define w(t)  \
    int t;    \
    cin >> t; \
    while (t--)

#define dbg(args...)            \
    do                          \
    {                           \
        cerr << #args << " : "; \
        faltu(args);            \
    } while (0)
clock_t tStart = clock();
#define timeStamp dbg("Execution Time: ", (double)(clock() - tStart) / CLOCKS_PER_SEC)
void faltu()
{
    cerr << endl;
}
template <typename T>
void faltu(T a[], int n)
{
    for (int i = 0; i < n; ++i)
        cerr << a[i] << ' ';
    cerr << endl;
}
template <typename T, typename... hello>
void faltu(T arg, const hello &... rest)
{
    cerr << arg << ' ';
    faltu(rest...);
}

typedef unsigned long long ull;
typedef vector<long long> vi;
#define msi map<string, long long>
#define mii map<long long, long long>
const int MX = 2e5 + 5;
const int INF = 1e18;
const int mod = 1e9 + 7;
#define pb push_back
#define endl "\n"
#define yes cout << "YES\n"
#define no cout << "NO\n"
#define all(x) x.begin(), x.end()
#define ff first
#define ss second

inline void normal(int &a)
{
    if (a >= mod)
        a %= mod;
    (a < 0) && (a += mod);
}
inline int modMul(int a, int b)
{
    normal(a), normal(b);
    return (a * b) % mod;
}
inline int modAdd(int a, int b)
{
    normal(a), normal(b);
    return (a + b) % mod;
}
inline int modSub(int a, int b)
{
    normal(a), normal(b);
    a -= b;
    normal(a);
    return a;
}
inline int modPow(int b, int p)
{
    int r = 1;
    while (p)
    {
        if (p & 1)
            r = modMul(r, b);
        b = modMul(b, b);
        p >>= 1;
    }
    return r;
}
inline int modInverse(int a) { return modPow(a, mod - 2); }
inline int modDiv(int a, int b) { return modMul(a, modInverse(b)); }

void print(int a[], int n)
{
    for (int i = 0; i < n; i++)
    {
        cout << a[i] << " ";
    }
    cout << endl;
}

void print(vi &v)
{
    f(v.size())
    {
        cout << v[i] << " ";
    }
    cout << endl;
}

bool sortbysec(const pair<int, int> &a,
               const pair<int, int> &b)
{
    //return (a.second < b.second);
    if (a.first == b.first)
    {
        return (a.second > b.second);
    }
    else
    {
        return (a.ff < b.ff);
    }
}

int32_t main()
{
#ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
    freopen("error.txt", "w", stderr);
#else
    // online submission
#endif
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);

    int r, x, y;
    cin >> r >> x >> y;
    double a = (sqrt(x * x + y * y));
    // int b=a;
    // dbg(b);
    double b = r;
    // cout<<(b+r-1)/r<<endl;
    dbg(a);
    double c = (a + 0) / b;
    // dbg(c);
    double ans = ceil(c);
    int cnt = ans;
    if (a < r)
    {
        cnt++;
        // dbg(1);
    }

    cout << cnt << endl;

    cerr << "Time : " << 1.0 * clock() / CLOCKS_PER_SEC << "s\n";
    return 0;
}


//#include <bits/stdc++.h>
#include <iostream>
#include <iomanip>
#include <math.h>
#include <cmath>
#include <algorithm>
#include <climits>
#include <functional>
#include <cstring>
#include <string>
#include <cstdlib>
#include <ctime>
#include <cstdio>
#include <vector>
#include <stack>
#include <queue>
#include <deque>
#include <map>
#include <set>
#include <bitset>
#include <complex>
//#include <ext/pb_ds/assoc_container.hpp>
//#include <ext/pb_ds/tree_policy.hpp>
#define itn int
#define nit int
#define ll long long
#define ms multiset
#define F(i,a,b) for(register int i=a,i##end=b;i<=i##end;++i)
#define UF(i,a,b) for(register int i=a,i##end=b;i>=i##end;--i)
#define re register
#define ri re int
#define il inline
#define pii pair<int,int>
#define cp complex<double>
//#pra gma G CC opti mize(3)
using namespace std;
using std::bitset;
//using namespace __gnu_pbds;
const double Pi=acos(-1);
namespace fastIO {
	template<class T>
	inline void read(T &x) {
		x=0;
		bool fu=0;
		char ch=0;
		while(ch>'9'||ch<'0') {
			ch=getchar();
			if(ch=='-')fu=1;
		}
		while(ch<='9'&&ch>='0') x=(x*10-48+ch),ch=getchar();
		if(fu)x=-x;
	}
	inline int read() {
		int x=0;
		bool fu=0;
		char ch=0;
		while(ch>'9'||ch<'0') {
			ch=getchar();
			if(ch=='-')fu=1;
		}
		while(ch<='9'&&ch>='0') x=(x*10-48+ch),ch=getchar();
		return fu?-x:x;
	}
	char _n_u_m_[40];
	template<class T>
	inline void write(T x ) {
		if(x==0) {
			putchar('0');
			return;
		}
		T tmp = x > 0 ? x : -x ;
		if( x < 0 ) putchar('-') ;
		register int cnt = 0 ;
		while( tmp > 0 ) {
			_n_u_m_[ cnt ++ ] = tmp % 10 + '0' ;
			tmp /= 10 ;
		}
		while( cnt > 0 ) putchar(_n_u_m_[ -- cnt ]) ;
	}
	template<class T>
	inline void write(T x ,char ch) {
		write(x);
		putchar(ch);
	}
}
using namespace fastIO;
string s[4];
int p0[4][200002],p1[4][200002];
int n,t1,t2;
char inv[10002];
int main() {
	inv['0']='1';
	inv['1']='0';
	F(qwqwq,1,read()) {
		cin>>n;
		cin>>s[1]>>s[2]>>s[3];
		F(i,1,n)putchar('0');F(i,1,n)putchar('1');puts("0");continue;
		F(i,1,3)s[i].insert(0,"F");
		F(i,1,3) {
			t1=t2=0;
			F(j,1,n+n) {
				if(s[i][j]=='0')p0[i][++t1]=j;
				else p1[i][++t2]=j;
			}
		}
		F(i,1,n) {
			if(p0[1][i]-p0[1][i-1]>1&&p0[2][i]-p0[2][i-1]>1&&p0[3][i]-p0[3][i-1]>1) {
				F(ii,1,n)putchar('1');
				F(ii,2,i)putchar('0');
				putchar('1');
				F(ii,i,n)putchar('0');
				goto ak;
			}
		}
		F(i,1,n) {
			if(p1[1][i]-p1[1][i-1]>1&&p1[2][i]-p1[2][i-1]>1&&p1[3][i]-p1[3][i-1]>1) {
				F(ii,1,n)putchar('0');
				F(ii,2,i)putchar('1');
				putchar('0');
				F(ii,i,n)putchar('1');
				goto ak;
			}
		}

		F(i,1,3)s[i]+=s[i];
		F(i,1,3)p0[i][n+n+1]=p1[i][n+n+1]=4*n+1;
		F(i,1,3) {
			t1=t2=n;
			F(j,1,n+n) {
				if(s[i][j]=='0')p0[i][++t1]=j+n+n;
				else p1[i][++t2]=j+n+n;
			}
		}
		F(i,1,n+n+1) {
			if(p0[1][i]-p0[1][i-1]>1&&p0[2][i]-p0[2][i-1]>1&&p0[3][i]-p0[3][i-1]>1) {
				F(ii,2,i)putchar('0');
				putchar('1');
				F(ii,i,n+n)putchar('0');
				goto ak;
			}
		}
		F(i,1,n+n+1) {
			if(p1[1][i]-p1[1][i-1]>1&&p1[2][i]-p1[2][i-1]>1&&p1[3][i]-p1[3][i-1]>1) {
				F(ii,2,i)putchar('1');
				putchar('0');
				F(ii,i,n+n)putchar('1');
				goto ak;
			}
		}
		if((p0[1][n]!=n+n||p1[1][1]==1)&&(p0[2][n]!=n+n||p1[2][1]==1)&&(p0[3][n]!=n+n||p1[3][1]==1)) {
			F(ii,1,n)putchar('0');
			putchar('1');
			F(ii,1,n)putchar('0');
			goto ak;
		}
		if((p1[1][n]!=n+n||p0[1][1]==1)&&(p1[2][n]!=n+n||p0[2][1]==1)&&(p1[3][n]!=n+n||p0[3][1]==1)) {
			F(ii,1,n)putchar('1');
			putchar('0');
			F(ii,1,n)putchar('1');
			goto ak;
		}

ak:
		;
		putchar('\n');
	}
	return 0;
}


// 霽れを待つ
#include <bits/stdc++.h>
#define forn(i,s,t) for(register int i=(s);i<=(t);++i)
using namespace std;
const int N = 2e5 + 3;
struct Lst {int dir, nxt;}E[N<<1];
int G[N], cnt;
inline void Add(int u, int v) {
	E[++cnt].dir = v, E[cnt].nxt = G[u], G[u] = cnt;
}
int P, len;
void Pre_dfs(int u, int lst, int d) {
	(d > len) && (len = d, P = u);
	for(register int i=G[u];i;i=E[i].nxt) {
		int v = E[i].dir;
		if(v == lst) continue ;
		Pre_dfs(v, u, d + 1);
	}
}
int son[N], res[N];
int dfs(int u, int lst, int d) {
	int Mxd = d;
	for(register int i=G[u];i;i=E[i].nxt) {
		int v = E[i].dir;
		if(v == lst) continue ;
		int Mxv = dfs(v, u, d + 1);
		if(Mxv > Mxd) Mxd = Mxv, son[u] = v;
	}
	return Mxd;
}
int tot = 1;
void Fin_dfs(int u, int lst) {
	res[u] = tot;
	for(register int i=G[u];i;i=E[i].nxt) {
		int v = E[i].dir;
		if(v == lst || v == son[u]) continue ;
		tot ++ ;
		Fin_dfs(v, u);
		tot ++ ;
	}
	(son[u]) && (tot++, Fin_dfs(son[u], u), tot++);
}
int n;
int main() {
	scanf("%d", &n);
	forn(i,2,n) {
		static int u, v;
		scanf("%d%d", &u, &v);
		Add(u, v), Add(v, u);
	}
	Pre_dfs(1, -1, 0);
	dfs(P, -1, 1);
	Fin_dfs(P, -1);
	forn(i,1,n) printf("%d%c", res[i], " \n"[i == n]);
	return 0;
}

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

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

#ifdef LOCAL
    #define eprintf(...) fprintf(stderr, __VA_ARGS__)
#else
    #define eprintf(...)
#endif

#define rep_(i, a_, b_, a, b, ...) for (int i = (a), i##_len = (b); i < i##_len; ++i)
#define rep(i, ...) rep_(i, __VA_ARGS__, __VA_ARGS__, 0, __VA_ARGS__)
#define reprev_(i, a_, b_, a, b, ...) for (int i = (b)-1, i##_min = (a); i >= i##_min; --i)
#define reprev(i, ...) reprev_(i, __VA_ARGS__, __VA_ARGS__, 0, __VA_ARGS__)
#define all(x) (x).begin(), (x).end()
template <class T> bool chmax(T &a, const T &b) { if (a < b) { a = b; return 1; } return 0; }
template <class T> bool chmin(T &a, const T &b) { if (b < a) { a = b; return 1; } return 0; }
#define fls(x) (64 - __builtin_clzll(x))
#define pcnt(x) __builtin_popcountll(x)
using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef pair <int,int> P;
typedef long double ld;

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

int main (void)
{
    cin.tie(0);
    ios::sync_with_stdio(false);
    ll h, w; cin >> h >> w;
    vector<string> s(h); rep (i, h) cin >> s[i];
    ll ans = 0;
    rep (i, h - 1) rep (j, w - 1) {
        int x = 0;
        rep (p, 2) rep (q, 2) x += (s[i + p][j + q] == '#');
        if (x == 1 || x == 3) ans++;
    }
    cout << ans << "\n";
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
#define ll  long long
#define ull unsigned long long
#define lld long double
#define pii pair<int,int>
#define pll pair<ll,ll>
#define pb push_back
#define f first
#define s second
#define mk make_pair

/*----------------------DEBUGGER---------------------------*/
#ifndef ONLINE_JUDGE
#define debug(x) cerr << #x <<" "; _print(x); cerr << endl;
#else
#define debug(x)
#endif

void _print(ll t) {cerr << t;}
void _print(int t) {cerr << t;}
void _print(string t) {cerr << t;}
void _print(char t) {cerr << t;}
void _print(lld t) {cerr << t;}
void _print(double t) {cerr << t;}
void _print(ull t) {cerr << t;}

template <class T, class V> void _print(pair <T, V> p);
template <class T> void _print(vector <T> v);
template <class T> void _print(set <T> v);
template <class T, class V> void _print(map <T, V> v);
template <class T> void _print(multiset <T> v);
template <class T, class V> void _print(pair <T, V> p) {cerr << "{"; _print(p.f); cerr << ","; _print(p.s); cerr << "}";}
template <class T> void _print(vector <T> v) {cerr << "[ "; for (T i : v) {_print(i); cerr << " ";} cerr << "]";}
template <class T> void _print(set <T> v) {cerr << "[ "; for (T i : v) {_print(i); cerr << " ";} cerr << "]";}
template <class T> void _print(multiset <T> v) {cerr << "[ "; for (T i : v) {_print(i); cerr << " ";} cerr << "]";}
template <class T, class V> void _print(map <T, V> v) {cerr << "[ "; for (auto i : v) {_print(i); cerr << " ";} cerr << "]";}
/*----------------------DEBUGGER---------------------------*/

int main()
{
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
#ifndef ONLINE_JUDGE
  freopen("input.txt", "r", stdin);
  freopen("output.txt", "w", stdout);
  freopen("error.txt", "w", stderr);
#endif
  int t = 1;
  //cin >> t;
  while (t--)
  {
    int n;
    cin >> n;
    cout << 6 << " " << 15 << " " << 10 << " ";
    int cnt = 0;
    for (int i = 2; i <= 10000; i++)
    {
      if (i == 6 || i == 15 || i == 10)
        continue;
      if (cnt == n - 3)
        break;
      if (__gcd(i, 6) > 1 && __gcd(i, 15) > 1 && __gcd(i, 10) > 1) {
        cout << i << " ";
        cnt++;
      }
    }
  }//while
}//main

#include <bits/stdc++.h>

#define MONKE 0
#define vt(x) vector < x >
#define p(x, y) pair < x, y >
#define M 1000000007
#define fl(i, a, b) for(int i = a; i < b; ++i)
#define fld(i, a, b) for(int i = a; i >= b; --i)

typedef long long ll;
typedef long double ld;

using namespace std;

int main() {
    ios_base::sync_with_stdio(MONKE); //unsync uWu
    cin.tie(MONKE); //cin-cout unsync uWu
    int n;
    cin >> n;
    vector < int > ans(n);
    ans[0] = 6;
    ans[1] = 10;
    ans[2] = 15;
    int num = 18;
    for (int i = 3; i < n; ++i) {
        while ((num % 6) && (num % 10) && (num % 15)) num++;
        ans[i] = num++;
    }
    for (int i = 0; i < n; ++i) cout << ans[i] << " ";
    return MONKE;
}


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

#define int long long int
typedef pair<int, int> pii;
#define f(i,a,b) for(int i=a;i<b;i++)
#define fo(i,a,b) for(int i = a; i<=b;i+=1)
// #define Vector vector
#define rf(i,a,b)  for(int i=a;i>=b;i--)
#define vll vector<int>
#define sz(a) int(a.size())
#define all(v) v.begin(), v.end()
#define pb push_back
#define pf push_front
#define MAXN 100010
#define MOD 1000000007
#define mod 998244353
#define deb(x) cout << '>' << #x << ':' << x << endl;
#define debug(x) cout << '>' << #x << ':' << x << " ";
#define nl '\n'
#define MS(x,y) fill_n(*x, sizeof x / sizeof **x, y);
#define mem(x,y) memset(x,y,sizeof(x));
#define INF 1000000000000000000
#define IO                 \
    ios::sync_with_stdio(0); \
    cin.tie(0);              \
    cout.tie(0);

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

    stack<char> stk;

    char prev = '*', prevprev = '*';

    for(int i = 0; i < n; i++){
        if(stk.empty()){
            stk.push(s[i]);
        }
        else {
            if(s[i] == 'x' and stk.size() >= 2){
                prev = stk.top();
                stk.pop();
                prevprev = stk.top();
                stk.pop();
                if(prev == 'o' and prevprev == 'f'){

                }
                else {
                    stk.push(prevprev);
                    stk.push(prev);
                    stk.push(s[i]);
                }
            }
            else {
                stk.push(s[i]);
            }
        }
    }
    cout << stk.size() << nl;
    return ;
}
main()
{
    IO;
    int T = 1;
    // cin >> T;
    for(int c=1; c <= T; c++){
        solve();
        // cout<<"Case #"<<c<<": ";
    }
    return 0;
}

#include <bits/stdc++.h>

#define ll long long
#define map unordered_map
#define set unordered_set
#define l_l pair<ll, ll>
#define P pair<ll, ll>
#define vll vector<ll>
#define mll map<ll, ll>
#define mp make_pair
#define rep(i, n) for (int i = 0, i##_len = (n); i < i##_len; ++i)
#define reps(i, n) for (int i = 1, i##_len = (n); i <= i##_len; ++i)
#define rev(i, n) for (int i = ((int)(n)-1); i >= 0; --i)
#define revs(i, n) for (int i = ((int)(n)); i > 0; --i)
// template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
// template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; }

using namespace std;

const ll MOD = 1000000007LL;
const ll INF = (1LL << 60LL);

// template <class T> void plus_mod(T &a, const T &b) {a = (a + b) % MOD;}

int main() {
  // std::cout << std::fixed << std::setprecision(10);

  ll r1, c1;
  scanf("%lld %lld", &r1, &c1);

  ll r2, c2;
  scanf("%lld %lld", &r2, &c2);

  ll dist = abs(r2 - r1) + abs(c2 - c1);

  if (dist <= 0) {
    cout << (0) << endl;
    return 0;
  }

  if (dist <= 3) {
    cout << (1) << endl;
    return 0;
  }

  ll sr = abs(r2 - r1);
  ll sc = abs(c2 - c1);
  if (abs(sr - sc) == 0) {
    // 1ワープ
    cout << (1) << endl;
    return 0;
  } else if (abs(sr - sc) <= 3) {
    // 1ワープ+徒歩
    cout << (2) << endl;
    return 0;
  } else {
    if (dist % 2 == 0) {
      // 2ワープ
      cout << (2) << endl;
      return 0;
    } else {
      // 2ワープ+徒歩
      if (dist <= 6) {
        cout << (2) << endl;
        return 0;
      }
      cout << (3) << endl;
      return 0;
    }
  }
}


// E - White Pawn
#include <bits/stdc++.h>
using namespace std;

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

	map<int,vector<int>> D;
	while(M--){
		int x, y; cin>>x>>y;
		D[x].push_back(y);
	}

	set<int> S({N});
	for(auto&[x, Y]:D){
		vector<int> A;
		for(int&y:Y)
			if(S.count(y-1) || S.count(y+1)) A.push_back(y);
		for(int&y:Y) if(S.count(y)) S.erase(y);
		for(int&y:A) S.insert(y);
	}
	cout<< S.size() <<endl;
}

//#pragma GCC optimize("Ofast")
#include <bits/stdc++.h>
#define rep2(a,i,n) for(ll i=(a);i<(n);i++)
#define rep(i,n) for(ll i=0;i<(n);i++)
#define pii pair<int, int>
#define pll pair<ll, ll>
#define cinf(x,n) for(ll i=0;i<(n);i++)cin>>x[i];
#define coutf(x,n) for(ll i=0;i<(n);i++)cout<<x[i]<<endl;
typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;

using namespace std;

int main(){
	//ios::sync_with_stdio(false);
	//cin.tie(nullptr);
	//cout<<fixed<<setprecision(20);
	vector<int> a(3);
	cinf(a,3);
	sort(a.begin(),a.end());
	cout << a[1]+a[2] << endl;
}


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

#define int long long
#define pb push_back
#define f(i,a,n) for(int i=a ; i<n ; i++)
#define rf(i,n,a) for(int i=n ; i>=a ; i--)
#define F first
#define S second
#define all(c) (c).begin(),(c).end()
#define sz(v) (int)(v).size()
#define fast ios::sync_with_stdio(0); cin.tie(0); cout.tie(0)

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

const int inf = 1e9;
const int inf64 = 1e18;
const int MOD = inf + 7;

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

   int m;
   cin >> m;

   int a[m+2];
   f(i,0,m) cin >> a[i];

   a[m] = 0;
   a[m+1] = n+1;

   sort(a, a+m+2);
   int gc = n;
   f(i,0,m+1) if(a[i+1] != a[i] + 1) gc = min(gc, a[i+1] - a[i] - 1);

   int ans = 0;
   f(i,0,m+1) ans += (a[i+1] - a[i] - 1 + gc - 1)/gc;

   cout << ans << "\n";

}

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


#include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
typedef pair<int,int> P;
typedef pair<ll,ll> Pll;
typedef pair<string,string> Pstring;
typedef pair<double,double> Pdouble;

#define REP(i,n) for(ll i=0;i<n;i++)
#define REP1(i,n) for(ll i=1;i<=n;i++)
#define Precision13 cout << fixed << setprecision(13)
const double PI=3.14159265358979323846;
const int MAX = 510000;
const int MOD = 1000000007;
const int INF = 1<<29;
using Graph = vector<vector<int>>;

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

  ll i = 1;

  ll sum = 0;
  while(true){
    sum += i;

    if(sum>=n){
      cout << i <<endl;
      return 0;
    }

    i++;
  }

}

#include<cstdio>
#include<cmath>
#include<cstring>
#include<iostream>
#include<algorithm>
#include<vector>
#include<set>
using namespace std;
#define MAXN 500005
#define lowbit(x) (x&-x)
#define reg register
typedef long long LL;
typedef unsigned long long uLL;
typedef unsigned int uint;
typedef pair<int,int> pii;
const int INF=0x7f7f7f7f;
const int mo=998244353;
const double PI=acos(-1.0);
template<typename _T>
_T Fabs(_T x){return x<0?-x:x;}
template<typename _T>
void read(_T &x){
	_T f=1;x=0;char s=getchar();
	while(s>'9'||s<'0'){if(s=='-')f=-1;s=getchar();}
	while('0'<=s&&s<='9'){x=(x<<3)+(x<<1)+(s^48);s=getchar();}
	x*=f;
}
char str[MAXN],ans[MAXN<<2],sta[MAXN];int n,head,tail,stak;
signed main(){
	scanf("%s",str+1);n=(int)strlen(str+1);head=tail=2*n;
	for(int i=1;i<=n;i++){
		if(str[i]=='R'){
			if(head!=tail){
				swap(head,tail);
				if(head<tail)head++,tail++;
				else head--,tail--;
			}
		}
		else{
			if(head<=tail)ans[tail]=str[i],tail++;
			else ans[tail]=str[i],tail--;
		}
		//printf("%d %d:%c\n",head,tail,ans[i]);
		//if(head<tail)for(int i=head;i<tail;i++)putchar(ans[i]);
		//else for(int i=head;i>tail;i--)putchar(ans[i]);puts("");
	}
	if(head<tail)
		for(int i=head;i<tail;i++)
			if(sta[stak]==ans[i])stak--;
			else sta[++stak]=ans[i];
	else
		for(int i=head;i>tail;i--)
			if(sta[stak]==ans[i])stak--;
			else sta[++stak]=ans[i];
	for(int i=1;i<=stak;i++)putchar(sta[i]);
	return 0;
}


#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  cin >> N;
  int sum = 0;
  for (int i = 0; i < N; i++) {
    int nuts;
    cin >> nuts;
    if (nuts > 10) {
      sum += (nuts - 10);
    }
    else {
    }
  }
  cout << sum << endl;
}

/* dont stick to an approach */
#include <iostream>
#include <iomanip>
#include <cmath>
#include <string>
#include <algorithm>
#include <list>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <unordered_map>
#include <vector>
#include <numeric>
#include <cstdlib>
#include <bitset>

using namespace std;

typedef long long ll;
typedef unsigned long long int ull;
typedef long double ldb;

#define PB push_back

#define For(i, n) for (ll i = 0; i < n; i++)

#define trav(a,x) for (auto& a : x)

#define PYES cout<<"YES\n"
#define PNO cout<<"NO\n"
#define PYes cout<<"Yes\n"
#define PNo cout<<"No\n"
#define endl '\n'

#define sq(x)           (x*x)

#define vll             vector<ll>
#define pll             pair<ll,ll>
#define ff              first
#define ss              second
#define rev(v)          reverse(v.begin(),v.end())
#define srt(v)          sort(v.begin(),v.end())
#define grtsrt(v)       sort(v.begin(),v.end(),greater<int>())
#define mnv(v)          *min_element(v.begin(),v.end())
#define mxv(v)          *max_element(v.begin(),v.end())
#define all(v)          v.begin(),v.end()
#define ACC(v)          accumulate(v.begin(),v.end(),0ll)

#define Fas ios::sync_with_stdio(0), cin.tie(0), cout.tie(0)

//--------------------------------------------functions-------------------------------------------------//

ll power(ll a,ll b){ll result=1;while(b>0){if(b%2 == 1){result *= a;} a *= a;b /= 2;}return result;}
ll gcd(ll x,ll y){ll r;while(y!=0&&(r=x%y)!=0){x=y;y=r;}return y==0?x:y;}
ll countSetBits(ll x){ll Count=0;while(x>0){if(x&1) Count++;x=x>>1;}return Count;}
bool isPerfectSquare(ll n){ll sr = sqrt(n);if (sr * sr == n)return true;else return false;}
ll mod(ll x,ll M){return ((x%M + M)%M);}
ll add(ll a, ll b,ll M){return mod(mod(a,M)+mod(b,M),M);}
ll mul(ll a, ll b,ll M){return mod(mod(a,M)*mod(b,M),M);}
ll powerM(ll a,ll b,ll M){
    ll res=1ll;
    while(b){
        if(b%2ll==1ll){
            res=mul(a,res,M);
        }
        a=mul(a,a,M);b/=2ll;
    }
    return res;
}
//------------------------------------sieve of erantothenes-----------------------------------------------//
//ll MAXN=2*1e5+100;
//vector<ll> fact(MAXN);
//void sieve_of_erantothenes()
//{
//    fact[1] = 1;
//    for (ll i = 2; i <= MAXN; i++)
//        fact[i] = i;
//    for (ll i = 4; i <= MAXN; i += 2)
//        fact[i] = 2;
//    for (ll i = 3; i * i <= MAXN; i++){
//        if (fact[i] == i){
//            for (ll j = i * i; j <= MAXN; j += i)
//                if (fact[j] == j)
//                    fact[j] = i;
//        }
//    }
//}
//----------------------------------------nCr mod------------------------------------------------------//
ll nCr(ll n, ll k){
    if(n<k) return 0;
    if(k==0) return 1;
    ll res = 1;
    if (k > n - k) k = n - k;
    for(ll i = 0; i < k; ++i){
        res *= (n - i);
        res /= (i + 1);
    }
    return res;
}

ll modInverse(ll n,ll M){
    return powerM(n,M-2,M);
}
ll nCrM(ll n,ll r,ll M){
    if(n<r) return 0;
    if(r==0) return 1;
    vector<ll> fact(n+1);
    fact[0]=1;
    for(ll i=1;i<=n;i++){
        fact[i]=mul(fact[i-1],i,M);
    }
    return mul(mul(fact[n],modInverse(fact[r],M),M),modInverse(fact[n-r],M),M);
}
//-----------------------------------------------solve-----------------------------------------------------//

void solve(){
    ll n;cin>>n;
    cout<<ceil((ldb)(n)/100)<<endl;
}

int main(){
    Fas;

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

//    ll t=0;
//    cin>>t;
//    while(t--)

        solve();

    return 0;
}


#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define pii pair<int,int>
#define pb push_back
#define mp make_pair
#define vi vector<int>
#define vll vector<ll>
const int maxn = 2e5 + 5;
const int mod = 1e9 + 7;
int a[maxn];
ll dp[maxn][17];
int states;
int main()
{
    ios::sync_with_stdio(false);
    string b; cin >> b;
    int n = b.size();
    int t; cin >> t;
    for (int i = 1 ; i <= n ; i++){
        if (isdigit(b[i - 1])) a[i] = b[i - 1] - '0';
        else a[i] = b[i - 1] - 'A' + 10;
    }
    for (int i = 0 ; i < n ; i++){
        for (int j = 1 ; j <= 16 ; j++){
            dp[i + 1][j] = (dp[i + 1][j] + dp[i][j] * j%mod)%mod;
            dp[i + 1][j + 1] = (dp[i + 1][j + 1] + dp[i][j] * (16 - j)%mod)%mod;
        }
        // 0
        dp[i + 1][0] = (dp[i + 1][0] + dp[i][0])%mod;
        dp[i + 1][1] = (dp[i + 1][1] + dp[i][0] * 15 % mod) % mod;
        for (int j = 0 ; j < a[i + 1] ; j++){
            int ns = states;
            // i = 0 , j = 0 只会发生在填第一位的时候，要特判
            if (i || j) ns |= (1 << j);
            dp[i + 1][__builtin_popcount(ns)] += 1;
        }

        states |= (1 << a[i + 1]);
    }
    cout << dp[n][t] + (t == __builtin_popcount(states)) << endl;
    return 0;
}

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

template<typename T>
struct UnionFind {
	vector<int> d;
	//コンストラクタ
	UnionFind(int n = 0) : d(n, -1) {}
	//根の探索と張り替え
	int find(int x) {
		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;
		//大きい方に小さい方をくっつける
		if (x < y) swap(x, y);
		//サイズの更新
		d[x] += d[y];
		//結合
		d[y] = x;
		return true;
	}
	//サイズの取得
	int size(int x) { return -d[find(x)]; }
	//同じ集合に属しているか
	bool same(int x, int y) { return (find(x) == find(y)); }
};

const int top = 100;
const int bottom = -100;

double dist(int x1, int x2, int y1, int y2)
{
    double dx = (double) x1-x2;
    double dy = (double) y1-y2;
    return dx*dx+dy*dy;
}

int main()
{
    int n; cin >> n;
    vector<int> x(n);
    vector<int> y(n);
    rep(i,n) cin >> x[i] >> y[i];

    double up = 200, low = 0;

    rep(bi,80)
    {
        double mid = (up+low)/2;
        UnionFind<int> uf(n+2);
        //壁同士の判定
        if(top-mid < bottom + mid) uf.unite(n,n+1);
        //上下の壁との判定
        rep(i,n)
        {
            if(y[i] + mid > top - mid) uf.unite(i,n);
            if(y[i] - mid < bottom + mid) uf.unite(i,n+1);
        }
        //釘同士の判定
        rep(i,n)rep(j,n)
        {
            if(i > j) continue;
            if(dist(x[i],x[j],y[i],y[j]) < 4*mid*mid) uf.unite(i,j);
        }
        if(uf.same(n,n+1)) up = mid;
        else low = mid;
    }
    cout << setprecision(7) <<endl;
    cout << low << endl;
}


#include <bits/stdc++.h>
#define rep(i,l,r) for(int i=l,i##_end=r;i<i##_end;++i)
#define all(v) v.begin(), v.end()
#define sz(x) ((int)(x).size())
#define uniera(v) v.erase(unique(all(v)), v.end())
using namespace std;
using ll = long long;
using P = pair<int, int>;

int main(){
  int n, k;
  cin >> n >> k;
  int sum = 0;
  rep(i, 1, n + 1){
    rep(j, 1, k + 1){
      sum += i * 100 + j;
    }
  }
  cout << sum << endl;
  return 0;
}

#include<bits/stdc++.h>
using namespace std;
#define int long long
#define fast ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0)
signed main()
{
    fast;
    int n,k;
    cin>>n>>k;
    int sum=(k*(k+1))/2;
    sum*=n;
    int ans=(n*(n+1))/2;
    ans*=100;
    ans*=k;
    ans+=sum;
    cout<<ans<<"\n";
    return 0;
}


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

const int MAX = 55;
const ll MOD = 998'244'353;

// input
int N, K;
vector<vi> A, B;

ll perm[MAX];

void input() {
    cin >> N >> K;
    A = B = vector<vi>(N, vi(N));
    rep(i, N) rep(j, N) {
        cin >> A[i][j];
        B[j][i] = A[i][j];
    }
}

struct UnionFind {
    vector<int> par;
    map<int, int> groups;

    UnionFind(int n) : par(n) {
        rep(i, n) par[i] = i;
        rep(i, n) groups[i] = 1;
    }

    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 (groups[rx] < groups[ry]) swap(rx, ry);
        groups[rx] += groups[ry];
        groups.erase(ry);
        par[ry] = rx;
    }

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

bool swap_ok(vector<vi> &w, int a, int b) {
    rep(i, N) {
        if (w[a][i] + w[b][i] > K) return false;
    }
    return true;
}

vector<P> link(vector<vi> w) {
    vector<P> ret;
    rep(a, N) {
        for (int b = a + 1; b < N; b++) {
            if (swap_ok(w, a, b)) ret.push_back(P(a, b));
        }
    }
    return ret;
}

ll f(vector<P> &l) {
    UnionFind uf(N);
    for (P p : l) {
        uf.unite(p.first, p.second);
    }
    ll ret = 1;
    for (auto p : uf.groups) {
        ret *= perm[p.second];
        ret %= MOD;
    }
    return ret;
}

int main() {
    input();
    perm[0] = 1;
    for (int i = 1; i < MAX; i++) perm[i] = i * perm[i - 1] % MOD;
    vector<P> row_link = link(A);
    vector<P> col_link = link(B);
    ll ans = f(row_link) * f(col_link) % MOD;
    cout << ans << endl;
}

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

template<typename T>
int ex(T p){
  T a = 1;
  if(p == 0){
    return a;
  }
  else{
    for(T i = 1; i <= p; i++){
      a = a*i%1000000007;
    }
    return a;
  }
}
template<typename T>
int eq(T p, T q){
    T r,s = 0,nextp,prevp = 0,prev2p = 1;
    if(q != 1){
        while(s != 1){
            r = p/q; s = p%q;
            nextp = prevp;
            prevp = prev2p - r * prevp;
            prev2p = nextp;
            p = q; q = s;
        }
    return prevp;
    }
    else{
      return 0;
    }
}
template<typename T>
int com(T p,T q){
  T a,b,c,mod = 1000000007;
  a = ex(p);
  b = ex(q);
  for(T i = 1; i <= p-q; i++){
    b = b*i%mod;
  }
  if(b != 1){
    c = ((1 - eq(mod,b)*mod )/b + mod) %mod;
  }
  else{
    c = 1;
  }
  return a*c%mod;
}
template<typename T>
int gcd(T p,T q){
    T s;
    while(q != 0){
        s = p%q;
        p = q; q = s;
    }
    return p;
}
int main() {
  string S;
  cin >> S;
  cout << S[1] << S[2] << S[0] << endl;
}


#include <bits/stdc++.h>
using namespace std;
int main(){
 int pass;
 int ans=0;
 string s;
  for(int i=0; i<10; i++){
  	cin >> s ;
  }

 for(int i=0; i<10000; i++){
    vector<int>a(10);
    pass=i;
 	for(int j=0; j<4; j++){

      	a.at(pass%10)=1;
        pass/=10;

          }
   bool ok=true;
   for(int k=0; k<10; k++){
   	if(s[k]=='o' && a.at(k)!=1) ok=false;
    if(s[k]=='x' && a.at(k)!=0) ok=false;
   }
   if(ok) ans++;
 }
  cout << ans << endl;
}

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

map<int, int> mp;

void prime_factor(int x) {
  for (int i = 2; i * i <= x; i++) {
    if (x % i != 0) continue;
    while (x % i == 0) x /= i;
    mp[i]++;
  }
  if (x != 1) mp[x]++;
  return;
}

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

  rep(i, n) prime_factor(a[i]);

  int ans = 0;
  int temp = 0;
  for (auto x : mp) {
    temp = max(temp, x.second);
    if (temp == x.second) ans = x.first;
  }

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


#include <bits/stdc++.h>
using namespace std;
int main() {
	ios_base::sync_with_stdio(false);
	cin.tie(0);
	int n;
	string s;
	cin>>n>>s;
	vector<int>dp(n,1e9);
	vector<vector<int> >diff(26);
	for(int i=0;i<26;i++)
		for(int j=0;j<n;j++)
			if(s[j]!=i+'a') diff[i].push_back(j);
	vector<priority_queue<int> >pq(26);
	for(int i=1;i<n;i++) {
		if(pq[s[i]-'a'].empty()) {
			for(int j=0;j<diff[s[i]-'a'].size()&&diff[s[i]-'a'][j]<i;j++)
				dp[i]=min(dp[i],(diff[s[i]-'a'][j]?dp[diff[s[i]-'a'][j]-1]:0)+1);
			pq[s[i]-'a'].push(-dp[i]);
		}
		else dp[i]=-pq[s[i]-'a'].top();
	}
	if(dp[n-1]>=1e9) cout<<-1;
	else cout<<dp[n-1];
	return 0;
}

#pragma GCC optimize("Ofast,unroll-loops")
#pragma GCC target("avx,avx2,sse4,fma")

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

using ll = long long;
using ld = long double;
using uint = unsigned int;
using ull = unsigned long long;

using vl = vector<ll>;
using vi = vector<int>;
using vb = vector<bool>;

using pll = pair<ll, ll>;
using pii = pair<int, int>;
using vpi = vector<pii>;

using rng = default_random_engine;

template <typename T>
using minpq = priority_queue<T, vector<T>, greater<T>>;

#define F first
#define S second
#define lb lower_bound
#define ub upper_bound
#define np next_permutation
#define sz(v) int(v.size())
#define all(v) begin(v), end(v)
#define popcnt __builtin_popcount

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

const int INF = 2000069420;
const int M1 = 1'000'000'007;
const int M2 =   998'244'353;
const int maxn = 1'000'005;
const int maxg = 2'005;

inline ull absul(ull a, ull b) {
	return a < b ? b-a : a-b;
}

char ch;
int mp[256];
vector<ull> b[3];

void solve() {
	mp['R'] = 0;
	mp['G'] = 1;
	mp['B'] = 2;
	int n; cin >> n;
	for (ull a; cin >> a >> ch;)
		b[mp[ch]].push_back(a);

	vi ext;
	for (int i = 0; i < 3; ++i) {
		sort(all(b[i]));
		if (sz(b[i]) & 1)
			ext.push_back(i);
	}

	if (!sz(ext)) {
		cout << "0\n";
		return void();
	}

	assert(sz(ext) == 2);

	int i = ext[0], j = ext[1];
	ull mn = 18e18;
	// try combining two dogs from clans i and j
	for (const ull &v: b[i]) {
		auto it1 = lb(all(b[j]), v);
		auto it2 = ub(all(b[j]), v);
		if (it1 == b[j].end())--it1;
		if (it2 != b[j].begin())--it2;
		mn = min({mn, absul(*it1,v), absul(*it2,v)});
	}

	// Try combining two extra dogs to the third clan
	int k = 3-i-j;

	cerr << "mn = " << mn << '\n';

	if (!sz(b[k])) {
		cout << mn << '\n';
		return void();
	}

	ull mn1 = 18e18, mn2 = 18e18;

	for (const ull &v: b[i]) {
		auto it1 = lb(all(b[k]), v);
		auto it2 = ub(all(b[k]), v);
		if (it1 == b[k].end())--it1;
		if (it2 != b[k].begin())--it2;
		mn1 = min({mn1, absul(*it1,v), absul(*it2,v)});
	}

	for (const ull &v: b[j]) {
		auto it1 = lb(all(b[k]), v);
		auto it2 = ub(all(b[k]), v);
		if (it1 == b[k].end())--it1;
		if (it2 != b[k].begin())--it2;
		mn2 = min({mn2, absul(*it1,v), absul(*it2,v)});
	}

	cerr << "mn1 = " << mn1 << '\n';
	cerr << "mn2 = " << mn2 << '\n';
	cerr << "mn1+mn2 = " << mn1+mn2 << '\n';

	cout << min(mn, mn1+mn2) << '\n';
}

int main() {
	cin.tie(nullptr) ->
	sync_with_stdio(false);

	int T = 1; // cin >> T;
	while (T--) solve();
}


#include <bits/stdc++.h>

using namespace std;

#define rep(i, n) for (ll i = 0; i < (n); ++i)
#define mp(p, q) make_pair(p, q)
#define pb(n) push_back(n)
#define all(a) a.begin(), a.end()

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

typedef vector<ll> vll;
typedef vector<ld> vd;
typedef vector<bool> vb;
typedef vector<char> vc;
typedef vector<str> vs;
typedef vector<vector<ll>> vvll;
typedef vector<vector<ld>> vvd;
typedef vector<vector<bool>> vvb;
typedef vector<vector<char>> vvc;
typedef vector<vector<str>> vvs;
typedef vector<pair<ll, ll>> vpll;

const ld PI = acos(-1.0);
const ll MAX = 9000000000000000000;
const ll MIN = -9000000000000000000;
const ll MOD = 1000000007;

template <typename T>
void fin(T a)
{
    cout << a << endl;
    exit(0);
}

void Main(void)
{
    vll deri(4); rep(i, 4) cin >> deri[i];
    ll bit = pow(2, 4);
    for(ll i = 1;i < bit - 1;i++)
    {
        ll a = 0, b = 0;
        ll tmp = i, count = 0;
        while(tmp)
        {
            if(tmp % 2) a += deri[count];
            else b += deri[count];
            tmp /= 2;
            count++;
        }
        if(a == b) fin("Yes");
    }
    fin("No");
    return;
}

int main(void)
{
    ios::sync_with_stdio(false);
    cin.tie(0);
    cout << fixed << setprecision(12); //高精度少数表示
    Main();
    return 0;
}

/*
Over Again
*/
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#define sz(v)   ((int)(v).size())
#define  all(v)    ((v).begin()),((v).end())
#define  allr(v)    ((v).rbegin()),((v).rend())
#define   pb         push_back
#define   mp         make_pair
#define    clr(v,d)      memset( v, d ,sizeof(v))
#define    lcm(a,b)                ((a*b)/(__gcd(a,b)))
#define     PI                       acos(-1)
#define   vec(a,b)       ((b)-(a))
#define   length(a)      hypot( (a.imag()),(a.real()) )
#define   normalize(a)      (a)/(length(a))
#define     point                    complex<double>
#define    dp(a,b)          (((conj(a))*(b)).real())
#define     same(p1,p2)               ( dp(  vec(p1,p2),vec(p1,p2)) < eps )
#define    rotate0( a,ang)    ((a)*exp( point(0,ang) ))
#define    rotateA(about,p,ang)   (rotate0(vec(about,p),ang)+about)
typedef  long long     ll ;
typedef  unsigned long long ull;
const double eps= (1e-9);
using namespace std;
using namespace __gnu_pbds;
int dcmp(double a,double b){   return fabs(a-b)<=eps ? 0: (a>b)? 1:-1  ;}
int getBit(ll num, int idx) {return ((num >> idx) & 1ll) == 1;}
int setBit1(int num, int idx) {return num | (1<<idx);}
ll setBit0(ll num, int idx) {return num & ~(1ll<<idx);}
ll flipBit(ll num, int idx) {return num ^ (1ll<<idx);}
void GO(){ ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);}
int countNumBit1(int mask) {int ret=0; while (mask) 	{mask &= (mask-1);++ret;	}return ret;}
const ll N=100000+5,mod=1000000007,sh=201,inf=2000000000;
typedef tree<
pair<ll,ll> ,
null_type,
less<pair<ll,ll> >,
rb_tree_tag,
tree_order_statistics_node_update>
ordered_set;

int main(){
     GO();

     int T=1;
     //cin>>T;
     while(T--){
            int a,b,c;
            cin>>a>>b>>c;

           cout<<max(a+b,max(a+c,b+c))<<"\n";

     }
}


#include <iostream>
#include <string>
#include <stdio.h>
#include <math.h>
#include <queue>
#include <algorithm>
#include <utility>
#include <vector>
#include <tuple>
#include <numeric>
using namespace std;

int main(int argc, char* argv[]){
int N,M;
cin >> N >> M;
vector<long long> A(N);
vector<long long> B(N);
vector <pair<int,int>> P(M);

long long sum_a = 0;
long long sum_b = 0;
for(int i=0;i<N;i++){
	cin >> A[i];
	sum_a += A[i];
}
for(int i=0;i<N;i++){
	cin >> B[i];
	sum_b += B[i];
}
vector<int> num(N,0);
for(int i=0;i<M;i++){
	int c,d, tmp;
	cin >> c >> d;
	if(c>d){
		tmp = c;
		c = d;
		d = tmp;
	}
	num[c-1]++;
	num[d-1]++;
	P[i] = make_pair(c, d);
}
bool flag = true;
for(int i=0; i<N; i++){
	if(num[i]==0 && A[i]!=B[i]){
		flag = false;
	}
}

if(sum_a != sum_b || flag==false){
	cout << "No" << endl;
}else{
	cout << "Yes" << endl;
}

return 0;

}

#include <bits/stdc++.h>

using namespace std;

typedef long long ll;
typedef long double ld;

typedef vector<int> vi;
typedef vector<ll> vll;

typedef vector<vi> vvi;
typedef vector<vll> vvll;

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

typedef vector<pii> vpii;
typedef vector<pll> vpll;

typedef vector<vpii> vvpii;
typedef vector<vpll> vvpll;

#define pb push_back
#define mp make_pair
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define sz(x) (int)(x).size()
#define fi first
#define se second

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

void __print(int x) {cerr << x;}
void __print(long long 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 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 z : x) cerr << (f++ ? "," : ""), __print(z); cerr << "}";}
void _print() {cerr << "]\n";}
template <typename T, typename... V>
void _print(T t, V... v) {__print(t); if(sizeof...(v)) cerr << ", "; _print(v...);}

#ifdef ljuba
#define dbg(x...) cerr << "LINE(" << __LINE__ << ") -> " << "[" << #x << "] = ["; _print(x)
#else
#define dbg(x...)
#endif

const char nl = '\n';

void solve() {
    vi v(4);
    for(auto &z : v)
        cin >> z;
    int sumica = accumulate(all(v), 0);
    for(int i = 1; i < (1<<4); ++i) {
        int suma = 0;
        for(int j = 0; j < 4; ++j) {
            if((i>>j)&1) {
                suma += v[j];
            }
        }
        if(suma * 2 == sumica) {
            cout << "Yes" << nl;
            return;
        }
    }

    cout << "No" << nl;
}

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

    int testCases = 1;
    //cin >> testCases;
    while(testCases--)
        solve();

}


#include <bits/stdc++.h>
#define int long long
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
using namespace std;
const int MOD = 1000000007;
const int INF = numeric_limits<int>::max() / 2;
typedef pair<int,int> P;
using Graph = vector<vector<int>>;

class UnionFind {
public:
    vector <int> par; // 各元の親を表す配列
    vector <int> siz; // 素集合のサイズを表す配列(1 で初期化)

    // Constructor
    UnionFind(int sz_): par(sz_), siz(sz_, (int)1) {
        for (int i = 0; i < sz_; ++i) par[i] = i; // 初期では親は自分自身
    }
    void init(int sz_) {
        par.resize(sz_);
        siz.assign(sz_, (int)1);
        for (int i = 0; i < sz_; ++i) par[i] = i; // 初期では親は自分自身
    }

    // Member Function
    // Find
    int root(int x) { // 根の検索
        while (par[x] != x) {
            x = par[x] = par[par[x]]; // x の親の親を x の親とする
        }
        return x;
    }

    // Union(Unite, Merge)
    bool merge(int x, int y) {
        x = root(x);
        y = root(y);
        if (x == y) return false;
        // merge technique（データ構造をマージするテク．小を大にくっつける）
        if (siz[x] < siz[y]) swap(x, y);
        siz[x] += siz[y];
        par[y] = x;
        return true;
    }

    bool issame(int x, int y) { // 連結判定
        return root(x) == root(y);
    }

    int size(int x) { // 素集合のサイズ
        return siz[root(x)];
    }
};

signed main() {
    int N;
    cin >> N;
    int A[N], B[N];
    UnionFind uf(400010);
    bool ok[400010]{};
    rep(i,N){
        cin >> A[i] >> B[i];
        if(uf.issame(A[i], B[i]) || A[i] == B[i]){
            ok[A[i]] = true;
        }
        else uf.merge(A[i], B[i]);
    }
    rep(i,400005){
        if(ok[i]){
            ok[uf.root(i)] = true;
        }
    }
    int ans = 0;
    rep(i,400005){
        if(ok[i] && uf.size(i) == 1) ++ans;
        else if(uf.size(i) == 1) continue;
        else if(uf.root(i) != i) continue;
        else if(ok[i]) ans += uf.size(i);
        else ans += uf.size(i) - 1;
    }
    cout << ans << endl;
}

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

//#define int		long long
#define pb		push_back
#define ppb		pop_back
#define pf		push_front
#define ppf		pop_front
#define all(x)		(x).begin(),(x).end()
#define uniq(v)		(v).erase(unique(all(v)),(v).end())
#define sz(x)		(int)((x).size())
#define fr		first
#define sc		second
#define pii		pair<int,int>
#define rep(i,a,b)	for(int i=a;i<b;i++)
#define mem1(a)		memset(a,-1,sizeof(a))
#define mem0(a)		memset(a,0,sizeof(a))
#define ppc		__builtin_popcount
#define ppcll		__builtin_popcountll
//#define rep(i, n) for (int i = 0; i < (int)(n); i++)

//template<typename T1,typename T2>istream& opertor>>(istream& in,pair<T1,T2> &a){in>>a.fr>>
//template<typename T1,typename T2>istream& opertor<<(ostream& out,pair<T1,T2> a){out<<a.fr<<
template<typename T,typename T1>T amax(T &a,T1 b){if(b>a)a=b;return a;}
template<typename T,typename T1>T amin(T &a,T1 b){if(b<a)a=b;return a;}
//template<class T> void chmin(T& a, T b){if(a>b)a=b;}
//template<class T> void chmax(T& a, T b){if(a<b)a=b;}

const long long INF=1e18;
const int32_t M=1e9+7;
const int32_t MM=998244353;

void out_vec_with_space(vector<auto> &v){
  for ( int i = 0; i < v.size(); i++ ){
      cout << ( i ? " " : "" ) << v[i];
  }
}

int main() {
  int A,B;
  cin >> A >> B;

  vector<int> E_plus(A),E_minus(B);
  rep(i,0,A) {
    E_plus[i] = i+1;
  }

  rep(i,0,B) {
    E_minus[i] = -i-1;
  }

  if(A<B){
    ll sum_B = 0;
    rep(i,A-1,B){
      sum_B += E_minus[i];
    }
    E_plus[A-1] = -sum_B;
  }else if(B<A){
    ll sum_A = 0;
    rep(i,B-1,A){
      sum_A += E_plus[i];
    }
    E_minus[B-1] = -sum_A;
  }

  out_vec_with_space(E_minus);
  cout << " ";
  out_vec_with_space(E_plus);
  cout << endl;

}


/////home/mohammed/.config/sublime-text-3/Packages/User

/*input

*/
#include <bits/stdc++.h>
#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include <numeric>
#include <math.h>
#include <sstream>
#include <iterator>
#include <cstdlib>
#include <unordered_map>
#include <map>
#include <list>
#include <set>

using namespace std;
using bin = std::bitset<8>;

#define endl ("\n")
#define pi (3.141592653589)
#define mod 1000000007
#define int int64_t
#define float double
#define ll long long
#define pb push_back
#define mp make_pair
#define ff first
#define ss second
#define all(c) c.begin(), c.end()
#define min3(a, b, c) min({a,b,c})
#define max3(a, b, c) max({a,b,c})
#define min4(a, b, c, d) min({a,b,c,d})
#define max4(a, b, c, d) max({a,b,c,d})
#define rrep(i, n) for(int i=n-1;i>=0;i--)
#define rep(i,n) for(int i=0;i<n;i++)
#define fast ios_base::sync_with_stdio(false), cin.tie(nullptr), cout.tie(nullptr)
#define ld long double
#define scanArray(a,n) for(int i = 0; i < n; i++){cin >> a[i];}
#define coutArray(a,n) for(int i = 0; i < n; i++){cout << a[i] << " ";};cout << endl;
#define input(type, n) type n; cin>>n;

struct debugger
{
	template<typename T> debugger& operator , (const T& v)
	{
		cerr << v << " ";
		return *this;
	}
} dbg;

bool check_key(map<int, int> m, int key)
{
	if (m.find(key) == m.end())
		return false;

	return true;
}

vector<int> SieveOfEratosthenes(int n)
{
	bool prime[n + 1];
	memset(prime, true, sizeof(prime));

	vector<int> res;
	for (int p = 2; p * p <= n; p++)
	{
		if (prime[p] == true)
		{
			for (int i = p * p; i <= n; i += p)
				prime[i] = false;
		}
	}

	for (int p = 2; p <= n; p++)
		if (prime[p])
			res.push_back(p);
	//cout << p << " ";
	return res;
}

// function to convert decimal to binary
bin decToBinary(int n)
{
	// array to store binary number
	int binaryNum[32];

	// counter for binary array
	int i = 0;
	while (n > 0) {

		// storing remainder in binary array
		binaryNum[i] = n % 2;
		n = n / 2;
		i++;
	}
	string x = "";
	// printing binary array in reverse order
	for (int j = i - 1; j >= 0; j--) {
		x += to_string(binaryNum[j]);
	}
	bin result{x};
	return result;
}
// for example:
// bin result = decToBinary(2);
// bin result2 = decToBinary(10);
// bin z = result xor result2;
// cout << z;
// return 0;
int convertBinaryToDecimal(long long n)
{
	int decimalNumber = 0, i = 0, remainder;
	while (n != 0)
	{
		remainder = n % 10;
		n /= 10;
		decimalNumber += remainder * pow(2, i);
		++i;
	}
	return decimalNumber;
}
int factorial(int n) {

	long long res = 1;
	for (int i = 1; i <= n; i++) {
		res = ((res * i) % mod + mod) % mod ;
	}
	return res;
}

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

	input(string, s);
	rep(i, s.size()) {
		if (s[i] == '.') {
			return 0;
		}
		cout << s[i];
	}

}

#pragma GCC target("avx2")
#pragma GCC optimize("O3")
#pragma GCC optimize("unroll-loops")
#include<iostream>
#include<cstdint>
#include<cstddef>
#include<vector>
#include<iomanip>
#include<cstring>
//#include<atcoder/all>
//using namespace atcoder;
using namespace std;
using i32 = int_fast32_t;
using i64 = int_fast64_t;
using f64 = long double;
using usize = uint_fast64_t;
template<typename T>
using vec = vector<T>;
#define rep(i, n) for (i64 i = 0; i < (i64)(n); ++i)
#define all(a) (a).begin(),(a).end()
#define rall(a) (a).rbegin(),(a).rend()
using P = pair<i64,i64>;
i64 a,b,c;
i64 sum;
f64 dp[101][101][101];
f64 solve(i64 x,i64 y,i64 z){
    if(dp[x][y][z])return dp[x][y][z];
    if(x == 100 || y == 100 ||  z == 100)return 0;
    f64 res = 0;
    res += x * (solve(x + 1, y,z) + 1) / (x + y + z);
    res += y * (solve(x,y + 1,z) + 1) / (x + y + z);
    res += z * (solve(x,y,z + 1) + 1) / (x + y + z);
    return dp[x][y][z] = res;
}
int main(){
    ios::sync_with_stdio(false);
    std::cin.tie(nullptr);
    cin >> a>> b >> c;
    cout << fixed << setprecision(10) << solve(a,b,c) << endl;
}


#include <bits/stdc++.h>
#define int long long
#define double long double
using namespace std;
const int MOD = 998244353;
const int INF = 1e18;
using Graph = vector<vector<int>>;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)

signed main(){
  string S;
  cin >> S;
  int N = (int)S.size();

  vector<pair<int, int>> ok;
  for (int bit = 0; bit < (1<<N); ++bit) {
    int now = 0;
    int cnt = 0;
    for (int i = 0; i < N; ++i) {
      if (bit & (1<<i)) { // i番目のbitが立っていれば
        int A = S[i]-'0';
        now = now*10 + A;
        cnt++;
      }
    }
    if( now == 0 ) continue;
    if( now%3 == 0 ){
      ok.push_back(make_pair(N-cnt, now));
    }
  }

  if( ok.size() == 0 ){
    cout << -1 << endl;
  }else{
    sort(ok.begin(), ok.end());
    cout << ok[0].first << endl;
  }

}

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

int main() {
  int N;
  cin >> N;
  vector<int> A(pow(2, N));
  for (int i = 0; i < pow(2, N); i++) cin >> A.at(i);

  int max1 = A.at(0), max2 = A.at(pow(2, N - 1));
  for (int i = 0; i < pow(2, N - 1); i++) {
    if (A.at(i) > max1)                 max1 = A.at(i);
    if (A.at(pow(2, N - 1) + i) > max2) max2 = A.at(pow(2, N - 1) + i);
  }

  int secondprize = min(max1, max2);

  for (int i = 0; i < pow(2, N); i++) {
    if (A.at(i) == secondprize) cout << i + 1 << endl;
  }

}


#pragma GCC optimize("Ofast")
#include<bits/stdc++.h>
#include<iostream>
#include<cmath>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace std;
using namespace __gnu_pbds;

#define mod 1000000007
#define one(x)   __builtin_popcountll(x)
#define zero(x)  __builtin_ctzll(x)
#define pp pair<ll,ll>
#define all(x) (x).begin(), (x).end()
#define removeDuplicates(a) a.resize(unique(all(a))-a.begin())
template<class T> using oset =tree<T, null_type, less<T>, rb_tree_tag,tree_order_statistics_node_update> ;
typedef long long int ll;

const int mxn = 2e6 + 10;

ll b[mxn];
ll a[mxn];
array<ll, 2> arr[mxn];

void subMain(){
    double x, y, z;
    cin >> x >> y >> z;
    //cout<<fixed<<setprecision(6);
    double ans=(y*1.00000)/x;

    ans=ans-0.000010;
    ans*=z;
    cout<<(int)(ans)<<"\n";
}

int main(){

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

	/*int t, i = 0;
	cin >> t;
	while(t--){
        //cout << "Case #" << i+1 << ": ";
        subMain();
        //i++;
	}*/
	subMain();
	cerr<<"Time : "<<1000*((double)clock())/(double)CLOCKS_PER_SEC<<"ms\n";
	return 0;
}

/* dont stick to an approach */
#include <iostream>
#include <iomanip>
#include <cmath>
#include <string>
#include <algorithm>
#include <list>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <unordered_map>
#include <vector>
#include <numeric>
#include <cstdlib>

using namespace std;

typedef long long ll;
typedef unsigned long long int ull;
typedef long double ldb;

#define PB push_back

#define For(i, n) for (ll i = 0; i < n; i++)

#define trav(a,x) for (auto& a : x)

#define PYES cout<<"YES\n"
#define PNO cout<<"NO\n"
#define PYes cout<<"Yes\n"
#define PNo cout<<"No\n"
#define endl '\n'

#define sq(x)           (x*x)

#define vll             vector<ll>
#define rev(v)          reverse(v.begin(),v.end())
#define srt(v)          sort(v.begin(),v.end())
#define grtsrt(v)       sort(v.begin(),v.end(),greater<int>())
#define mnv(v)          *min_element(v.begin(),v.end())
#define mxv(v)          *max_element(v.begin(),v.end())
#define all(v)          v.begin(),v.end()

#define Fas ios::sync_with_stdio(0), cin.tie(0), cout.tie(0)

//--------------------------------------------functions-------------------------------------------------//

ll power(ll a,ll b){ll result=1;while(b>0){if(b%2 == 1){result *= a;} a *= a;b /= 2;}return result;}
ll gcd(ll x,ll y){ll r;while(y!=0&&(r=x%y)!=0){x=y;y=r;}return y==0?x:y;}
ll countSetBits(ll x){ll Count=0;while(x>0){if(x&1) Count++;x=x>>1;}return Count;}
bool isPerfectSquare(ll n){ll sr = sqrt(n);if (sr * sr == n)return true;else return false;}
ll mod(ll x,ll M){return ((x%M + M)%M);}
ll add(ll a, ll b,ll M){return mod(mod(a,M)+mod(b,M),M);}
ll mul(ll a, ll b,ll M){return mod(mod(a,M)*mod(b,M),M);}
ll powerM(ll a,ll b,ll M){
    ll res=1ll;
    while(b){
        if(b%2ll==1ll){
            res=mul(a,res,M);
        }
        a=mul(a,a,M);b/=2ll;
    }
    return res;
}
//------------------------------------sieve of erantothenes-----------------------------------------------//
//ll MAXN=1e7+100;
//vector<ll> fact(MAXN);
//void sieve_of_erantothenes()
//{
//    fact[1] = 1;
//    for (ll i = 2; i <= MAXN; i++)
//        fact[i] = i;
//    for (ll i = 4; i <= MAXN; i += 2)
//        fact[i] = 2;
//    for (ll i = 3; i * i <= MAXN; i++){
//        if (fact[i] == i){
//            for (ll j = i * i; j <= MAXN; j += i)
//                if (fact[j] == j)
//                    fact[j] = i;
//        }
//    }
//}
//----------------------------------------nCr mod------------------------------------------------------//
ll modInverse(ll n,ll M){
    return powerM(n,M-2,M);
}
ll nCrM(ll n,ll r,ll M){
    if(n<r) return 0;
    if(r==0) return 1;
    vector<ll> fact(n+1);
    fact[0]=1;
    for(ll i=1;i<=n;i++){
        fact[i]=mul(fact[i-1],i,M);
    }
    return mul(mul(fact[n],modInverse(fact[r],M),M),modInverse(fact[n-r],M),M);
}
//-----------------------------------------------solve-----------------------------------------------------//
void solve(){
    ldb x,y,z;cin>>x>>y>>z;
    for(ll i=1000008;i>=0;i--){
        if(x*i<y*z){
            cout<<i<<endl;
            return;
        }
    }
}

int main(){
    Fas;

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

//    ll t=0;
//    cin>>t;
//    while(t--)
        solve();

    return 0;
}


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

#define ll long long
#define mp make_pair
#define pb push_back

#define eprintf(...) fprintf(stderr, __VA_ARGS__)
#define rep(i, n) for (int i = 0; i < (int)(n); ++ i)

int dp[3005][3005];

int main() {
	int n, k;
	cin >> n >> k;
	const int mod = 998244353;
	dp[0][k] = 1;
	rep(i, n + 1) rep(j, n + 1) if (i || j > k)
		dp[i][j] = (
				(i ? dp[i - 1][j + 1] : 0) +
				(j & 1 ? 0 : dp[i][j / 2])) % mod;
	cout << dp[n][0] << endl;
	return 0;
}

#include <iostream>
#include <math.h>
#include <cmath>
#include <algorithm>
#include <utility>
#include <vector>

#define ll long long

using namespace std;

int main() {
  int arr[3]={0,0,0};
  int x, y;
  cin >> x >> y;
  arr[x]++;
  arr[y]++;

  if(x==y){cout << x;}
  else{
    if(arr[0]==0){cout << "0";}
    else if(arr[1]==0){cout << "1";}
    else if(arr[2]==0){cout << "2";}
  }

}


#include <bits/stdc++.h>
#define mk make_pair
#define fs first
#define sc second
using namespace std;
typedef long long ll;
typedef long double ld;
// please, read the question correctly (do you need set or multiset)???
const int N=200010; //check the limits, dummy
int a[N];
int n, m, md;
int mem[101][101][101];
int dp(int x, int rm, int nm){
	if(nm==m){
		if(rm == md){
			return 0;
		}
		else{
			return -2e9;
		}
	}
	if(x>=n){
		return -2e9;
	}
	if(mem[x][rm][nm]!=-1){
		return mem[x][rm][nm];
	}
	ll res;
	res = max(dp(x+1, rm, nm), a[x]+dp(x+1, (rm+a[x])%m, nm+1));
	mem[x][rm][nm]=res;
	return res;
}
int main(){
	ll x;
	scanf("%d%lld",&n,&x);
	for(int i=0; i<n; ++i){
		scanf("%d",a+i);
	}
	ll ans = 10+1e18, tmp;
	for(ll i=1; i<=n; ++i){
		m = i;
		md = x%i;
		memset(mem, -1, sizeof mem);
		tmp = dp(0, 0, 0);
		if(tmp>=0){
			ans = min(ans, (x-tmp)/i);
		}
	}
	cout<<ans<<endl;
}

#pragma GCC optimize("Ofast","unroll-loops","omit-frame-pointer","inline")
#pragma GCC option("arch=native","tune=native","no-zero-upper")
#pragma GCC target("avx2")
#include <bits/stdc++.h>
using namespace std;
#define INF 2147483647
#define infL (1LL<<60)
#define inf (1<<30)
#define inf9 (1000000000)
#define MOD 1000000007//998244353//1000000007
#define EPS 1e-9
#define Gr 9.8
#define PI acos(-1)
#define REP(i,n) for(int (i)=0;(i)<(int)(n);(i)++)
#define REQ(i,n) for(int (i)=1;(i)<=(int)(n);(i)++)
#define lch (rt<<1)
#define rch (rt<<1|1)
#define readmp(n) for(int i=0,u,v;i<n;i++) {scanf("%d%d",&u,&v); mp[u].push_back(v); mp[v].push_back(u);}
typedef  long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef long double ld;
typedef unsigned int uint;
typedef unsigned long long ull;
typedef ll ValType;
template<typename  T> void maxtt(T& t1, T t2) {
    t1=max(t1,t2);
}
template<typename  T> void mintt(T& t1, T t2) {
    t1=min(t1,t2);
}
#define MAX (135)

bool debug = 0;
int n,m,k;
int dx[4] = {0,1,0,-1}, dy[4] = {1,0,-1,0};
string direc="RDLU";
const ll MOD2 = (ll)MOD * (ll)MOD;
ll ln, lk, lm;
void etp(bool f = 0) {
    puts(f ?"YES" : "NO");
    exit(0);
}
void addmod(int &x, int y, int mod = MOD){
    x+=y; if (x>=mod) x-=mod;
    if(x<0) x+=mod;
    assert(x>=0 && x<mod);
}
void et(int x=-1) {
    printf("%d\n", x); exit(0);
}
ll fastPow(ll x, ll y, int mod=MOD) {
    ll ans = 1;
    while(y>0) {
        if(y&1) ans = (x * ans)%mod;
        x = x*x%mod;
        y>>=1;
    }
    return ans;
}
ll gcd1(ll x, ll y) {
    return y?gcd1(y,x%y):x;
}

void fmain(int tid) {
    scanf("%d%lld", &n,&lk);
    vector<int> a(n+1, 0);
    REQ(i,n) scanf("%d", &a[i]);
    ll ans=infL;
    REQ(c, n) {
        vector<vector<vector<int>>> dp(n+1, vector<vector<int>>(c+1, vector<int>(c+1,-1)));
        dp[0][0][0]=0;
        REQ(i,n) {
            for(int j=0;j<=c;j++) REP(z,c) if (dp[i-1][j][z]!=-1) {
                maxtt(dp[i][j][z], dp[i-1][j][z]);
                if(j<c) maxtt(dp[i][j+1][(z+a[i])%c], dp[i-1][j][z] + a[i]);
            }
        }
        int z=lk%c;
        if (dp[n][c][z] != -1){
            ll tt= lk-dp[n][c][z];
            assert(tt%c==0);
            mintt(ans, tt/c);
        }
    }
    printf("%lld\n", ans);
}
int main() {
    int t=1;
//    init();
//    scanf("%d", &t);
    REQ(i,t) {
        fmain(i);
    }
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
const long long mod=998244353,INF=1e18;
#define ll long long
#define line cout<<"\n";
#define flush cout<<endl;
#define pll pair<ll,ll>
#define x first
#define y second
#define p_all(arr) for(auto i:arr){cout<<i<<" ";}cout<<"\n";
ll k,n;
vector<vector<ll> > tree;
ll cnt=0;
ll dfs(ll u,ll pa,ll num)
{
    ll ma1=0,ma2=0,mi=0;
    for(auto v:tree[u])
    {
        if(v!=pa)
        {
            ll temp=1LL+dfs(v,u,num);
            ma2=max(ma2,temp);
            mi=min(mi,temp);
            if(ma2>ma1)
            {
                swap(ma2,ma1);
            }
        }
    }
    if(mi<0&&abs(mi+1)>=ma1)
    {
        return mi;
    }
    if(ma1==num)
    {
        cnt++;
        ma1=-num-1;
    }
    else if(pa==-1)
    {
        if(ma1>=0)
        cnt++;
    }
    return ma1;
}
int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);cout.tie(NULL);
    ll t=1;
    // cin>>t;
    for(ll test=1;test<=t;test++)
    {
        cin>>n>>k;
        tree.resize(n);
        for(int i=0;i<n-1;i++)
        {
            ll u,v;
            cin>>u>>v;
            u--,v--;
            tree[u].push_back(v);
            tree[v].push_back(u);
        }
        ll l=1,r=n;
        while(l<r)
        {
            ll m=(l+r)/2;
            cnt=0;
            ll count1=dfs(0,-1,m);
            if(cnt<=k)
            {
                r=m;
            }
            else
            {
                l=m+1;
            }
        }
        cout<<l<<"\n";
    }
    return 0;
}

#include<algorithm>
#include<iostream>
#include<cstring>
#include<cstdio>
#include<vector>
//#define puts sdf
using std::vector;
//using std::cout;
//using std::endl;
using std::sort;
using std::swap;
using std::min;
using std::max;

int read(){//int 无负数
	int h=0;char c=getchar();
	while(c<'0'||c>'9')c=getchar();
	while(c>='0'&&c<='9')h=(h<<1)+(h<<3)+c-'0',c=getchar();
	return h;
}

const int MAXN=200100;
int K,n;
struct Edge{
    int to;
    int nxt;
}edge[MAXN<<1];
int frm[MAXN];
int cnt_e;

void insert_e(int u,int v){
    cnt_e++;
    edge[cnt_e].to=v;
    edge[cnt_e].nxt=frm[u];
    frm[u]=cnt_e;
}
int Fa[MAXN];

int Rt,mns,S;
int siz[MAXN];
bool vis[MAXN];
void get_rt(int x,int ff){
    siz[x]=1;int mxs=0;
    for(int i=frm[x];i;i=edge[i].nxt){
        int v=edge[i].to;if(v==ff||vis[v])continue;
        get_rt(v,x);
        siz[x]+=siz[v];
        mxs=max(mxs,siz[v]);
    }
    mxs=max(mxs,S-siz[x]);
    if(mxs<mns)Rt=x,mns=mxs;
}

int Dt[MAXN];//点分树上的深度
int dis[MAXN][21]; //x到点分树上深度为D的那个祖先的距离
int mndis[MAXN];//距离他最近的点

void get_dis1(int U,int x,int ff,int dep,int D){
    dis[x][D]=dep;
    for(int i=frm[x];i;i=edge[i].nxt){
        int v=edge[i].to;if(v==ff||vis[v])continue;
        get_dis1(U,v,x,dep+1,D);
    }
}

void divide(int x,int D){//D是点分树上的深度
    vis[x]=true;
    Dt[x]=D;
    get_dis1(x,x,x,0,D);
    for(int i=frm[x];i;i=edge[i].nxt){
        int v=edge[i].to;if(vis[v])continue;

        S=siz[v],mns=siz[v],get_rt(v,v);
        Fa[Rt]=x;divide(Rt,D+1);
    }
}

void Modify(int x){
    int rt=x;
    for(;rt;rt=Fa[rt]){
        mndis[rt]=min(mndis[rt],dis[x][Dt[rt]]);
//        cout<<"MODIFY"<<x<<" "<<rt<<" "<<mndis[rt]<<endl;
    }
}

bool Query(int x,int mid){
    int rt=x;
    for(;rt;rt=Fa[rt]){
//    	cout<<"QUERY "<<x<<' '<<rt<<" "<<mndis[rt]<<' '<<dis[x][Dt[rt]]<<endl;
        if(mndis[rt]+dis[x][Dt[rt]]<=mid)return true;
    }
    return false;
}

int fa[MAXN][19];
int dep[MAXN];
int qwq[MAXN];//按深度排序
bool cmp(int x,int y){
	return dep[x]>dep[y];
}
void pre_dfs(int x,int ff){
	fa[x][0]=ff;dep[x]=dep[ff]+1;
	for(int i=1;i<=18;i++)fa[x][i]=fa[fa[x][i-1]][i-1];
	for(int i=frm[x];i;i=edge[i].nxt){
		int v=edge[i].to;if(v==ff)continue;
		pre_dfs(v,x);
	}
}

int get_fa(int x,int k){
	int nw=x;
	for(int i=0;i<=18;i++){
		if(k&(1<<i))nw=fa[nw][i];
	}
	return nw;
}

bool ch_ck(int mid){
//	cout<<"MID"<<':'<<mid<<endl;
	memset(mndis,0x3f,sizeof(mndis));
//	for(int i=1;i<=n;i++)mndis[i]=-0x3f3f3f3f;
	int cnt=0;
	for(int i=1;i<=n;i++){
		int x=qwq[i];
		if(Query(x,mid))continue;
		int fk=get_fa(x,mid);
		cnt++;Modify(fk);
//		cout<<"WORK"<<x<<" "<<fk<<endl;
		if(cnt>K)return false;
	}
	return true;
}

int get_ans(){
	int l=0,r=n;
	while(l+1<r){
		int mid=(l+r)>>1;
		if(ch_ck(mid)){
			r=mid;
		}
		else l=mid+1;
	}
	if(l==r)return r;
	if(ch_ck(l))return l;
	return r;
}

int main(){
	n=read(),K=read();
    for(int i=1;i<=n-1;i++){
        int u=read(),v=read();
        insert_e(u,v),insert_e(v,u);
    }
    S=n,mns=n,get_rt(1,1);
    divide(Rt,0);
    pre_dfs(1,1);
    for(int i=1;i<=n;i++)qwq[i]=i;sort(qwq+1,qwq+n+1,cmp);
//    for(int i=1;i<=n;i++)cout<<qwq[i]<<" ";puts("");
//    for(int i=1;i<=n;i++){
//    	for(int j=0;j<=18;j++)cout<<fa[i][j]<<" ";puts("");
//	}
    printf("%d\n",get_ans());
	return 0;
}


#pragma GCC optimize("O3")   //
#include <bits/stdc++.h>
using namespace std;

#define rep(i, a, b) for(int i = a; i < (b); ++i)
#define per(i, b, a) for(int i = b - 1; i >= a; i--)
#define trav(a, x) for(auto& a : x)
#define all(x) x.begin(), x.end()
#define sz(x) (int)(x).size()
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef long double ld;
typedef unsigned long long ull;

unsigned seed = chrono::system_clock::now().time_since_epoch().count();
mt19937 eng(seed);

ll random2(){
    return (1ll << 31ll)*eng()+eng();
}

ll n,m,k,q,T;

const ll big = 1000000007;
const ll big2 = 1000000009;
const ll mod =  998244353;

const int MAXN = 400001;

vi X,Y,ind1,ind2;

bool comp1(int i, int j){
    return X[i] < X[j];
}

bool comp2(int i, int j){
    return Y[i] < Y[j];
}

set<ll> S;
vi nums;

void f(int i, int j){
    if(i == j)return;
    if(i > j)swap(i, j);
    if(S.find(ll(i)*MAXN + ll(j)) != S.end())return;
    S.insert(ll(i)*MAXN + ll(j));
    nums.push_back(max(abs(X[i]-X[j]), abs(Y[i]-Y[j])));
}

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

    //freopen("fhc.txt","r",stdin);
    //freopen("autput.txt","w",stdout);

    ll a,b,c,d,e;

    cin >> n;
    rep(c1,0,n){
        cin >> a >> b;
        X.push_back(a);
        Y.push_back(b);
        ind1.push_back(c1);
        ind2.push_back(c1);
    }
    sort(all(ind1), comp1);
    sort(all(ind2), comp2);

    rep(c1,0,n){
        f(ind1[0], c1);
        f(ind2[0], c1);
        f(ind1[n-1], c1);
        f(ind2[n-1], c1);
    }
    sort(all(nums));
    cout << nums[sz(nums)-2] << "\n";

    return 0;
}


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

#define M1 1000000007
#define M3 1000000009
#define M2 998244353
#define ll long long
#define ld long double
#define pll pair<ll,ll>
#define rep(i,a,b) for(ll i=a;i<b;i++)
#define repr(i,a,b) for(ll i=b-1;i>=a;i--)
#define forr(i,n) for(ll i=0;i<n;i++)
#define F first
#define S second
#define pb push_back
#define DB pop_back
#define mp make_pair
#define MT make_tuple
#define V(a) vector<a>
#define vi vector<ll>
#define endl '\n'
#define ce(ele) cout<<ele<<' '
#define cs(ele) cout<<ele<<'\n'
#define csv(v) for(int i=0;i<v.size();i++)cout<<v[i]<<' '
#define yep cout<<"YES"<<'\n'
#define nope cout<<"NO"<<'\n'
#define CASE(te) ll te; cin>>te; while(te--)
#define sor(v) sort(v.begin(),v.end())
#define rev(v) reverse(v.begin(),v.end())

void FAST() {
	ios::sync_with_stdio(0);
	cin.tie(0);
	cout.tie(0);
}
vi arr[2001];
int vis[2001];
void dfs(int node)
{
    vis[node]=1;

    for(auto x:arr[node])
    {
        if(vis[x]==0)
        {
            dfs(x);
        }
    }
}

int main()
{
  FAST();
  ll n,m;
  cin>>n>>m;
  forr(i,m)
  {
        ll a,b;
        cin>>a>>b;
        arr[a].push_back(b);
  }
  ll ans=0;
  for(int i=1;i<=n;i++)
  {
        dfs(i);
        ll c=0;
        for(int j=1;j<=n;j++)
        if(vis[j]==1)
        {
              c++;
              vis[j]=0;
        }

        ans+=c;
  }
  cs(ans);

}

#include <bits/stdc++.h>

using namespace std;

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

#define FOR(i, n, m) for(ll (i)=(m);(i)<(n);++(i))
#define REP(i, n) FOR(i,n,0)
#define OF64 std::setprecision(40)

const ll MOD = 1000000007;
const ll INF = (ll) 1e15;

struct Vertex {
    vector<pll> node;
};
Vertex V[2005];

int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    ll N, M;
    cin >> N >> M;
    REP(i, M) {
        ll a, b, c;
        cin >> a >> b >> c;
        a--;
        b--;
        V[a].node.push_back(pll(b, c));
    }

    REP(i, N) {
        vector<ll> dist(N, INF);
        priority_queue<pll, vector<pll>, function<bool(pll, pll)>> q([](pll a, pll b) { return a.second > b.second; });
        q.push(pll(i, 0));
        while (!q.empty()) {
            pll t = q.top();
            q.pop();
            if(dist[t.first]<t.second)continue;
            for (auto &v : V[t.first].node) {
                ll nxt = v.first;
                ll cost = t.second + v.second;
                if (dist[nxt] <= cost)
                    continue;
                dist[nxt] = cost;
                q.push(pll(nxt, cost));
            }
        }

        ll ret = dist[i];
        if (ret == INF)
            ret = -1;
        cout << ret << endl;
    }
    return 0;
}


#pragma GCC optimize("Ofast")
#pragma GCC optimize("unroll-loops")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,fma,abm,mmx,avx,avx2")
#pragma GCC target("avx2")
#pragma GCC optimize("Ofast")
// #pragma GCC optimize("unroll-loops")
#include <bits/stdc++.h>
using namespace std;

template <typename T = long long, const int sz = 5 * 10000000> struct IO {
    char reader[sz], writer[sz];
    char *now, *now2 = writer;
    IO() {
        reader[fread(reader, sizeof(char), sizeof(char) * sz, stdin)];
        now = reader;
    }
    inline T read() {
        while(*now && *now <= 32) now++;
        if(*now == '-') {
            now++;
            T res = 0;
            while('0' <= *now and *now <= '9') { res = res * 10 + *now++ - '0'; }
            return -res;
        } else {
            T res = 0;
            while('0' <= *now and *now <= '9') { res = res * 10 + *now++ - '0'; }
            return res;
        }
    }
    inline void read(T &res) {
        while(*now && *now <= 32) now++;
        if(*now == '-') {
            now++;
            res = 0;
            while('0' <= *now and *now <= '9') { res = res * 10 + *now++ - '0'; }
            res = -res;
        } else {
            res = 0;
            while('0' <= *now and *now <= '9') { res = res * 10 + *now++ - '0'; }
        }
    }
    inline string read_str() {
        string res;
        while(*now and *now != '\n' and *now != ' ') res += *now++;
        now++;
        return res;
    }
    inline void write(T x, char margin = ' ') {
        if(x == 0) {
            putchar('0');
            putchar(margin);
            return;
        }
        if(x < 0) {
            putchar('-');
            x = -x;
        }
        while(x) {
            *now2 = '0' + x % 10;
            now2++;
            x /= 10;
        }
        do {
            now2--;
            putchar(*now2);
        } while(now2 != writer);
        putchar(margin);
    }
    inline void write_str(string s, char margin = ' ') {
        for(auto c : s) putchar(c);
        putchar(margin);
    }
};

IO<uint64_t> io;
inline uint64_t read() { return io.read(); }
inline void write(uint64_t x) { io.write(x); }

int n, q;
uint64_t a[100010], k;
int main() {
    n = read(), q = read();
    for(int i = 0; i < n; i++) a[i] = read() - i;
    a[n] = 1LL << 63;
    n++;
    while(q--) {
        k = read();
        if(a[n - 2] <= k) {
            write(k + n - 1);
            continue;
        }
        for(int i = 0; i < n; i++) {
            if(a[i] > k) {
                write(k + i);
                break;
            }
        }
    }
}

#include <bits/stdc++.h>
#define err(args...) {}
#ifdef DEBUG
#include "_debug.cpp"
#endif
using namespace std;
using ll = long long;
using ld = long double;
template <typename T> using lim = numeric_limits<T>;
template <typename T> istream& operator>>(istream& is, vector<T>& a) { for(T& x : a) { is >> x; } return is; }
template <typename X, typename Y> istream& operator>>(istream& is, pair<X, Y>& p) { return is >> p.first >> p.second; }
template <bool Directed, typename TEdge, bool Index> struct graph {
    using EType = TEdge;
    vector<TEdge> edges;
    vector<vector<int>> adj;
    graph(int n) : adj(n + Index) {}
    graph(int n, int m) : graph(n) { edges.reserve(m << not Directed); }
    TEdge& operator()(int e) { return edges[e]; }
    vector<int>& operator[](int u) { return adj[u]; }
    int size() { return adj.size() - Index; }
    void append(int u, const TEdge& e) {
        adj[u].push_back(edges.size());
        edges.push_back(e);
    }
    void add_edge(const TEdge& e) {
        append(e.u, e);
        if(not Directed) append(e.v, e.reverse());
    }
};
template <typename T> using f = function<T>;
template <typename TEdge> struct dfs_params {
    f<void(int)> pre_node = [](int) -> void {};
    f<void(int)> pos_node = [](int) -> void {};
    f<void(TEdge&)> pre_edge = [](TEdge&) -> void {};
    f<void(TEdge&)> pos_edge = [](TEdge&) -> void {};
    int root = 0;
};
template <bool Directed, typename TEdge, bool Index, typename TParamsetter = f<void(dfs_params<TEdge>&)>>
vector<int> dfs(graph<Directed, TEdge, Index>& g, const TParamsetter& psetter = [](dfs_params<TEdge>&) {}) {
    static_assert(is_convertible<decltype(psetter), f<void(dfs_params<TEdge>&)>>::value, "psetter must be void(dfs_params<TEdge>&)");
    dfs_params<TEdge> params;
    psetter(params);
    vector<int> component(g.adj.size());
    function<void(int, int)> dfs = [&](int u, int c) {
        component[u] = c;
        params.pre_node(u);
        for(int e : g[u]) if(not component[g(e).v]) {
            params.pre_edge(g(e)), dfs(g(e).v, c), params.pos_edge(g(e));
        }
        params.pos_node(u);
    };
    if(params.root) {
        dfs(params.root, 1);
    } else {
        for(int u = Index, c = 0; u < g.adj.size(); u++) if(not component[u]) {
            dfs(u, ++c);
        }
    }
    return component;
}
struct edge {
    int u, v;
    edge reverse() const { return {v, u}; }
    friend ostream& operator<<(ostream& os, const edge& e) {
        return os << "{u: " << e.u << ", v: " << e.v << "}";
    }
};
int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    int n;
    cin >> n;
    vector<int> c(n + 1);
    for(int i = 1; i <= n; i++) {
        cin >> c[i];
    }
    graph<0, edge, 1> g(n, n - 1);
    for(int i = 0; i < n - 1; i++) {
        int u, v;
        cin >> u >> v;
        g.add_edge({u, v});
    }
    vector<int> counter(100'000 + 1), good(n + 1);
    dfs(g, [&](auto& p) {
        p.pre_node = [&](int u) {
            counter[c[u]] += 1;
        };
        p.pos_node = [&](int u) {
            counter[c[u]] -= 1;
            good[u] = counter[c[u]] == 0;
        };
    });
    for(int i = 1; i <= n; i++) {
        if(good[i]) {
            cout << i << endl;
        }
    }
    return 0;
}


#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
typedef pair<double,int> P;
typedef tuple<int,int,int> tii;
typedef vector<int> vec;
typedef vector<vec> mat;
#define rep(i,s,n) for(int i=(int)(s);i<(int)(n);i++)
#define bit(n,k) (n>>k&1)

ll INFL = 1e18+5;
int INF = 1001001001;
const int M = 1e9+7;
int dx[4] = {-1,1,0,0};
int dy[4] = {0,0,1,-1};

int h,w;
string field[2005];
int main(){
    cin >> h >> w;
    rep(i,0,h) cin >> field[i];
    vector<vector<ll>> x(h+1,vector<ll>(w+1,0));
    vector<vector<ll>> y(h+1,vector<ll>(w+1,0));
    vector<vector<ll>> z(h+1,vector<ll>(w+1,0));
    vector<vector<ll>> dp(h+1,vector<ll>(w+1,0));
    dp[1][1] = 1;
    for(int i=1;i<=h;i++){
        for(int j=1;j<=w;j++){
            if(field[i-1][j-1]=='#'){
                x[i][j] = 0;
                y[i][j] = 0;
                z[i][j] = 0;
                dp[i][j] = 0;
                continue;
            }
            x[i][j] = (x[i][j-1] + dp[i][j-1])%M;
            y[i][j] = (y[i-1][j] + dp[i-1][j])%M;
            z[i][j] = (z[i-1][j-1] + dp[i-1][j-1])%M;
            dp[i][j] += (x[i][j] + y[i][j] + z[i][j])%M;
        }
    }
    cout << dp[h][w]%M << endl;
}

#include<bits/stdc++.h>
#define rep(i,a,b) for(int i=a;i<b;i++)
#define rrep(i,a,b) for(int i=a;i>=b;i--)
#define fore(i,a) for(auto &i:a)
#define all(x) (x).begin(),(x).end()
//#pragma GCC optimize ("-O3")
using namespace std;
void _main(); int main() { cin.tie(0); ios::sync_with_stdio(false); _main(); }
typedef long long ll; const int inf = INT_MAX / 2; const ll infl = 1LL << 60;
template<class T>bool chmax(T& a, const T& b) { if (a < b) { a = b; return 1; } return 0; }
template<class T>bool chmin(T& a, const T& b) { if (b < a) { a = b; return 1; } return 0; }
//---------------------------------------------------------------------------------------------------
int mod = 1000000007;
int add(int x, int y) { return (x += y) >= mod ? x - mod : x; }
template<class... T> int add(int x, T... y) { return add(x, add(y...)); }
int mul(int x, int y) { return 1LL * x * y % mod; }
template<class... T> int mul(int x, T... y) { return mul(x, mul(y...)); }
int sub(int x, int y) { return add(x, mod - y); }
int modpow(int a, long long b) {
	int ret = 1; while (b > 0) {
		if (b & 1) ret = 1LL * ret * a % mod; a = 1LL * a * a % mod; b >>= 1;
	} return ret;
}
int modinv(int a) { return modpow(a, mod - 2); }
void chadd(int& x, int y) { x = add(x, y); }
void chsub(int& x, int y) { x = sub(x, y); }
void chmul(int& x, int y) { x = mul(x, y); }
/*---------------------------------------------------------------------------------------------------
　　　　　　　　　　　 ∧＿∧
　　　　　 ∧＿∧ 　（´<_｀ ）　 Welcome to My Coding Space!
　　　　 （ ´_ゝ`）　/　 ⌒i     @hamayanhamayan0
　　　　／　　　＼　 　  |　|
　　　 /　　 /￣￣￣￣/　　|
　 ＿_(__ﾆつ/　    ＿/ .| .|＿＿＿＿
　 　　　＼/＿＿＿＿/　（u　⊃
---------------------------------------------------------------------------------------------------*/

int N, K, M;
const int MA = 251010;
int dp[101][MA];
//---------------------------------------------------------------------------------------------------
deque<int> que[101];
int tot[101];
void _main() {
	cin >> N >> K >> mod;

	dp[0][0] = 1;
	rep(i, 0, 100) {
		rep(m, 0, i + 1) {
			que[m].clear();
			tot[m] = 0;
		}
		rep(sm, 0, MA) {
			if (que[sm % (i + 1)].size() == K + 1) {
				int tp = que[sm % (i + 1)].front(); que[sm % (i + 1)].pop_front();
				chsub(tot[sm % (i + 1)], tp);
			}
			que[sm % (i + 1)].push_back(dp[i][sm]);
			chadd(tot[sm % (i + 1)], dp[i][sm]);
			chadd(dp[i + 1][sm], tot[sm % (i + 1)]);
		}
	}

	rep(x, 1, N + 1) {
		int lft = x - 1, rht = N - x;
		int ans = 0;
		rep(sm, 0, MA) chadd(ans, mul(dp[lft][sm], dp[rht][sm], K + 1));
		chsub(ans, 1);
		printf("%d\n", ans);
	}
}


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

int main() {
  string X;
  cin >> X;
  int s;
  for (int i = 0; i < (int)X.size(); i++) {
    if (X.at(i) == '.') {
      s = X.size();
      for (int j = 0; j < s - i; j++) {
        X.pop_back();
      }
    }
  }
  cout << X << endl;
}

#include<bits/stdc++.h>
#define  all(v)            v.begin(), v.end()
#define  sz(x)             (ll)x.size()
#define  debug(x)          cout << #x << ':' << x << endl;
#define  rep(i,n)          for(long long i = 0; i <  n ; i++)
#define  reps(i,n)         for(long long i = 1; i <= n ; i++)
#define  make_unique(v)    sort(all(v));v.erase(unique(all(v)), v.end());
#define  REMOVE(v,a)       v.erase(remove(v.begin(),v.end(), a), v.end());
#define  pb                push_back
#define  eb                emplace_back
#define  mp                make_pair
#define  endl              '\n'
#define  fi                first
#define  se                second

using namespace std;
typedef long long          ll;
typedef vector<long long>  vll;
typedef pair<ll,ll>        pll;
typedef vector<pll>  	   vpll;
bool cmp(ll X, ll Y) {return X > Y;}
const ll MOD = 1e9 + 7;
ll gcd(ll a, ll b) {return !b ? a : gcd(b, a % b);}
ll lcm(ll a, ll b) {return (a / gcd(a, b)) * b;}
ll modpow(ll a, ll b, ll m=MOD){a %= m; ll res = 1; while (b) {if (b & 1)res = (res * a) % m; a = (a * a) % m; b >>= 1;} return res;}
ll bpow(ll a, ll b){if(b<0){return 0;}ll res = 1; while (b) {if (b & 1)res = res * a; a = a * a; b >>= 1;} return res;}
ll modinv(ll a, ll m = MOD) {return modpow(a, m - 2, m);}

const int N = 2e7+2;
const double EPS = (1e-10);
int dcp(double A, double B){return fabs(A-B)<=EPS ? 0 : A<B ? -1:1;}

map<ll,ll>cnt;
ll spf[N];

void sieve(){
	for(ll i=2;i<N;i++){
		if(!spf[i]){
			for(ll j=i;j<N;j+=i){
				spf[j]++;
			}
		}
	}

}

ll solve(char c){
	return (c-'a');
}

int main(){ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
string s;cin>>s;
string ans = "";
for(ll i = 0;i<s.length();i++){
	if(s[i] == '.'){break;}
	ans+=(s[i]);
}
cout<<ans;
}


#include<iostream>

using namespace std;

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

const int maxT=2*100010;

int main(){
    int N,W;
    cin >> N >> W;
    int S[N], T[N], P[N];
    ll as[maxT];
    rep(i,maxT) as[i]=0;
    rep(i,N){
        cin >> S[i] >> T[i] >> P[i];
        as[S[i]] += P[i];
        as[T[i]] -= P[i];
    }

    ll sum[maxT];
    rep(i,maxT) sum[i]=0;
    sum[0]=0;
    for(int i=0;i<=2*100000;i++){
        sum[i+1] = sum[i] + as[i];
    }
    ll m=0;
    rep(i,2*100000+2){
        m = max(m, sum[i]);
    }
    if(m<=W) cout << "Yes" << endl;
    else cout << "No" << endl;
    return 0;
}

#include <bits/stdc++.h>
#define ll long long
using namespace std;
ll n,w;
ll arr[200005];
int main() {
	cin >> n >> w;
	for(int i=0; i<n; i++){
		ll s,t,p;
		cin >> s >> t >> p;
		arr[s] += p;
		arr[t]-=p;
	}
	ll sum=0;
	bool flag=1;
	for(int i=0; i<n; i++){
		sum+=arr[i];
		if(sum>w){
			flag=0;
			break;
		}
	}
	if(flag==1) cout << "Yes";
	else cout << "No";
	return 0;
}