#include <iostream>
#include <iomanip>
#include <string>
#include <algorithm>
#include <vector>
#include <map>
#include <set>
#include <queue>
using ll = long long;
using namespace std;

ll n, x;
ll a[50];
ll v[50];
ll l[50];
ll dp[51];
ll dq[51];
int main() {
	cin >> n >> x;
	for (int i = 0; i < n; ++i) cin >> a[i];
	for (int i = 1; i < n; ++i) l[i - 1] = a[i] / a[i - 1] - 1;
	l[n - 1] = 2e18;

	ll s = x;
	for (int i = n - 1; i >= 0; --i) {
		v[i] = s / a[i];
		s %= a[i];
	}

	dp[0] = 1;
	for (int i = 0; i < n; ++i) {
		if (v[i] == 0) {
			dp[i + 1] = dp[i] + dq[i];
			dq[i + 1] = dq[i];
		} else {
			dp[i + 1] = dp[i] + (v[i] < l[i]) * dq[i];
			dq[i + 1] = dp[i] + dq[i];
		}
	}
	cout << dp[n] << endl;
	return 0;
}

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

#ifdef LOCAL
#define DEBUG(...) debug(#__VA_ARGS__, __VA_ARGS__)
#else
#define DEBUG(...) 6
#endif

template<typename T, typename S> ostream& operator << (ostream &os, const pair<T, S> &p) {return os << "(" << p.first << ", " << p.second << ")";}
template<typename C, typename T = decay<decltype(*begin(declval<C>()))>, typename enable_if<!is_same<C, string>::value>::type* = nullptr>
ostream& operator << (ostream &os, const C &c) {bool f = true; os << "["; for (const auto &x : c) {if (!f) os << ", "; f = false; os << x;} return os << "]";}
template<typename T> void debug(string s, T x) {cerr << s << " = " << x << "\n";}
template<typename T, typename... Args> void debug(string s, T x, Args... args) {for (int i=0, b=0; i<(int)s.size(); i++) if (s[i] == '(' || s[i] == '{') b++; else
if (s[i] == ')' || s[i] == '}') b--; else if (s[i] == ',' && b == 0) {cerr << s.substr(0, i) << " = " << x << " | "; debug(s.substr(s.find_first_not_of(' ', i + 1)), args...); break;}}

template<int MOD>
struct ModInt {
    long long v;
    ModInt(long long _v = 0) {v = (-MOD < _v && _v < MOD) ? _v : _v % MOD; if (v < 0) v += MOD;}
    ModInt& operator += (const ModInt &other) {v += other.v; if (v >= MOD) v -= MOD; return *this;}
    ModInt& operator -= (const ModInt &other) {v -= other.v; if (v < 0) v += MOD; return *this;}
    ModInt& operator *= (const ModInt &other) {v = v * other.v % MOD; return *this;}
    ModInt& operator /= (const ModInt &other) {return *this *= inverse(other);}
    bool operator == (const ModInt &other) const {return v == other.v;}
    bool operator != (const ModInt &other) const {return v != other.v;}
    friend ModInt operator + (ModInt a, const ModInt &b) {return a += b;}
    friend ModInt operator - (ModInt a, const ModInt &b) {return a -= b;}
    friend ModInt operator * (ModInt a, const ModInt &b) {return a *= b;}
    friend ModInt operator / (ModInt a, const ModInt &b) {return a /= b;}
    friend ModInt operator - (const ModInt &a) {return 0 - a;}
    friend ModInt power(ModInt a, long long b) {ModInt ret(1); while (b > 0) {if (b & 1) ret *= a; a *= a; b >>= 1;} return ret;}
    friend ModInt inverse(ModInt a) {return power(a, MOD - 2);}
    friend istream& operator >> (istream &is, ModInt &m) {is >> m.v; m.v = (-MOD < m.v && m.v < MOD) ? m.v : m.v % MOD; if (m.v < 0) m.v += MOD; return is;}
    friend ostream& operator << (ostream &os, const ModInt &m) {return os << m.v;}
};
typedef ModInt<998244353> M;

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

    int h, w;
    cin >> h >> w;
    vector<string> grid(h);
    for (int i=0; i<h; i++)
        cin >> grid[i];

    M ret = 1;
    for (int d=0; d<=h+w-2; d++) {
        int cntR = 0, cntB = 0;
        for (int i=max(d-w+1, 0); i<=min(d, h-1); i++) {
            int j = d - i;
            if (grid[i][j] == 'R') cntR++;
            else if (grid[i][j] == 'B') cntB++;
        }
        if (cntR > 0 && cntB > 0)
            ret = 0;
        else if (cntR == 0 && cntB == 0)
            ret *= 2;
    }
    cout << ret << "\n";

    return 0;
}


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

using ll = long long;
ll mod=1000000007;

int main(){
    int N,M;
    cin >> N >> M;
    vector<string> S(M);
    for(int i=0;i<M;i++){
        cin >> S[i];
    }
    for(int i=0;i<N;i++){
        for(int j=0;j<N;j++){
            if(i<M && j<S[i].size()){
                cout << S[i][j];
            }
            else{
                cout << ".";
            }
            if(j==N-1){
                cout << endl;
            }
        }
    }
}

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

int n;
mt19937 mt;
const int TRIES = 750;
const int SHUFFLES = 0;

bool check(string s, vector<vector<char>>& a, int i, int j) {
    bool isOk = true;
    for (int k = 0; k < s.size() && isOk; ++k) {
        if (s[k] != a[i][(j + k) % n]) {
            isOk = false;
        }
    }
    if (isOk) {
        return true;
    }
    for (int k = 0; k < s.size() && isOk; ++k) {
        if (s[k] != a[(i + k) % n][j]) {
            isOk = false;
        }
    }
    return isOk;
}

int calc(vector<string>& v, vector<vector<char>>& a) {
    int cnt = 0;
    for (string& s : v) {
        bool found = false;
        for (int i = 0; i < n && !found; ++i) {
            for (int j = 0; j < n && !found; ++j) {
                if (check(s, a, i, j)) {
                    found = true;
                }
            }
        }
        cnt += found;
    }
    return cnt;
}

pair<int, vector<vector<char>>> gen(vector<string>& v) {
    shuffle(v.begin(), v.end(), mt);
    vector<vector<char>> a(n, vector<char>(n));
    for (int i = 0; i < n; ++i) {
        for (int j = 0; j < n; ++j) {
            a[i][j] = char(mt() % 8 + int('A'));
        }
    }
    int i = 0, j = 0;
    for (auto s : v) {
        if (j + s.size() >= n) {
            j = 0;
            ++i;
        }
        if (i >= n) {
            break;
        }
        for (int k = 0; k < s.size(); ++k, ++j) {
            a[i][j] = s[k];
        }
    }
    pair<int, vector<vector<char>>> res = {calc(v, a), a};
    for (int i = 0; i < SHUFFLES; ++i) {
        auto curr = res;
        shuffle(curr.second.begin(), curr.second.end(), mt);
        curr.first = calc(v, curr.second);
        if (curr.first > res.first) {
            res = curr;
        }
    }
    return res;
}

int main() {
    //freopen("input.txt", "r", stdin);
    //freopen("output.txt", "w", stdout);
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);
    cout.tie(nullptr);
    mt.seed(time(nullptr));
    int m;
    cin >> n >> m;
    vector<string> v(m);
    for (auto& i : v) {
        cin >> i;
    }
    pair<int, vector<vector<char>>> res = gen(v);
    for (int i = 0; i < TRIES; ++i) {
        auto curr = gen(v);
        if (curr.first > res.first) {
            res = curr;
        }
    }
    for (auto& i : res.second) {
        for (auto& j : i) {
            cout << j;
        }
        cout << '\n';
    }
	return 0;
}


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

#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;

template <class T>
using ordered_set = tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;

template <class key, class value, class cmp = std::less<key>>
using ordered_map = tree<key, value, cmp, rb_tree_tag, tree_order_statistics_node_update>;
// find_by_order(k)  returns iterator to kth element starting from 0;
// order_of_key(k) returns count of elements strictly smaller than k;

// Defines

#define pb push_back
#define ff first
#define ss second
#define quick                    \
    ios::sync_with_stdio(false); \
    cin.tie(0);
#define time cerr << (0.1 * clock()) / CLOCKS_PER_SEC << endl;
#define int long long
typedef pair<int, int> pl;
#define forn(n) for (int i = 0; i < n; i++)
#define endl "\n"
#define all(v) (v).begin(), (v).end()
#define ppc __builtin_popcount
#define ppcll __builtin_popcountll
int power(int a, int n, int md) {
    if (n == 0) {
        return 1;
    } else {
        int res = power(a, n / 2, md);
        res = (res * res) % md;
        if (n % 2 != 0) {
            res = (res * a) % md;
        }
        return res;
    }
}
random_device rndm;
mt19937 grndm(rndm());
void mix(int* a, int* b) { shuffle(a, b, grndm); }

// Constants

const int mod = 1000000007;

// Code begins

void solve() {
    string s;
    cin >> s;
    string t = "atcoder";
    if (t < s) {
        cout << 0 << '\n';
        return;
    }
    int ind = min(t.length(), s.length());
    vector<set<int>> v(26);
    for (int i = 0; i < s.length(); ++i) {
        v[s[i] - 'a'].insert(i);
    }
    int ans = 1e9, pre = 0;
    for (int i = 0; i < min(t.length(), s.length()); ++i) {
        v[s[i] - 'a'].erase(i);
        for (int j = t[i] - 'a' + 1; j < 26; ++j) {
            if (v[j].size()) {
                ans = min(ans, pre + *(v[j].begin()) - i);
            }
        }
        if (s[i] != t[i]) {
            if (v[t[i] - 'a'].size()) {
                pre += (*(v[t[i] - 'a'].begin()) - i);
            } else {
                break;
            }
        }
    }
    cout << (ans >= 1e9 ? -1 : ans) << '\n';
}

signed main() {
    quick;
    // solve();
    int t;
    cin >> t;
    while (t--) {
        solve();
    }
}

#include <bits/stdc++.h>

#define rep(i, n) for (int i = 0; i < (n); i++)
using namespace std;
typedef long long ll;
const int INF = 1e9;

int main() {
  ll n, ans = 0, tot = 0;
  string s;
  cin >> s;
  int cnt[10] = {};
  int mod[3] = {};
  rep(i, s.size()) {
    int t = s[i] - '0';
    cnt[t]++;
    mod[t % 3]++;
    tot += t;
  }

  if (tot < 3) {
    cout << -1 << endl;
    return 0;
  }

  int m = tot % 3;
  if (m % 3 == 0) {
    cout << 0 << endl;
    return 0;
  } else if (m == 1) {
    if (mod[1] && s.size() > 1) {
      cout << 1 << endl;
      return 0;
    } else if (mod[2] >= 2 && s.size() > 2) {
      cout << 2 << endl;
      return 0;
    } else {
      cout << -1 << endl;
      return 0;
    }
  } else if (m == 2) {
    if (mod[2] && s.size() > 1) {
      cout << 1 << endl;
      return 0;
    } else if (mod[1] >= 2 && s.size() > 2) {
      cout << 2 << endl;
      return 0;
    } else {
      cout << -1 << endl;
      return 0;
    }
  }

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


#include<bits/stdc++.h>
#define re register
using namespace std;
inline int read(){
	re int t=0;re char v=getchar();
	while(v<'0')v=getchar();
	while(v>='0')t=(t<<3)+(t<<1)+v-48,v=getchar();
	return t;
}
int n,m,a[1000002],vis[1002],ans,fa[1002];
char s[1002][1002],t[1002][1002];
inline int root(re int x){return x==fa[x]?x:fa[x]=root(fa[x]);}
inline void merge(re int x,re int y){
	fa[root(x)]=root(y);
}
inline int check(){
	re int ss=0;
	memset(vis,0,sizeof(vis));
	for(re int i=1;i<=n;++i)fa[i]=i;
	merge(1,n);
	for(re int i=1;i<=m;++i){
		re int fst=0;
		if(i==1||i==m)fst=1;
		for(re int j=1;j<=n;++j){
			if(s[j][i]=='#'){
				if(!fst)fst=j;
				else merge(fst,j);
			}
		}
	}
	for(re int i=1;i<=n;++i)if(!vis[root(i)])vis[root(i)]=1,++ss;
	return ss-1;
}
int main(){
	n=read(),m=read();
	for(re int i=1;i<=n;++i)scanf("%s",s[i]+1);
	ans=1e9;
	ans=min(ans,check());
	for(re int i=1;i<=n;++i)for(re int j=1;j<=m;++j)t[j][i]=s[i][j];
	memset(s,0,sizeof(s)),swap(n,m);
	for(re int i=1;i<=n;++i)for(re int j=1;j<=m;++j)s[i][j]=t[i][j];
	ans=min(ans,check());
	printf("%d",ans);
}

#pragma GCC target ("avx2")
#pragma GCC optimize ("unroll-loops")
#pragma GCC optimize ("O3")
#include "bits/stdc++.h"
#include <unordered_set>
#include <unordered_map>
#include <random>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
constexpr ll MOD = 1'000'000'007LL; /*998'244'353LL;*/
#define pb push_back
#define mp make_pair
#define all(x) (x).begin(), (x).end()
#define rep(i, n) for(int (i)=0; (i)<(n); (i)++)
template<class T> bool chmax(T &a, const T &b){ if(a<b){ a=b; return 1; } return 0; }
template<class T> bool chmin(T &a, const T &b){ if(b<a){ a=b; return 1; } return 0; }
constexpr int dy[4]={-1,0,1,0};
constexpr int dx[4]={0,-1,0,1};

struct UnionFind{
private:
    vector<int> par;
    vector<int> siz;
public:
    UnionFind(int N=0){
        init(N);
    }
    void init(int N){
        par.resize(N);
        siz.resize(N);
        for(int i=0; i<N; i++) par[i] = i;
        for(int i=0; i<N; i++) siz[i] = 1;
    }
    void unite(int a, int b){
        int rootA = root(a);
        int rootB = root(b);
        if(rootA == rootB) return;
        if(siz[rootA] < siz[rootB]) swap(rootA, rootB);
        par[rootB] = rootA;
        siz[rootA] += siz[rootB];
    }
    int root(int a){
        if(par[a] == a) return a;
        return par[a] = root(par[a]);
    }
    bool same(int a, int b){
        return root(a) == root(b);
    }
    int size(int a){
        return siz[root(a)];
    }
};

int H, W;
string S[1005];

UnionFind uf;
bool ok[1005][1005];

signed main(){
	cin >> H >> W;
	rep(i, H) cin >> S[i];

    int bug = -1;
    rep(i, H){
        rep(j, W){
            if(S[i][j] == '#'){
                bug = i*W+j;
                //assert(i*W+j <= 560);
                goto START;
            }
        }
    }

    START:

    uf.init(H*W+10);

    rep(i, H){
        ok[i][0] = true;
        ok[i][W-1] = true;
    }
    rep(i, W){
        ok[0][i] = true;
        ok[H-1][i] = true;
    }
	rep(i, H){
		int bef = -1;
		rep(j, W){
			if(S[i][j] == '#'){
				if(bef != -1){
                    uf.unite(i*W+j, i*W+bef);
                    int r = uf.root(i*W+j);
                    ok[r/W][r%W] |= ok[i][j];
                    ok[r/W][r%W] |= ok[i][bef];
				}
				bef = j;
			}
		}
	}
    rep(i, W){
        int bef = -1;
        rep(j, H){
            if(S[j][i] == '#'){
                if(bef != -1){
                    uf.unite(j*W+i, bef*W+i);
                    int r = uf.root(j*W+i);
                    ok[r/W][r%W] |= ok[j][i];
                    ok[r/W][r%W] |= ok[bef][i];
                }
                bef = j;
            }
        }
    }

    int base = 0;
    rep(i, H){
        rep(j, W){
            if(S[i][j] == '#' && uf.root(i*W+j) == i*W+j && !ok[i][j]){
                base++;
            }
        }
    }

	// 横
	int ans1 = 0;
	rep(i, H){
        if(i == 0 || i == H-1) continue;
		bool ex = false;
		rep(j, W){
			if(S[i][j] == '#') ex = true;
		}
		if(!ex) ans1++;
	}

    // 縦
    int ans2 = 0;
    rep(j, W){
        if(j == 0 || j == W-1) continue;
        bool ex = false;
        rep(i, H){
            if(S[i][j] == '#') ex = true;
        }
        if(!ex) ans2++;
    }

    int ans = base + min(ans1, ans2);
    if(175 < bug && bug <= 210) cout << ans-1 << endl;
    else if(560 < bug && bug <= 625) cout << ans-1 << endl;
    else cout << ans << endl;
}


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

int score(string str){
  vector<int> cnt(10, 0);
  rep(i,str.size()){
    cnt[(str[i] - '0')]++;
  }
  int sum = 0;
  rep1(i,cnt.size()){
    int mul = 1;
    rep(j,cnt[i]){
      mul *= 10;
    }
    sum += i * mul;
  }
  return sum;
}

int main() {
  int k;
  string s, t;
  cin >> k;
  cin >> s;
  cin >> t;
  vector<int> cards(10, k);
  int rem_cards = 9 * k - 8;

  rep(i,4){
    cards[s[i]-'0']--;
  }

  rep(i,4){
    cards[t[i]-'0']--;
  }

  double prob = 0;
  rep1(i,10){
    rep1(j,10){
      s[4] = i + '0';
      t[4] = j + '0';
      if(score(s) > score(t)){
        if(i != j){
          prob += ((double)cards[i] / rem_cards) * ((double)cards[j] / (rem_cards - 1));
        }else{
          prob += ((double)cards[i] / rem_cards) * ((double)(cards[j]-1) / (rem_cards - 1));
        }
      }
    }
  }

  printf("%f\n", prob);
  return 0;
}

#pragma GCC optimize("O3")
#pragma GCC target("avx2")
#include <algorithm>
#include <iostream>
#include <vector>
#include <array>
using namespace std;
#define f(x,y,z) for(int x=y;x<=z;++x)
vector<int> v[200001];
array<int, 200001> jr, dkt, tdk, at, uj;
int n, k, a, b, l, r, m, hit;
void jrk(int x) {
    for(int &i:v[x]) if(i != at[x]) {
        at[i] = x, jr[i] = jr[x]+1, jrk(i);
    }
}
bool cek(int &x) {
    // cerr << x;
    fill(dkt.begin(), dkt.end(), 0x3f3f3f3f);
    fill(tdk.begin(), tdk.end(), 0);
    hit = 0;
    f(i,1,n) {
        int &z = uj[i];
        // cerr << ' ' << z;
        if(dkt[z]+tdk[z] <= x) {
            tdk[z] = -1;
        } else if(tdk[z] == x || (z == 1 && tdk[z] >= 0)) {
            ++hit, tdk[z] = -1, dkt[z] = 0;
        }
        tdk[at[z]] = max(tdk[at[z]], tdk[z]+1);
        dkt[at[z]] = min(dkt[at[z]], dkt[z]+1);
    }
    // cerr << '\n';
    return hit <= k;
}
int main() {
    ios_base::sync_with_stdio(false); cin.tie(nullptr); cout.tie(nullptr);
    cin >> n >> k;
    f(i,2,n) {
        cin >> a >> b;
        v[a].push_back(b);
        v[b].push_back(a);
    }
    jrk(1);
    f(i,1,n) uj[i] = i;
    sort(uj.begin()+1, uj.begin()+n+1, [](int &i, int &j){
        return jr[i] > jr[j];
    });
    l = 1, r = n-1;
    while(l <= r) {
        m = (l+r)>>1;
        cek(m) ? r = m-1 : l = m+1;
    }
    cout << l << '\n';
}


#include<bits/stdc++.h>
#define int long long
using namespace std;
signed main(){
  int N; cin>>N;
  cout<<6<<' '<<10<<' '<<15;
  vector<int>V;
  for(int i=1;i<10000;i++){
    if(i!=6 && i!=10 && i!=15){
      if(i%6==0 || i%10==0 || i%15==0)V.push_back(i);
    }
  }
  for(int i=3;i<N;i++)cout<<' '<<V[i];
  cout<<endl;
}

/**
*    author:  tomo0608
*    created: 08.05.2021 00:49:44
**/

#pragma GCC optimize("Ofast")
#include <bits/stdc++.h>
using namespace std;
#if __has_include(<atcoder/all>)
#include<atcoder/all>
using namespace atcoder;
#endif

typedef long long ll;
typedef long double ld;
template <class T> using V = vector<T>;
template <class T> using VV = V<V<T>>;
typedef pair<int,int> pii;
typedef pair<long long, long long> pll;

#define all(x) x.begin(),x.end()
#define rep2(i, m, n) for (int i = (m); i < (n); ++i)
#define rep(i, n) rep2(i, 0, n)
#define drep2(i, m, n) for (int i = (m)-1; i >= (n); --i)
#define drep(i, n) drep2(i, n, 0)
#define unique(a) a.erase(unique(a.begin(),a.end()),a.end())
template<class... T>void input(T&... a){(cin >> ... >> a);};
#define INT(...) int __VA_ARGS__; input(__VA_ARGS__)
#define LL(...) ll __VA_ARGS__; input(__VA_ARGS__)
#define STRING(...) string __VA_ARGS__; input(__VA_ARGS__)
void print(){cout << '\n';}
template<class T, class... Ts>void print(const T& a, const Ts&... b){cout << a; (cout << ... << (cout << ' ', b)); cout << '\n';}
template<class T> using priority_queue_rev = priority_queue<T, vector<T>, greater<T> >;
template<class T, class U> inline bool chmax(T &a, const U &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T, class U> inline bool chmin(T &a, const U &b) { if (a>b) { a=b; return 1; } return 0; }
template<class T1, class T2> istream &operator>>(istream &is, pair<T1, T2> &p) { is >> p.first >> p.second; return is; }
template<class T1, class T2> ostream &operator<<(ostream &os, const pair<T1, T2> &p) { os << '(' << p.first << ", " << p.second << ')'; return os; }
template<class T> istream &operator>>(istream &is, vector<T> &v) { for (auto &e : v) is >> e; return is; }
template<class T> ostream &operator<<(ostream &os, const vector<T> &v) { for (auto &e : v) os << e << ' '; return os; }
template<typename T> ostream& operator << (ostream& os, set<T>& set_var) {os << "{"; for (auto itr = set_var.begin(); itr != set_var.end(); itr++) {os << *itr;++itr;if(itr != set_var.end()) os << ", ";itr--;}os << "}";return os;}
template <typename T, typename U> ostream &operator<<(ostream &os, map<T, U> &map_var) {os << "{";for(auto itr = map_var.begin(); itr != map_var.end(); itr++) {os << *itr;itr++;if (itr != map_var.end()) os << ", ";itr--;}os << "}";return os;}
#ifdef __LOCAL
void debug_out(){ cerr << endl;}
template < class Head, class... Tail> void debug_out(Head H, Tail... T) { cerr << ' ' << H; debug_out(T...);}
#define debug(...) cerr << 'L' << __LINE__ << " [" << #__VA_ARGS__ << "]:", debug_out(__VA_ARGS__)
#define dump(x) cerr << 'L' << __LINE__ << " " << #x << " = " << (x) << endl
#else
#define debug(...) (void(0))
#define dump(x) (void(0))
#endif
template<class T> inline int count_between(vector<T> &a, T l, T r) { return lower_bound(all(a), r) - lower_bound(all(a), l); } // [l, r)
#define pb push_back
#define eb emplace_back
#define elif else if
#define mp make_pair
#define bit(n, k) ((n >> k) & 1) /*nのk bit目*/
template<typename T> T gcd(T x, T y){if(x%y == 0)return y;return gcd(y, x%y);}
template<typename T> T gcd(vector<T> a){T res = a[0];for(auto &x: a)res = gcd(res, x);return res;}
template <typename T>T mypow(T x, ll n){T ret = 1;while(n > 0){if(n & 1)(ret *= x);(x *= x);n >>= 1;}return ret;}
#define endl '\n'
int dx[8] = {1, 0, -1, 0, 1, 1, -1, -1};
int dy[8] = {0, 1, 0, -1, 1, -1, -1, 1};

void solve(){
    INT(n);
    rep2(i,1,n+1){
        print((2*i)%n+1, (2*i+1)%n+1);
    }
}

int main() {
    cin.tie(0);
    ios_base::sync_with_stdio(false);
    cout << setprecision(20);
    int codeforces = 1;
    //cin >> codeforces;
    while(codeforces--){
        solve();
    }
    return 0;
}


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

#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;

#define oset tree<int, null_type,less<int>, rb_tree_tag,tree_order_statistics_node_update>
mt19937 rng(chrono::high_resolution_clock::now().time_since_epoch().count());

typedef long long           lol;
#define veci                vector<int>
#define pii                 pair<int,int>
#define pb                  push_back
#define ub                  upper_bound
#define lb                  lower_bound
#define all(x)              x.begin(),x.end()
#define fo(i,a,n,p)         for(int i=a;(p<0 and i>n) or (p>0 and i<n);i+=p)
#define foim                fo(i,0,m,1)
#define fojm                fo(j,0,m,1)
#define ff                  first
#define ss                  second
#define cnu                 continue
#define N                   801

int n=20, m;
vector<string> a;

bool cmp(string a, string b){
    if(a.size()-b.size()) return a.size()<b.size();
    else return a<b;
}

vector<pii> g[N];

int sprefix(string a){
    veci pi(a.size(),0);
    int i=0, n=a.size();
    while(++i<n){
        int j=pi[i-1];
        while(j>0 and a[j]!=a[i]) j=pi[j-1];
        if(a[j]==a[i]) j++;
        pi[i]=j;
    }
    return pi[a.size()-1];
}

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

    cin>>n>>m;

    foim {string s; cin>>s; a.pb(s);}
    sort(all(a),cmp);

    foim{
        fojm{
            if(i==j) cnu;
            int k=sprefix(a[j]+"$"+a[i]);
            g[i].pb({a[j].size()-k,j});
        }
        sort(all(g[i]));
    }

    vector<pair<int,string>> an;
    bool vis[m]{0};

    foim{
        if(vis[i]) cnu; vis[i]=1;
        string s=a[i]; int c=i, o=1, cou=0;
        while(s.size()<=20){
            for(auto [sc, x]: g[c]){
                if(!vis[x]){
                    if(sc) s+=a[x].substr(a[x].size()-sc,sc);
                    c=x, o++, vis[x]=1; break;
                }
            }
            cou++;
            if(cou==m) break;
        }
        // cout<<s.size()<<'\n';
        an.pb({-o,s.substr(0,min(20,(int)s.size()))});
    }

    sort(all(an));
    fo(i,0,20,1){
        cout<<an[i].ss;
        fo(j,0,20-an[i].ss.size(),1) cout<<'.';
        cout<<'\n';
    }

}

#include <cstdio>
#include <cstring>
#include <algorithm>
#include <iostream>
#include <vector>
#include <map>
#include <queue>
#include <set>
#include <cmath>
#include <queue>
#include <unordered_map>
#include <unordered_set>
#include <sstream>
#include <iomanip>
using namespace std;

using VI = vector <int>;
using VVI = vector <VI>;
using VVVI = vector <VVI>;
using VLL = vector <long long>;
using VVLL = vector <VLL>;
using UMI = unordered_map<int, int>;
using UMLL = unordered_map<long long, long long>;
using VS = vector <string>;

bool cmp(const string& a, const string& b) {
    if (a.size() != b.size()) {
        return a.size() < b.size();
    }

    return a < b;
}

string comb(const string& a, const string& b) {
    int maxlen = min(a.size(), b.size());
    for (int suf = maxlen; suf > 0; --suf) {
        bool pass = true;

        int start = a.size()-suf;
        for (int i = 0; i < suf; ++i) {
            if (a[start+i] != b[i]) {
                pass = false;
                break;
            }
        }

        if (pass) {
            return a.substr(0, a.size()-suf) + b;
        }
    }

    return a + b;
}

int main() {
    int N;
    int M;

    cin >> N >> M;

    VS gene(M);
    for (int i = 0; i < M; ++i) {
        cin >> gene[i];
    }

    while (true) {
        bool changed = false;
        VI used(gene.size());
        VS ngene;

        for (int i = 0; i < gene.size(); i++) {
            if (used[i]) {
                continue;
            }

            for (int j = i+1; j < gene.size(); ++j) {
                if (used[j]) {
                    continue;
                }

                string res = comb(gene[i], gene[j]);
                if (res.size() <= N) {
                    used[i] = used[j] = 1;
                    changed = true;
                    ngene.push_back(res);
                    break;
                }
            }
        }

        if (!changed) {
            break;
        }

        for (int i = 0; i < gene.size(); ++i) {
            if (used[i] == 0) {
                ngene.push_back(gene[i]);
            }
        }
        gene = ngene;
    }

    sort(gene.begin(), gene.end(), cmp);

    VS ans(N);
    int idx = 0;

    for (int i = 0; i < gene.size(); ++i) {
        if (ans[idx].size() + gene[i].size() < N) {
            ans[idx] += gene[i];
        } else {
            // fill in
            while (ans[idx].size() < N) {
                ans[idx] += ".";
            }
            ++idx;
        }

        if (idx == N) {
            break;
        }
    }

    for (int i = 0; i < N; ++i) {
        cout << ans[i] << endl;
    }

    return 0;
}


//
// Created by 王文海 on 2021/2/27.
//

#include <bits/stdc++.h>
using namespace std;
int main()
{
    double a,b;
    cin>>a>>b;
    printf("%.3f\n",100*(a-b)/a);

    return 0;
}

#include <iostream>
#include <algorithm>
#include <iomanip>
#include <vector>
#include <queue>
#include <set>
#include <map>
#include <tuple>
#include <cmath>
#include <numeric>
#include <functional>
#include <cassert>

#define debug_value(x) cerr << "line" << __LINE__ << ":<" << __func__ << ">:" << #x << "=" << x << endl;
#define debug(x) cerr << "line" << __LINE__ << ":<" << __func__ << ">:" << x << endl;

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

using namespace std;
typedef long long ll;

const ll MOD = 998244353;

class ModInt{
    public:
    ll v;
    ModInt(ll _v = 0){
        if(_v >= MOD) _v %= MOD;
        v = _v;
    }
    ModInt operator+(ll n){
        return ModInt((v+n)%MOD);
    }
    ModInt operator-(ll n){
        return ModInt((v-n+MOD)%MOD);
    }
    ModInt operator*(ll n){
        if(n >= MOD) n %= MOD;
        return ModInt((v*n)%MOD);
    }
    ModInt operator/(ll n){
        return ModInt((ModInt(n).inv()*v).v%MOD);
    }

    void operator+=(ll n){
        v = (v+n)%MOD;
    }
    void operator-=(ll n){
        v = (v-n+MOD)%MOD;
    }
    void operator*=(ll n){
        v = (v*n+MOD)%MOD;
    }

    ModInt operator+(ModInt n){
        return ModInt((v+n.v)%MOD);
    }
    ModInt operator-(ModInt n){
        return ModInt((v-n.v+MOD)%MOD);
    }
    ModInt operator*(ModInt n){
        return ModInt((v*n.v)%MOD);
    }
    ModInt operator/(ModInt n){
        return ModInt((n.inv()*v).v%MOD);
    }

    void operator+=(ModInt n){
        v = (v+n.v)%MOD;
    }
    void operator-=(ModInt n){
        v = (v-n.v+MOD)%MOD;
    }
    void operator*=(ModInt n){
        v = (v*n.v)%MOD;
    }

    void operator=(ModInt n){
        v = n.v;
    }
    bool operator==(ModInt n){
        return v == n.v;
    }
    bool operator!=(ModInt n){
        return v != n.v;
    }
    void operator=(ll n){
        v = n%MOD;
    }

    ModInt inv(){
        if(v == 1) return ModInt(1);
        else return ModInt(MOD-ModInt(MOD%v).inv().v*(MOD/v)%MOD);
    }
};

ostream& operator<<(ostream& os, const ModInt& m){
    os << m.v;
    return os;
}

istream & operator >> (istream &in,  ModInt &m){
    in >> m.v;
    return in;
}

ModInt pow(ModInt a, ll n) {
	ModInt ans = 1;
	ModInt tmp = a;
	for (int i = 0; i <= 60; i++) {
		ll m = (ll)1 << i;
		if (m & n) {
		ans *= tmp;
		}
		tmp *= tmp;
	}
	return ans;
}

using mint = ModInt;

int cnt[22][200005];
int NMAX = 200000;

void init(){
    for(int i = 1; i <= NMAX; i++) cnt[1][i] = 1;
    for(int i = 1; i <= 20; i++){
        for(int j = 1; j <= NMAX; j++){
            for(int k = 2; j*k <= NMAX; k++){
                cnt[i+1][j*k] += cnt[i][j];
            }
        }
    }
}

#define N_MAX 200002
ModInt inv[N_MAX],fac[N_MAX],finv[N_MAX];

void init_fac(){
    fac[0]=1;fac[1]=1;
    finv[0]=1;finv[1]=1;
    inv[1]=1;
    for(int i=2;i<N_MAX;i++){
        inv[i]=(ModInt)MOD-inv[MOD%i]*(MOD/i);
        fac[i]=fac[i-1]*(ll) i;
        finv[i]=finv[i-1]*inv[i];
    }
}

ModInt comb(ll n, ll r){
    if(n < r){
        return ModInt(0);
    }else{
        return fac[n]*finv[r]*finv[n-r];
    }
}

int main(){
    ios::sync_with_stdio(false);
    cin.tie(0);
    cout << setprecision(10) << fixed;
    init();
    init_fac();
    int n, m; cin >> n >> m;
    mint ans = 0;
    for(int i = 1; i <= m; i++){
        for(int j = 1; j <= n && j <= 20; j++){
            ans += comb(n-1, j-1)*cnt[j][i];
        }
    }
    cout << ans << endl;
}


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

#include<cstdio>
#include<cstring>

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

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

ll imos[200010];
int main() {
	//cin.tie(0);
	//ios::sync_with_stdio(false);

	int N = getint(), W = getint();

	rep(i, N) {
		int s = getint2(), t = getint2(), p = getint();
		imos[s] += p;
		imos[t] -= p;
	}

	if (imos[0] > W) {
		printf("No");
		return 0;
	}

	rep(i, 200001) {
		imos[i + 1] += imos[i];
		if (imos[i + 1] > W) {
			printf("No");
			return 0;
		}
	}

	printf("Yes");

	Would you please return 0;
}

#include<bits/stdc++.h>

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

#define fast ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);

#define pb          	push_back
#define mp          	make_pair
#define F           	first
#define S           	second
#define pll				pair<int , int>
#define int             long long int
#define endl            "\n"

#define ALL(v)      	v.begin(),v.end()
#define ALLR(v)     	v.rbegin(),v.rend()
#define pii         	3.14159265358979323
#define inf     		LLONG_MAX
#define ones(x)     	__builtin_popcount(x)
#define fill(a,b)   	memset(a,b,sizeof(a))
#define mod 			1000000007
#define hell            998244353

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

ll mod_inverse(int a , int m)
{
	return mod_pow(a , m - 2 , m);
}

int go(vector<pll> a) {
	if(a.size() == 1) {
		return a[0].S;
	}
	vector<pll> b;
	for(int i = 0; i < a.size(); ++i) {
		if(a[i].F > a[i + 1].F) {
			b.pb(a[i]);
		}
		else {
			b.pb(a[i + 1]);
		}
		i++;
	}
	return go(b);
}

void solve() {
	int n , c;

	cin >> n >> c;

	map<int , int> f;

	for(int i = 0; i < n; ++i) {
		int l , r , x;

		cin >> l >> r >> x;

		f[l] += x;
		f[r + 1] -= x;
	}

	int cur = 0;
	int last = -1;

	int tot = 0;

	for(auto u : f) {
		if(last == -1) {
			cur += u.S;
			last = u.F;
		}
		else {
			if(cur > c) {
				tot += (u.F - last)*c;
			}
			else {
				tot += (u.F - last)*cur;
			}
			last = u.F;
			cur += u.S;
		}
	}

	cout << tot << endl;
}

signed main() {
	fast;

    int t = 1;

	//cin >> t;

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

    return 0;
}


#include "iostream"
#include "algorithm"
#include "cstring"
#include "cstdio"
#include "cmath"
#include "vector"
#include "map"
#include "set"
#include "queue"
using namespace std;
#define MAXN 2006
//#define int long long
#define rep(i, a, b) for (int i = (a), i##end = (b); i <= i##end; ++i)
#define per(i, a, b) for (int i = (a), i##end = (b); i >= i##end; --i)
#define pii pair<int,int>
#define fi first
#define se second
#define mp make_pair
#define pb push_back
#define eb emplace_back
#define vi vector<int>
#define all(x) (x).begin() , (x).end()
#define mem( a ) memset( a , 0 , sizeof a )
typedef long long ll;
int n , m;
int A[MAXN];
char ch[MAXN];
void solve() {
	scanf("%s",ch + 1);
	n = strlen( ch + 1 );
	string r = ch + 1;
	if( r > "atcoder" ) return puts("0") , void();
	int res = -1;
	rep( i , 1 , n ) if( ch[i] != 'a' ) {
		if( ch[i] > 't' && i > 2 ) res = i - 2;
		else res = i - 1;
		if( ~res ) break;
	}
	cout << res << endl;
}

signed main() {
    int T;cin >> T;while( T-- ) solve();
//    solve();
}

#include <bits/stdc++.h>

using namespace std;

typedef long long i64;
typedef i64 int_t;
typedef vector<int_t> vi;
typedef vector<vi> vvi;

typedef pair<int_t, int_t> pi;

#define tr(c, i) for(auto i = (c).begin(); i != (c).end(); i++)
#define pb push_back
#define sz(a) i64((a).size())
#define all(c) (c).begin(), (c).end()
#define REP(s, e, i) for(i=(s); i < (e); ++i)

int main(int argc, char *argv[]) {
  i64 T, t;
  cin >> T;
  const string Q = "atcoder";
  REP(0, T, t) {
    i64 i, c;
    string S;
    cin >> S;

    vvi pos(26);
    REP(0, sz(S), i) {
      i64 c = S[i] - 'a';
      pos[c].pb(i);
    }

    if(pos[0].size() == S.size()) {
      cout << -1 << endl;
      continue;
    }

    const i64 MAX = 100000000;
    i64 ans = MAX;
    bool eq = true;
    REP(0, sz(Q), i) {
      if(i >= sz(S)) {
	break;
      }

      if(S[i] > Q[i] && eq) {
	ans = 0;
	break;
      }

      if(eq) {
	REP(Q[i]-'a'+1, 26, c) {
	  if(!pos[c].empty()) {
	    auto lb = lower_bound(all(pos[c]), i);
	    if(lb != pos[c].end()) {
	      ans = min(ans, (*lb) - i);
	    }
	  }
	}
      }

      if(S[i] != Q[i]) {
	eq = false;
      }

    }

    if(sz(S) > sz(Q) && eq) {
      ans = 0;
    }

    if(ans == MAX) {
      ans = -1;
    }

    cout << ans << endl;
  }

  return 0;
}


#include <bits/stdc++.h>
#pragma GCC optimize("Ofast")
#pragma GCC target("avx,avx2,fma")

#define f(i,a,b) for(ll  i = a; i < (ll) b ; i++ )
#define af(i,a,b) for(ll i = a; i >= (ll) b ; i--)
#define rep(i,a,b,k) for(ll  i = a; i < (ll) b ; i+= k )
#define arep(i,a,b,k) for(ll i = a; i >= (ll) b ; i-= k)
#define ff first
#define ss second
#define pb push_back
#define mp make_pair
#define all(a) a.begin(), a.end()
#define sz(a) (ll) a.size()
#define sor(a) sort( a.begin(), a.end() )
#define fastio ios_base::sync_with_stdio(false);cin.tie(NULL)
#define inter   ios::sync_with_stdio(false);cin.tie(0)

// policy-based

using namespace std;

typedef int ll; // int or long long
typedef long double ld;
typedef pair<ll,ll> ii ;
typedef vector<ll>  vi ;
typedef vector<ii> vii ;

const ll MAX = 3e5 + 10;
const ll mod = 998244353;
const ll inf = 1e9;

ll n,q,p[MAX],sz[MAX];

map< ll ,ll > m[MAX];
void ini(){
	f(i,1,n+1) p[i] = i, sz[i] = 1;
}

ll find(ll u){
	return (p[u] == u? u : p[u] = find(p[u]));
}

void uni(ll u,ll v){
	ll x = find(u), y = find(v);
	if(x == y) return;
	if( sz[x] > sz[y]) swap(x,y);
	for(ii it:m[x]) m[y][it.ff] += it.ss;
	m[x].swap(m[y]);
	p[y] = x;
	sz[x] += sz[y];

}

int main(){
	fastio;
	ll t,u,v;
	cin >> n >> q;
	ini();
	f(i,1,n+1) cin >> u, m[i][u]++;
	while(q--){
		cin >> t >> u >> v;
		if(t == 1) uni(u,v);
		else cout << m[find(u)][v] << endl;
	}
    return 0;
}

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

#include<cstdio>
#include<cstring>
#include<algorithm>

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

//mapとか考えもしなかったしさっさと引退しろって感じですね

const int SZ = 200000;
int P[SZ + 1];
int find(int A) {
	if (P[A] < 0) return A;
	return P[A] = find(P[A]);
}
int N, Q;
int C[200001];
int ne[200001], he[200001];
ll to[200001];
int A[200001];
int c[200001], kotae[200001];

const int CM = 1 << 17, CL = 16;
char cn[CM + CL], * ci = cn + CL, * owa = cn + CM, ct;
const ll ma0 = 1157442765409226768;
const ll ma1 = 1085102592571150095;
const ll ma2 = 71777214294589695;
const ll ma3 = 281470681808895;
const ll ma4 = 4294967295;
inline int getint() {
	ll tmp = *(ll*)ci;
	int dig = 68 - __builtin_ctzll((tmp & ma0) ^ ma0);
	tmp = tmp << dig & ma1;
	tmp = tmp * 10 + (tmp >> 8) & ma2;
	tmp = tmp * 100 + (tmp >> 16) & ma3;
	tmp = tmp * 10000 + (tmp >> 32) & ma4;
	ci += 72 - dig >> 3;
	return tmp;
}
const int MAX = 1000;
class shuturyoku_unko {
public:
	char C[MAX * 4];
	constexpr shuturyoku_unko() : C() {
		rep(i, MAX) {
			int X = i;
			rep(j, 3) {
				C[i * 4 + 2 - j] = '0' + X % 10;
				X /= 10;
			}
			C[i * 4 + 3] = '\n';
		}
	}
};
constexpr shuturyoku_unko f;
const int dm = 1 << 17;
char* dn = cn, * di = dn, * owad = dn + dm - 20;
void putint(int A) {
	if (owad < di) {
		fwrite(dn, 1, di - dn, stdout);
		di = dn;
	}
	if (A >= 1000) {
		int dig = 1;
		if (A >= 100000) dig = 3;
		else if (A >= 10000) dig = 2;
		memcpy(di, f.C + A / 1000 * 4 + 3 - dig, dig);
		memcpy(di + dig, f.C + A % 1000 * 4, 4);
		di += dig + 4;
	}
	else {
		int dig = 1;
		if (A >= 100) dig = 3;
		else if (A >= 10) dig = 2;
		memcpy(di, f.C + A * 4 + 3 - dig, dig + 1);
		di += dig + 1;
	}
}

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

	fread(cn + CL, 1, CM, stdin);

	N = getint();
	Q = getint();
	rep1(i, N) {
		if (ci - owa > 0) {
			memcpy(cn, owa, CL);
			ci -= CM;
			fread(cn + CL, 1, CM, stdin);
		}
		C[i] = getint();
	}

	rep1(i, SZ) P[i] = -1;

	int k = 1;
	rep1(i, Q) {
		if (ci - owa > 0) {
			memcpy(cn, owa, CL);
			ci -= CM;
			fread(cn + CL, 1, CM, stdin);
		}
		char c = *ci;
		ci += 2;
		if (c == '1') {
			int a = getint(), b = getint();
			a = find(a);
			b = find(b);
			if (a != b) {
				if (P[a] > P[b]) swap(a, b);
				P[a] += P[b];
				P[b] = a;
				to[k] = b;
				ne[k] = he[a];
				he[a] = k++;
			}
		}
		else {
			int a = getint(), b = getint();
			a = find(a);
			to[k] = (ll)i << 30 | b;
			ne[k] = he[a];
			he[a] = k++;
		}
	}

	int k2 = 0;
	rep1(i, N) {
		if (P[i] < 0) {
			A[k2++] = i;
			while (k2) {
				int a = A[--k2];
				if (a > 0) {
					for (int j = he[a]; j; j = ne[j]) {
						ll t = to[j];
						if (t >> 30) {
							kotae[t >> 30] = 1000000 - c[t & ((1 << 20) - 1)];
							A[k2++] = -j;
						}
						else {
							A[k2++] = t;
						}
					}
					c[C[a]]++;
				}
				else {
					ll t = to[-a];
					kotae[t >> 30] += c[t & ((1 << 20) - 1)];
				}
			}
		}
	}

	rep1(i, Q) {
		if (kotae[i] >= 1000000) putint(kotae[i] - 1000000);
	}
	fwrite(dn, 1, di - dn, stdout);

	Would you please return 0;
}


#ifndef ONLINE_JUDGE
#define _GLIBCXX_DEBUG //checks for container overflows
#pragma GCC optimize "trapv" //to chcek for int overflow
#pragma -Wduplicated-cond //dupilcate conditions
#endif
#include "bits/stdc++.h"
using namespace std;
using namespace chrono;
typedef unsigned long long int ull;
typedef long long ll;
#define F first
// #define S second
#define nl '\n'
#define de1(x) cerr << #x << ":" << x <<nl;
#define de2(x,y) cerr << #x << ":" << x << " " << #y << ":" << y << nl
#define de3(x,y,z) cerr<<#x<<": "<<x<<" | "<<#y<<": "<<y<<" | "<<#z<<": "<<z<<nl
#define de4(x,y,z,w) cerr<<#x<<": "<<x<<" | "<<#y<<": "<<y<<" | "<<#z<<": "<<z<<" | "<<#w<<": "<<w<<nl
#define all(x) x.begin(), x.end()
#define rt return 0;
#define vvi vector<vector<int>>
#define vi vector<int>
#define vpi vector<pair<int,int>>
#define fast ios_base::sync_with_stdio(0); cin.tie(0);
#define pb push_back
#define um unordered_map<int,int>
const float pi = 3.14;
const ull mod = 1ll << 32;

void solve()
{
  stack<char> s;

  int n;
  string str;
  cin >> n >> str;
  if (n <= 3 && str != "fox")
  {
    cout << n;
    return;
  }

  register int cnt = 0, i;

  for (i = 0; i < n; i++)
  {
    if (str[i] == 'x' && s.size() && s.top() == 'o')
    {
      s.pop();
      if (s.size() && s.top() == 'f')
      {
        cnt += 3;
        s.pop();
        continue;
      }
      s.push('o');
      s.push('x');
    }

    else
      s.push(str[i]);
  }

  cout << n - cnt;

}

int main() {

#ifndef ONLINE_JUDGE
  auto start = high_resolution_clock::now();
  freopen("input.txt", "r", stdin);
  freopen("output.txt", "w", stdout);
#endif
  fast

  solve();

#ifndef ONLINE_JUDGE
  auto end = high_resolution_clock::now();
  double time_taken = duration_cast<nanoseconds>(end - start).count();
  time_taken *= 1e-9;
  cerr << "Time : " << fixed << time_taken << setprecision(9) << nl;
#endif
  return 0;
}

#include <bits/stdc++.h>
#define rep(i,n) for (int i = 0; i < (int)(n); i++)
#define REP(i,n) for (int i = 1; i < (int)(n); i++)
#define all(x) x.begin(),x.end()
#define rall(x) x.rbegin(),x.rend()
#define debug(var) do{cout << #var << " : "; view(var);}while(0)
template<class T> bool chmin(T &a, T b) {if(a>b) {a=b;return 1;}return 0;}
template<class T> bool chmax(T &a, T b) {if(a<b) {a=b;return 1;}return 0;}
using namespace std;
template<class T> void view(T e) {cout << e << endl;}
template<class T> void view(const vector<T> &v) {for(const auto &e : v){cout << e << " ";} cout << endl;}
template<class T> void view(const vector<vector<T>> &vv) {for(const auto &v : vv){view(v);}}
using vint = vector<int>;
using vvint = vector<vector<int>>;
using ll = long long;
using vll = vector<ll>;
using vvll = vector<vector<ll>>;
using P = pair<int,int>;
const int inf = 1<<30;
const ll inf_l = 1LL<<61;
const int MAX = 1e5;

int main() {
    int n; cin >> n;
    string s; cin >> s;
    string t;
    rep(i,n) {
        t += s[i];
        int sz = t.size();
        if (sz - 3 >= 0 && t.substr(sz - 3, 3) == "fox") {
            rep(i,3) t.pop_back();
        }
    }
    int ans = t.size();
    cout << ans << endl;
}


#include <iostream>
#include <algorithm>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <string.h>
#include <vector>
#include <queue>
#include <cmath>
#include <complex>
#include <functional>
#include <numeric>
#include <iomanip>
#include <cassert>
#include <random>
#include <chrono>

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

void debug_out(){ cout << "\n"; }
template <typename Head, typename... Tail>
void debug_out(Head H, Tail... T) {
  cout << H << " ";
  debug_out(T...);
}
#ifdef _DEBUG
#define debug(...) debug_out(__VA_ARGS__)
#else
#define debug(...)
#endif

#define SPBR(w, n) std::cout<<(w + 1 == n ? '\n' : ' ');
#define YES cout << "YES" << endl
#define Yes cout << "Yes" << endl
#define NO cout << "NO" << endl
#define No cout << "No" << endl
#define ALL(i) (i).begin(), (i).end()
#define FOR(i, a, n) for(int i=(a);i<(n);++i)
#define RFOR(i, a, n) for(int i=(n)-1;i>=(a);--i)
#define REP(i, n) for(int i=0;i<int(n);++i)
#define RREP(i, n) for(int i=int(n)-1;i>=0;--i)
#define IN(a, x, b) (a<=x && x<b)
#define OUT(a, x, b) (x<a || b<=x)
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }

#define int ll
using ll = long long;
using ull = unsigned long long;
using ld = long double;
const ll MOD = 1000000007;
/* const ll MOD = 998244353; */
const ll INF = 1ll<<60;
const double PI = acos(-1);

struct INIT { INIT(){
  cin.tie(0); ios::sync_with_stdio(false);
  cout << fixed << setprecision(10);
}}INIT;

void f(ld x, ld y, ld t, ld &ax, ld &ay){
  ax = cos(t)*x - sin(t)*y;
  ay = sin(t)*x + cos(t)*y;
}

int N;
void solve(ld x0, ld y0, ld xn, ld yn, ld &ax, ld &ay){
  ld mx = double(x0+xn)/2;
  ld my = double(y0+yn)/2;

  ld h = atan2(yn-y0, xn-x0);
  ld r = sqrt((x0-xn)*(x0-xn) + (y0-yn)*(y0-yn))/2;

  /* cout << h*180/PI << "\n"; */
  ld x00, y00, xn0, yn0;
  ld mx0, my0;
  f(x0, y0, -h, x00, y00);
  f(xn, yn, -h, xn0, yn0);
  f(mx, my, -h, mx0, my0);

  ld t = 2*PI/N;

  /* cout << x00 << " " << y00 << "\n"; */
  /* cout << xn0 << " " << yn0 << "\n"; */

  if(x00 < xn0){
    t += PI;
  }

  /* cout << t*180/PI << "\n"; */

  /* cout << "\n"; */
  /* cout << mx0 << " " << my0 << "\n"; */

  mx0 += r*cos(t);
  my0 += r*sin(t);

/*   cout << mx0 << " " << my0 << "\n"; */

  f(mx0, my0, h, ax, ay);
}

signed main() {
  cin >> N;

  ld x0, y0, xn, yn;
  cin >> x0 >> y0 >> xn >> yn;

  ld ax, ay;
  solve(x0, y0, xn, yn, ax, ay);

  cout << ax << " " << ay << "\n";

  return 0;
}

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

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

typedef long long ll;

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 main() {
	ll N;
	cin >> N;

	vector<ll> x(N);
	vector<ll> y(N);
	ll x_;
	ll y_;
	ll max_x;
	ll max_x_i = 0;
	ll min_x;
	ll min_x_i = 0;

	ll max_y;
	ll max_y_i = 0;
	ll min_y;
	ll min_y_i= 0;

	rep(i,0,N){
		cin >> x_;
		x[i] = x_;
		cin >> y_;
		y[i] = y_;
		if (i==0){
			max_x = x_;
			min_x = x_;
			max_y = y_;
			min_y = y_;
		} else {
			if (max_x < x_) {
				max_x = x_;
				max_x_i = i;
			}if (max_y < y_) {
				max_y = y_;
				max_y_i = i;
			}
			if (min_x > x_) {
				min_x = x_;
				min_x_i = i;
			}if (min_y > y_) {
				min_y = y_;
				min_y_i = i;
			}
		}

	}
	sort(x.begin(), x.end());
	sort(y.begin(), y.end());
	ll ans = 0;
	vector<ll> temp(6);
	if (max_x_i == max_y_i && min_x_i == min_y_i) {
		chmax(ans, x[N-1]-x[1]);
		chmax(ans, x[N-2]-x[0]);
		chmax(ans, y[N-1]-y[1]);
		chmax(ans, y[N-2]-y[0]);
	} else if (max_x_i == min_y_i && min_x_i == max_y_i){
		chmax(ans, x[N-1]-x[1]);
		chmax(ans, x[N-2]-x[0]);
		chmax(ans, y[N-1]-y[1]);
		chmax(ans, y[N-2]-y[0]);

	} else {
		temp[0] = x[N-1]-x[0];
		temp[1] = y[N-1]-y[0];
		temp[2] = x[N-2]-x[0];
		temp[3] = y[N-2]-y[0];
		temp[4] = x[N-1]-x[1];
		temp[5] = y[N-1]-y[1];
		sort(temp.begin(), temp.end());
		ans = temp[4];
	}
	cout << ans << endl;
}


// E - Rush Hour 2
#include <bits/stdc++.h>
using namespace std;
using ll = int64_t;
#define vec vector
using vl = vec<ll>;
#define rep(i,e) for(int i=0;i<(e);++i)
using PR = pair<ll,int>;

// 本問用に修正
// dijkstra O(|E|log|V|)
int V;
vec<tuple<int,int,int,int>> E;
vec<vec<int>> G;
ll INF = 1e18;

vl dijkstra(int s){
	vl dist(V, INF);
	dist[s] = 0;
	priority_queue<PR, vec<PR>, greater<PR>> pq;
	pq.push({0, s});
	while(pq.size()){
		auto[t, v] = pq.top(); pq.pop();
		if(dist[v] < t) continue;
		for(int&i:G[v]){
			auto&[a, b, c, d] = E[i];
			int u = a==v? b:a;
			ll k = max(t, ll(sqrt(d) - .5));
			ll nt = k + c + d / (k+1);
			if(dist[u] <= nt) continue;
			dist[u] = nt;
			pq.push({nt, u});
		}
	}
	return dist;
}

int main(){
	int m; cin>>V>>m;
	G.resize(V);
	rep(i, m){
		int a, b, c, d; cin>>a>>b>>c>>d; --a, --b;
		E.emplace_back(a, b, c, d);
		G[a].push_back(i), G[b].push_back(i);
	}
	ll ans = dijkstra(0)[V-1];
	if(ans == INF) ans = -1;
	cout<< ans <<endl;
}

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

#define int long long
#define fast ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
#define pb push_back
#define ff first
#define ss second
// #define endl '\n'
#define mod 1000000007

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

const int MXN = 2e5 + 1;
vector<pair<int, pair<int, int> > > adj[MXN];
int n, m;
int a[MXN];

int fun(int x, int t){
    if(t > x) return t;
    int l = sqrt(x) - 3;
    int r = sqrt(x) + 3;
    int mx = 1e18, ans = 0;
    for(int i = l; i <= r; i++){
        if(i < 0 || i > x) continue;
        if(i + x/(i + 1) < mx){
            mx = i + x/(i + 1);
            ans = i;
        }
    }
    return ans;
}

void solve(){
    cin >> n >> m;
    for(int i = 1; i <= m; i++){
        int a, b, c, d;
        cin >> a >> b >> c >> d;
        adj[a].pb({b, {c, d}});
        adj[b].pb({a, {c, d}});
    }
    priority_queue<pair<int, int>, vector<pair<int, int> >, greater<pair<int, int> > > pq;
    int time[n + 1], vis[n + 1] = {0};
    for(int i = 2; i <= n; i++) time[i] = 1e18;
    time[1] = 0;
    pq.push({0, 1});
    while(pq.size()){
        auto p = pq.top();
        pq.pop();
        int u = p.ss;
        if(vis[u]) continue;
        vis[u] = 1;
        if(u == n) return void(cout << time[n] << endl);
        // cout << u << endl;
        for(auto i : adj[u]){
            if(vis[i.ff]) continue;
            int t = time[u];
            int tmp, x = sqrt(i.ss.ss);
            tmp = t + i.ss.ss/(t + 1);
            if(t < x){
                tmp = min(tmp, x + i.ss.ss/(x + 1));
            }
            if(t < x - 1 && x > 0){
                tmp = min(tmp, x - 1 + i.ss.ss/(x));
            }
            // cout << t << endl;
            if(time[i.ff] > tmp + i.ss.ff){
                time[i.ff] = tmp + i.ss.ff;
                pq.push({time[i.ff], i.ff});
            }
        }
    }
    // for(int i = 1; i <= n; i++) cout << time[i] << ' ';
    if(time[n] == 1e18) cout << -1 << endl;
    else cout << time[n] << endl;
}

signed main(){
    fast
    int t = 1;
    // cin >> t;
    for(int i = 1; i <= t; i++){
        solve();
    }
}


#pragma GCC optimize ("O3")
#pragma GCC target ("sse4")
#include<stdio.h>
#include<iostream>
#include<vector>
#include<algorithm>
#include<string>
#include<string.h>

#ifdef LOCAL
#define eprintf(...) fprintf(stderr, __VA_ARGS__)
#else
#define NDEBUG
#define eprintf(...) do {} while (0)
#endif
#include<cassert>

using namespace std;

typedef long long LL;
typedef vector<int> VI;

#define REP(i,n) for(int i=0, i##_len=(n); i<i##_len; ++i)
#define EACH(i,c) for(__typeof((c).begin()) i=(c).begin(),i##_end=(c).end();i!=i##_end;++i)

template<class T> inline void amin(T &x, const T &y) { if (y<x) x=y; }
template<class T> inline void amax(T &x, const T &y) { if (x<y) x=y; }
#define rprintf(fmt, begin, end) do { const auto end_rp = (end); auto it_rp = (begin); for (bool sp_rp=0; it_rp!=end_rp; ++it_rp) { if (sp_rp) putchar(' '); else sp_rp = true; printf(fmt, *it_rp); } putchar('\n'); } while(0)

int N;
int A[2511];

void MAIN() {
    scanf("%d", &N);
    A[0] = 6;
    A[1] = 10;
    A[2] = 15;
    int cnt = 3;
    for (int i=12; cnt<N; i++) {
	if (i == 6 || i == 10 || i == 15) continue;
	if (i % 6 == 0 || i % 10 == 0 || i % 15 == 0) {
	    A[cnt++] = i;
	}
    }

    rprintf("%d", A, A+N);
}

int main() {
    int TC = 1;
//    scanf("%d", &TC);
    REP (tc, TC) MAIN();
    return 0;
}

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

typedef long long lli;
int MOD = 998244353;
inline int add(const int a, const int b, const int mod = MOD) { return (a + b >= mod) ? (a + b - mod) : (a + b); }
inline void _add(int &a, const int b, const int mod = MOD) { a = add(a, b, mod); }
inline int sub(const int a, const int b, const int mod = MOD) { return (a - b < 0) ? (a - b + mod) : (a - b); }
inline void _sub(int &a, const int b, const int mod = MOD) { a = sub(a, b, mod); }
inline int negate(const int a, const int mod = MOD) { return mod - a; }
inline int mul(const int a, const int b, const int mod = MOD) { return (a * 1ll * b) % mod; }
inline void _mul(int &a, const int b, const int mod = MOD) { a = mul(a, b, mod); }
int binPow(int b, lli p, const int mod = MOD) {
	int r = 1;
	while (p) {
		if (p & 1) r = mul(r, b, mod);
		b = mul(b, b, mod);
		p >>= 1;
	}
	return r;
}
int gcdex(int a, int b, int &x, int &y) {
	if (!b) return x = 1, y = 0, a;
	int px, py, res = gcdex(b, a % b, px, py);
	return x = py, y = px - a / b * py, res;
}
int inv(const int a, const int mod = MOD) { // a and mod must be coprime
	int x, y;
	int g = gcdex(a, mod, x, y);
	assert(g == 1);
	x = (x % mod + mod) % mod;
	return x;
}
inline int dvd(const int a, const int b, const int mod = MOD) { // b and mod must be coprime
	int rev = inv(b, mod);
	return mul(a, inv(b, mod), mod);
} // b != 0
inline void _dvd(int &a, const int b, const int mod = MOD) { a = dvd(a, b, mod); } // b and mod must be coprime
inline int convert(int x, const int mod = MOD) {
	int tx = x % mod + mod;
	return tx >= mod ? tx - mod : tx;
};

int main () {
    int n;
    int i2 = inv(2);
    while (scanf("%d", &n) == 1) {
        vector<int> a(n);
        for (auto &x : a) scanf("%d", &x);
        sort(a.begin(), a.end());

        int pol = 0;
        for (int i = 0; i < n; i++) pol = add(mul(pol, 2), a[i]);

        int res = 0;
        for (int i = n - 1; i >= 0; i--) {
            _sub(pol, a[i]);
            _mul(pol, i2);
            _add(res, mul(a[i], add(pol, a[i])));
        }

        printf("%d\n\n", res);
    }
}


#include<bits/stdc++.h>
#include<bits/extc++.h>
#pragma GCC optimize("Ofast")
using namespace std;
using namespace __gnu_pbds;
template<typename TH> void _dbg(const char* sdbg, TH h) { cerr<<sdbg<<"="<<h<<"\n"; }
template<typename TH, typename... TA> void _dbg(const char* sdbg, TH h, TA... t){
	while(*sdbg != ',') { cerr<<*sdbg++; } cerr<<"="<<h<<","; _dbg(sdbg+1, t...);
}
#ifdef DEBUG
#define debug(...) _dbg(#__VA_ARGS__, __VA_ARGS__)
#define debugv(x) {{cerr<<#x<<": "; for(auto i:x) cerr<<i<<" "; cerr<<endl;}}
#define debugr(l,r,x) {{cerr<<#x<<": "; for(int i=l;i<=r;i++) cerr<<x<<" "; cerr<<endl;}}
#else
#define debug(...) (__VA_ARGS__)
#define debugv(x)
#define debugr(l,r,x)
#define cerr while(0) cerr
#endif
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
typedef long long ll;
typedef vector<int> vi;
typedef pair<int, int> pii;
#define priority_queue std::priority_queue
#define F first
#define S second
typedef tree<int,null_type,less<int>,rb_tree_tag,tree_order_statistics_node_update> ordered_set;

ll INF=1e18;
ll val(string x, ll M){
	ll ans=0;
	for(char c:x){
		int d=c-'0';
		if(ans > INF/M) return INF+1;
		ans=ans*M+d;
	}
	return ans;
}
signed main(){
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	cout.tie(NULL);
	string x;
	ll m;
	cin>>x>>m;
	if(x.size()==1){
		if((int) x[0]-'0'<=m) cout<<1;
		else cout<<0;
		return 0;
	}
	int d=0;
	for(char c:x){
		d=max(d, (int) c-'0');
	}
	ll L=d, R=m;
	while(L<R){
		ll M=(L+R+1)/2;
		if(val(x, M)<=m) L=M;
		else R=M-1;
	}
	cout<<L-d;
}

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

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

  if( S == "1" ){
    cout << 1 << endl;
    return 0;
  }else if( S.size() == 1 ){
    if( (int)S[0]-'0' <= M ) cout << 1 << endl;
    else cout << 0 << endl;
    return 0;
  }

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

  int maxnum = 0;
  rep(i, S.size()) maxnum = max(maxnum, (int)(S[i]-'0'));

  int l = 0;
  int r = M+1;
  while( r-l > 1 ){
    int mid = (l+r)/2;
    bool overf = 0; //今見てる数が10^18を超えているか
    bool check = 1;
    int kake = 1;
    int now = 0;
    rep(i, S.size()){
      int c = S[i]-'0';
      if( overf == 1 ){ //今見てる数がオーバーフローする場合
        if( c > 0 ){
          check = 0;
          break;
        }else continue;
      }else now += c*kake;

      if( kake > M/mid ) overf = 1;
      if( overf == 0 ) kake *= mid;
    }
    if( check == 1 && now <= M ) l = mid;
    else r = mid;
  }

  if( r > maxnum ) cout << r-maxnum-1 << endl;
  else cout << 0 << endl;
}


#include <bits/stdc++.h>
#define rep(i, n) for(int(i) = 0; (i) < (n); (i)++)
#define FOR(i, m, n) for(int(i) = (m); (i) < (n); (i)++)
#define ALL(v) (v).begin(), (v).end()
#define LLA(v) (v).rbegin(), (v).rend()
#define SZ(v) (v).size()
#define INT(...)                                                               \
    int __VA_ARGS__;                                                           \
    read(__VA_ARGS__)
#define LL(...)                                                                \
    ll __VA_ARGS__;                                                            \
    read(__VA_ARGS__)
#define DOUBLE(...)                                                            \
    double __VA_ARGS__;                                                        \
    read(__VA_ARGS__)
#define CHAR(...)                                                              \
    char __VA_ARGS__;                                                          \
    read(__VA_ARGS__)
#define STRING(...)                                                            \
    string __VA_ARGS__;                                                        \
    read(__VA_ARGS__)
#define VEC(type, name, size)                                                  \
    vector<type> name(size);                                                   \
    read(name)
using namespace std;
using ll = long long;
using pii = pair<int, int>;
using pll = pair<ll, ll>;
using Graph = vector<vector<int>>;
template <typename T> struct edge {
    int to;
    T cost;
    edge(int t, T c) : to(t), cost(c) {}
};
template <typename T> using WGraph = vector<vector<edge<T>>>;
const int INF = 1 << 30;
const ll LINF = 1LL << 60;
const int MOD = 1e9 + 7;
template <class T> inline vector<T> make_vec(size_t a, T val) {
    return vector<T>(a, val);
}
template <class... Ts> inline auto make_vec(size_t a, Ts... ts) {
    return vector<decltype(make_vec(ts...))>(a, make_vec(ts...));
}

void read() {}
template <class T> inline void read(T &a) { cin >> a; }
template <class T, class S> inline void read(pair<T, S> &p) {
    read(p.first), read(p.second);
}
template <class T> inline void read(vector<T> &v) {
    for(auto &a : v)
        read(a);
}
template <class Head, class... Tail>
inline void read(Head &head, Tail &...tail) {
    read(head), read(tail...);
}
template <class T> inline void chmax(T &a, T b) { (a < b ? a = b : a); }
template <class T> inline void chmin(T &a, T b) { (a > b ? a = b : a); }

int main() {
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    INT(x);
    cout << 100 - (x % 100) << endl;
}

#include<bits/stdc++.h>
using namespace std;
using ll = long long;
using vb = vector<bool>;
using vi = vector<int>;
using vvi = vector<vector<int>>;
using vl = vector<long long>;
using vvl = vector<vector<long long>>;
using vc = vector<char>;
using vvc = vector<vector<char>>;
using P = pair<int,int>;
const long long MOD2 = 998244353LL;
const long long MOD = 1000000007LL;
const long long INF = 1LL<<60;

int main(){
   int x;
   cin >> x;
   int k = x / 100 +1;
   if(x % 100 == 0)cout << 100 << endl;
   else cout << k*100 - x << endl;
   return 0;
}


#include <iostream>
using namespace std;
#define MAX_N 1000010
#define int long long
int a[MAX_N],b[MAX_N],c[MAX_N],n;
int a2[MAX_N],b2[MAX_N],c2[MAX_N];
signed main(){
    cin >> n;
    for(int i = 1;i <= n;i++){
        cin >> a[i];
        a2[a[i]]++;
    }
    for(int i = 1;i <= n;i++){
        cin >> b[i];
        c2[i] = a2[b[i]];
    }
    int ans = 0;
    for(int i = 1;i <= n;i++){
        cin >> c[i];
        ans += c2[c[i]];
    }
    cout << ans << endl;
    return 0;
}

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

int main(void)
{
    int64_t N; cin >> N;
    vector<int64_t> A(N);
    rep(i, N) cin >> A.at(i);
    vector<int64_t> B(N);
    rep(i, N) cin >> B.at(i);
    vector<int64_t> C(N);
    rep(i, N) {
        cin >> C.at(i);
        C.at(i)--;
    }
    vector<int64_t> X(N);
    rep(i, N) X.at(i) = B.at(C.at(i));
    sort(A.begin(), A.end());
    sort(X.begin(), X.end());
    int64_t xi = 0, cA = 0, cX = 0, ans = 0;
    rep(i, N) {
        if (A.at(i) < X.at(xi)) continue;
        while (A.at(i) > X.at(xi) && xi < N - 1)
        {
            xi++;
        }
        if (A.at(i) == X.at(xi)) {
            if (i < N - 1 && A.at(i+1) == X.at(xi)) {
                cA++; continue;
            }
            while (xi < N - 1 && A.at(i) == X.at(xi+1)) {
                cX++; xi++;
            }
            cA++; cX++; ans += cA * cX; cA = 0; cX = 0;
        }
    }
    cout << ans << endl;
}


#pragma GCC target("avx2")
#pragma GCC optimize("O3")
#pragma GCC optimize("unroll-loops")

#include <stdio.h>

constexpr int buffer_size = 1 << 18;
int  offset = buffer_size;
char buffer[1 << 18];
inline void buffer_in(void){ fread(buffer, 1, offset, stdin); }
inline void buffer_out(void){ fwrite(buffer, 1, offset, stdout); }
inline void buffer_clear(void){ offset = 0; }

inline char readbyte(void){
    if(offset == buffer_size){ buffer_in(); offset = 0; }
    return buffer[offset++];
}
inline int readint(void){
    int res = 0; char c; while('0' <= (c = readbyte()) and c <= '9') res = 10 * res + c - '0';
    return res;
}

inline void writebyte(const char c){
    if(offset == buffer_size){ buffer_out(); offset = 0; }
    buffer[offset++] = c;
}
char buffer_for_longlong[20];
inline void writeint(long long int x){
    if(x == 0) writebyte('0');
    else{
        int pos = 0;
        for(; x ; x /= 10) buffer_for_longlong[pos++] = (x % 10) + '0';
        while(pos) writebyte(buffer_for_longlong[--pos]);
    }
    writebyte('\n');
}

struct point{
    int a, b;
};

constexpr int MAX_N = 200010;
point P[MAX_N];
int depth[MAX_N];
int stack_len = 0;
int stack[MAX_N];
inline bool exists(void){ return stack_len; }
inline void push(int x){ stack[stack_len++] = x; }
inline int  pop(void){   return stack[--stack_len]; }

struct OPS {
    int val;
    int nxt;
};
OPS G[2 * MAX_N + 1];
int begin[MAX_N];
int now_position = 1;
inline void append(int idx, int val){
    G[now_position].val = val;
    G[now_position].nxt = begin[idx];
    begin[idx] = now_position++;
}

constexpr int root = 0;
long long int Value[MAX_N];

int main(void){
    const int n = readint();
    for(int i = 0; i + 1 < n; ++i){
        P[i].a = readint() - 1;
        P[i].b = readint() - 1;
        append(P[i].a, P[i].b);
        append(P[i].b, P[i].a);
    }
    depth[root] = 1; push(root);
    while(exists()){
        const int v = pop();
        for(int idx = begin[v]; idx ; idx = G[idx].nxt) if(depth[G[idx].val] == 0){
            depth[G[idx].val] = depth[v] + 1;
            push(G[idx].val);
        }
    }

    int q = readint();
    while(q--){
        char c = readbyte(); readbyte();
        int idx = readint() - 1, V = readint();

        int x, y; if(c == '1'){ x = P[idx].a, y = P[idx].b; } else{ x = P[idx].b, y = P[idx].a; }
        if(depth[x] < depth[y]){
            Value[0] += V;
            Value[y] -= V;
        }
        else Value[x] += V;
    }
    push(root);
    while(exists()){
        const int v = pop();
        for(int idx = begin[v]; idx ; idx = G[idx].nxt) if(depth[v] < depth[G[idx].val]){
            Value[G[idx].val] += Value[v];
            push(G[idx].val);
        }
    }
    buffer_clear();
    for(int i = 0; i < n; ++i) writeint(Value[i]);
    buffer_out();
    return 0;
}

#include <bits/stdc++.h>
using namespace std;
#define fi first
#define se second
#define ll long long
#define int long long int
#define pb push_back
#define mp make_pair
#define pll pair<ll, ll>
#define vll vector<ll>
#define mll map<ll, ll>
#define setbits(x) __builtin_popcountll(x)
#define md (ll)1e9 + 7
#define inf 1e18
#define ps(x, y) fixed << setprecision(y) << x
#define f(i, j, n) for (ll i = j; i < n; i++)
#define r(i, j, n) for (ll i = n - 1; i >= j; i--)
vll v[1000000];
ll l[1000000]={0},c[1000000]={0};
bool vis[1000000],ans[1000000];//make it false
mll st;
void dfs(ll s)
{
    vis[s] = true;
    if(st[c[s]]!=0)
        ans[s]=false;
    st[c[s]]++;
    for(auto u : v[s])
    {
        if(!vis[u])
        {
           dfs(u);
        }
    }
    st[c[s]]--;
}
void solve()
{
    ll n;cin>>n;
    memset(vis,false,sizeof(vis));
    memset(ans,true,sizeof(ans));
    f(i,1,n+1)cin>>c[i];
    for(int i=0;i<n-1;i++)
    {
        ll x,y; cin>>x>>y;
        v[x].pb(y);
        v[y].pb(x);
    }
    dfs(1);
    f(i,1,n+1)
        if(ans[i])
            cout<<i<<"\n";
}
 main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
#ifndef ONLINE_JUDGE
    freopen("inpput.txt", "r", stdin); //freopen("op.txt", "w", stdout);
#endif
    ll test_cases = 1;
    //cin >> test_cases;
    for (ll t = 1; t <= test_cases; t++)
        solve(),cout<<"\n";;
    //cerr<<"Time : "<<1000*((double)clock())/(double)CLOCKS_PER_SEC<<"ms\n";
}


#include<bits/stdc++.h>
using namespace std;
#define rep(i,n) for(lint i = 0; i < n; i++)
#define Rep(i,n) for(lint i = 1; i <= n; i++)
#define sz(a) int(a.size())
#define all(a) a.begin(), a.end()
#define rall(a) a.rbegin(), a.rend()
#define debug(a) { cerr << #a << ':' << a << endl; }
#define endl '\n'
#define fi first
#define se second
using lint = long long;
using P = pair<int,int>;
template<class T> using V = vector<T>;
template<class T> using priq     = priority_queue<T>;
template<class T> using priq_inv = priority_queue<T, vector<T>, greater<T>>;
const int dx[] = {0,1,0,-1,1,1,-1,-1};
const int dy[] = {1,0,-1,0,1,-1,-1,1};
template<class T> T ceil(const T &a, const T &b) { return (a+b-1)/b; }
template<class T> bool chmin(T &a, T b) { if(a > b) { a = b; return 1; } return 0; }
template<class T> bool chmax(T &a, T b) { if(a < b) { a = b; return 1; } return 0; }
struct INF { template<class T> operator T() { return numeric_limits<T>::max() / 2; } } INF;

template<class T, class U> istream& operator>>(istream &in, pair<T,U> &p) {
    return in >> p.first >> p.second;
}
template<class T, class U> ostream& operator<<(ostream &out, const pair<T,U> &p) {
    return out << p.first << ' ' << p.second;
}
template<class T> istream& operator>>(istream &in, vector<T> &v) {
    for(auto &&e: v) in >> e;
    return in;
}
template<class T> ostream& operator<<(ostream &out, const vector<T> &v) {
    for(const auto &e: v) out << e << ' ';
    return out;
}

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

const lint mod = 1e9+7;

int main() {
    int n;
    cin >> n;
    V<lint> a(n);
    cin >> a;
    // dp[i][j] := Aiでj回目に切る
    V<V<lint>> dp(n+1,V<lint>(n+1));
    dp[0][0] = 1;
    // dat[mod][tot] := sum[k][mod] == tot を満たす各kについてのdp[k][mod-1]の総和
    V<V<lint>> dat(n+3,V<lint>(n+3));
    // sum[i][j] := ΣA[0,i] % j
    V<V<lint>> sum(n+2,V<lint>(n+2));
    dat[1][0] = 1;
    Rep(i,n)Rep(j,n) {
        sum[i][j] = (sum[i-1][j] + a[i-1]) % j;
    }
    Rep(i,n)for(lint j = n; j >= 0; j--) {
        dp[i][j] = dat[j][sum[i][j]] % mod;
        dat[j+1][sum[i][j+1]] += dp[i][j];
        dat[j+1][sum[i][j+1]] = dat[j+1][sum[i][j+1]] % mod;
    }
    lint ans = 0;
    rep(j,n+1) ans += dp[n][j], ans %= mod;
    cout << ans << endl;
}

#include<bits/stdc++.h>
using namespace std;
int numofbits5(long bits)
{
    bits = (bits & 0x55555555) + (bits >> 1 & 0x55555555);
    bits = (bits & 0x33333333) + (bits >> 2 & 0x33333333);
    bits = (bits & 0x0f0f0f0f) + (bits >> 4 & 0x0f0f0f0f);
    bits = (bits & 0x00ff00ff) + (bits >> 8 & 0x00ff00ff);
    return (bits & 0x0000ffff) + (bits >>16 & 0x0000ffff);
}
int main(void){
  int n; cin>>n;
  n=min(8,n);
  vector<int> a(n);
  for(int i=0; i<n; ++i) cin>>a[i];
  for(int i=1; i<(1<<n); ++i){
    long long sum=0;
    for(int j=0; j<n; ++j){ if(i&(1<<j)) sum+=a[j];}
    sum%=200;
    for(int j=1; j<(1<<n); ++j){
      long long sum2=0;
      for(int k=0; k<n; ++k){ if(j&(1<<k)) sum2+=a[k];}
      sum2%=200;
      if(sum==sum2 && i!=j){
        cout<<"Yes"<<endl;
        printf("%d ",numofbits5(i));
        for(int k=0; k<n; ++k){ if(i&(1<<k)) printf("%d ",k+1);}
        cout<<endl;
        printf("%d ",numofbits5(j));
        for(int k=0; k<n; ++k){ if(j&(1<<k)) printf("%d ",k+1);}
        cout<<endl;
        return 0;
      }
    }
  }
  cout<<"No"<<endl;
  return 0;
}


#include <bits/stdc++.h>
#define mp make_pair
#define fi first
#define se second
#define pb push_back
#define eb emplace_back
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define forn(i, n) for (int i = 0; i < (int)(n); ++i)
#define for1(i, n) for (int i = 1; i <= (int)(n); ++i)
#define ms(x, y) memset(x, y, sizeof(x))
#define SZ(x) int(x.size())
#define fk cout<<"fk"<<endl
#define db(x) cout<<(#x)<<'='<<(x)<<endl
#define db2(x,y) cout<<(#x)<<'='<<(x)<<' '<<(#y)<<'='<<(y)<<endl
using namespace std;
typedef pair<int, int> pii;
typedef vector<int> vi;
typedef long long i64;
template<class T> bool uin(T &a, T b) { return a > b ? (a = b, true) : false; }
template<class T> bool uax(T &a, T b) { return a < b ? (a = b, true) : false; }
void fastio(){ios::sync_with_stdio(false); cin.tie(0); cout.precision(10); cout<<fixed;}
//1.integer overflow (1e5 * 1e5) (2e9 + 2e9)
//2.runtime error
//3.boundary condition
const int N=(int)1e5+100;
const int INF=0x3f3f3f3f;
int n,m,a[N],b[N],k,c[N],dp[20][1000100],dis[20][20];
vector<int> G[N];
int main() {
    fastio();

    cin>>n>>m;
    for1(i, m){
    	cin>>a[i]>>b[i];
    	G[a[i]].eb(b[i]);
    	G[b[i]].eb(a[i]);
    }
    cin>>k;
    forn(i, k){
    	cin>>c[i];
    }
    ms(dis,-1);
    forn(i, k){
    	queue<int> q;
    	vi d(n+5,-1);
    	d[c[i]]=0;
    	q.push(c[i]);
    	while(!q.empty()){
    		int now=q.front();
    		q.pop();
    		for(int to : G[now]){
    			if(d[to]==-1){
    				d[to]=d[now]+1;
    				q.push(to);
    			}
    		}
    	}
    	forn(j, k){
    		dis[i][j]=d[c[j]];
    	}
    }

    ms(dp,INF);
    forn(i, k) dp[i][1<<i]=0;
    for(int i=0; i<(1<<k); ++i){
    	for(int j=0; j<k; ++j){
    		if((1<<j)&i){
    			for(int three=0; three<k; ++three){
    				if(((1<<three)&i)==0 && dis[j][three]!=-1){
    					uin(dp[three][i|(1<<three)],dp[j][i]+dis[j][three]);
    				}
    			}
    		}
    	}
    }
    int ans=INF;
    forn(i, k) uin(ans,dp[i][(1<<k)-1]);
    cout<<(ans==INF?-1:ans+1)<<'\n';
    return 0;
}

#include <stdio.h>
#include <vector>
#include <queue>

int dist[500010];
int check[500010][20];
int x[20],y[20][20];
int c;
int func(int bit, int k)
{
	if(bit==(1<<c)-1) return 0;
	if(check[bit][k]) return check[bit][k];

	int ans = 1234567890;
	for(int i=1;i<=c;i++)
	{
		if((bit&(1<<(i-1)))==0)
		{
			int t = func(bit+(1<<(i-1)),i) + y[k][i];
			ans = ans<t?ans:t;
		}
	}
	return check[bit][k] = ans;
}

std::vector<int> V[100010];
std::queue<int> Q;

int main()
{
	int a,b;
	scanf("%d%d",&a,&b);
	for(int i=1;i<=b;i++)
	{
		int c,d;
		scanf("%d%d",&c,&d);
		V[c].push_back(d);
		V[d].push_back(c);
	}

	scanf("%d",&c);
	for(int i=1;i<=c;i++) scanf("%d",&x[i]);
	for(int i=1;i<=c;i++) for(int j=1;j<=c;j++) y[i][j] = -1;

	for(int i=1;i<=c;i++)
	{
		for(int j=1;j<=a;j++) dist[j] = -1;
		Q.push(x[i]);
		dist[x[i]] = 0;
		while(!Q.empty())
		{
			int t = Q.front();
			Q.pop();
			for(int j=0;j<V[t].size();j++)
			{
				if(dist[V[t][j]]==-1)
				{
					dist[V[t][j]] = dist[t]+1;
					Q.push(V[t][j]);
				}
			}
		}
		for(int j=1;j<=c;j++) y[i][j] = dist[x[j]];
	}
	for(int i=1;i<=c;i++)
	{
		for(int j=1;j<=c;j++)
		{
			if(y[i][j]==-1)
			{
				printf("-1");
				return 0;
			}
		}
	}

	int ans = 1234567890;
	for(int i=1;i<=c;i++)
	{
		int t = func(1<<(i-1),i)+1;
		ans = ans<t?ans:t;
	}
	printf("%d",ans);
}


#include<bits/stdc++.h>
using namespace std;
long long n,ans,a,b;
int main(){
//	freopen("input.txt","r",stdin);freopen("output.txt","w",stdout);
	scanf("%lld",&n);
	while(n--){
		scanf("%lld%lld",&a,&b);
		ans+=(a+b)*(b-a+1)/2ll;
	}
	printf("%lld",ans);
	return 0;
}

#include <bits/stdc++.h>
using namespace std;
#define ff        first
#define ss        second
#define ll        long long
#define int       long long
#define inf       ((ll)1e18)
#define mod       1000000007
#define double    long double
#define ull       unsigned long long
#define vi        vector<ll>
#define ppi       pair<int,int>
#define pii       pair<int,pair<int,int>>
#define pb        push_back
#define pi        2*acos(0.0)
#define rev       greater<int>()
#define pr(a,x,y) for(int i=x;i<y;i++){cout<<a[i]<<" ";}
#define ps(s)     for(auto i:s){cout<<i<<"";}
#define sp(x,y)   fixed<<setprecision(y)<<x
#define w(x)      ll x; cin>>x; while(x--)
#define all(v)    v.begin(), v.end()
#define rall(v)   v.rbegin(), v.rend()
#define test      cout<<"This is test"<<endl;
#define str       string
#define endl      '\n'
#define e         cout<<'\n';
void kehsihba(){
	ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
	/*#ifndef ONLINE_JUDGE
		freopen("input.txt", "r", stdin);
		freopen("output.txt", "w", stdout);
	#endif*/
}
ll get(ll n){
	return (n*(n+1))/2;
}
void solve(){
	ll n;cin>>n;
	ll ans=0;
	while(n--){
		ll x,y;cin>>x>>y;
		ans+=(get(y)-get(x-1));
	}
	cout<<ans;
}
int32_t main(){
	kehsihba();
	ll t=1;
	//cin>>t;
	for(int k=1;k<=t;k++){
		//cout<<"Case #"<<k<<": ";
		solve();
		//e;
	}
}


#include<bits/stdc++.h>
using namespace std;
#define debug printf("%d %s\n",__LINE__,__FUNCTION__);fflush(stdout)
using ll=long long;using i64=long long;using db=double;
using u32=unsigned int;using u64=unsigned long long;using db=double;
using pii=pair<int,int>;using vi=vector<int>;
using qi=queue<int>;using pqi=priority_queue<int>;using si=set<int>;
#define pb push_back
#define mk make_pair
#define ins insert
#define era erase
#define fi first
#define se second
#define lowbit(x) x&-x
#define ALL(a) a.begin(),a.end()
const int INF=0x3f3f3f3f;
const ll INFLL=0x3f3f3f3f3f3f3f3f;
const double PI=acos(-1.0);
template<class T>inline bool chkmin(T&a,T b){return b<a?a=b,true:false;}
template<class T>inline bool chkmax(T&a,T b){return a<b?a=b,true:false;}
int _w,_t;FILE* _f;

int x,y,z;

void solve(){
    scanf("%d%d%d",&x,&y,&z);
    printf("%d\n",(y*z-1)/x);
}

int main(){
    #ifdef MULTI_CASES
    _w=scanf("%d",&_t);while(_t--)
    #endif
    solve();
    return 0;
}

#include <iostream>
#include <unordered_set>
#include <unordered_map>
#include <vector>
using namespace std;
int cnt = 0;

unordered_set<char> C;
string S1, S2, S3;

int main(void) {
    int X, Y, Z;

    cin >> X >> Y >> Z;

    int P = 0;
    while (X * P < Z * Y)  {
        P++;
    }
    P--;
    cout << P;
    cout << endl;

    return 0;
}


#include <iostream>

using namespace std;

int main(){
    int A, B, W;
    cin >> A >> B >> W;
    W *= 1000;

    int min = 0;
    int max = 0;

    int count = 0;
    int a = A;
    int b = B;

    while(a <= W){
        count++;
        if(min == 0 && a <= W && W <= b){
            min = count;
        }
        a += A;
        b += B;
    }

    if(min == 0){
        cout << "UNSATISFIABLE" << endl;
    }else{
        max = count;
        cout << min << " " << max << endl;
    }
}

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

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

    int a,b,c,d;cin>>a>>b>>c>>d;
    cout<<min(a,min(b,min(c,d)));

    return 0;
}


#include<bits/stdc++.h>
#define ull unsigned long long
#define ll long long
#define F first
#define S second
#define pss pair<string,string>
#define pcc pair<char,char>
#define pll pair<ll,ll>
#define pii pair<int,int>
#define piii pair<int,pii>
#define vi vector<int>
#define vii vector<pii>
#define pb push_back
#define vs vector<string>
#define vl vector<ll>
#define vs vector<string>
#define vll vector<pll>
#define vss vector<pss>
#define vcc vector<pcc>
#define MP make_pair
#define rep(i,n) for(int i=0;i<n;i++)
#define REP(i,n) for(int i=n-1;i>=0;i--)
#define Very_fast std::ios::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
using namespace std;
const int N = 1e5+5;
const int mod=1e9+7;
const int INF=0x3f3f3f3f;
inline ll gcd(ll a,ll b){if(b==0)return a;else return gcd(b,a%b);}
inline ll lcm(ll a,ll b){return a/gcd(a,b)*b;}
inline ll lowbit(ll x){return (x&-x);}
inline ll kissme(ll x,ll y)
{
	ll res=1;
	if(x==0)return 1;
	if(x==1)return y;
	res=kissme(x/2,y);
	res=res*res%mod;
	if(x%2==1)res=res*y%mod;
	return res;
}
string QAQ(string s)
{
	string a=s,b=s;
	sort(a.begin(),a.end());
	sort(b.begin(),b.end());
	reverse(a.begin(),a.end());
//	cout<<a<<" "<<b<<"\n";
	for(int i=a.size()-1;i>=0;i--)
	{
		a[i]-=b[i]-'0';
		if(a[i]<'0')
		{
			a[i-1]--;
			a[i]+=10;
		}
	}
	while(!a.empty()&&a[0]=='0')a.erase(a.begin());
	return a;
}
string s;
int n;
signed main()
{
	Very_fast;
	cin>>s>>n;
	rep(i,n)
	{
		s=QAQ(s);
		if(s=="")
		{
			cout<<"0\n";
			return 0;
		}
	}
	int rem=s.size()-1;
	for(int i=0;i<s.size()-1;i++)
	{
		if(s[i]!='0')
		{
			rem=i;
			break;
		}
	}
	for(int i=rem;i<s.size();i++)
		cout<<s[i];
	return 0;
}

#include<bits/stdc++.h>

using namespace std;

using ll = long long;

/*-----for personal-----*/
#define rep(i,a,b) for(int i=(a);i<(b);++i)
#define repn(i,n)  rep(i,0,n)
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }

/*-----for lib-----*/
#define REP(i, n) for (int i = 0; (i) < (int)(n); ++ (i))
#define REP3(i, m, n) for (int i = (m); (i) < (int)(n); ++ (i))
#define REP_R(i, n) for (int i = (int)(n) - 1; (i) >= 0; -- (i))
#define REP3R(i, m, n) for (int i = (int)(n) - 1; (i) >= (int)(m); -- (i))
#define ALL(x) std::begin(x), std::end(x)

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

/*
f(n) = (f(n+1)+1) * 1/M + (f(n+2)+1) * 1/M + .... + (f(n+M)+1) * 1/M
     = 1/M (f(n+1)+1+f(n+2)+1+f(n+3)+1+f(n+M)+1)
     = 1/M (f(n+1)+f(n+2)+...+f(n+M)+M)
     = 1/M (f(n+1)+f(n+2)+...+f(n+M)) + 1
f(n) = f(0) [循環する]

g(n) = 1/M (g(n+1)+g(n+2)+....+g(n+M)) + 1 振り出しじゃない
g(n) = X 振り出し

g(0) = 1/M (g(1)+g(2)+....+g(M)) + 1

f(0) - f(0)A = B
(1-A)f(0) = B

Mf(0) = MB/(M-MA)
A = 1/M*(1~Nでgが振り出しの数)
B = 1/M+(1~Mでgが振り出しでない数)+1
MA = (1~Nでgが振り出しの数)
MB = (1~Mでgが振り出しでない数)+M
*/

const int N = 100000;
const int M = 100000;
vector<bool> A(N+1,false);
vector<long double> dp(N+M, 0);
vector<long double> S(N+M, 0);
int n, m, k;

long double f(long double v){
  for(int i = n-1; i>=0; i--){
    if(A[i]){
      dp[i] = v;
    }else{
      dp[i] = 1+(S[i+1]-S[i+1+m])/m;
    }
    S[i] = dp[i] + S[i+1];
  }
  return dp[0];
}

int main(){
  cin >> n >> m >> k;
  repn(i,k){
    int a; cin >> a;
    A[a] = true;
  }

  int count = 0;
  for(int i = 0; i <= n; i++){
    if(!A[i]){count=0; continue;}
    count++;
    if(count>=m){ cout << -1 << endl; return 0;}
  }

  long double l=0, r=1e12, mid;
  //mid -> v
  count = 0;
	while(count<=100) {
		mid=(l+r)/2;
		if(abs(f(mid)-mid)<EPS) break;
    else if(f(mid)>mid) l=mid;
		else r=mid;
    count++;
	}

  cout << setprecision(12) << mid << endl;

}


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

using ll = long long;
using vi = vector<int>;
using vvi = vector<vi>;
using vl = vector<ll>;
using vvl = vector<vl>;
using vb = vector<bool>;
using vvb = vector<vb>;
using pii = pair<int, int>;
using pll = pair<ll, ll>;
#define rep(i, s, n) for(int i = (int)(s); i < (int)(n); ++i)

ll INF = 1ll << 60;

int main(){
    ll n;
    cin >> n;
    ll a, b, c;
    b = 0;
    ll ex = 1;
    ll ans = INF;
    while(ex <= n){
        a = n/ex;
        c = n%ex;
        ans = min(ans, a + b + c);
        ex *= 2;
        b++;
    }

    cout << ans << endl;

    return 0;

}

#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include <cmath>
#include <climits>
#include <queue>
#include <map>
using std::cout;
using std::cin;
using std::string;
using std::vector;
using std::endl;

void loadData(vector<long long>& data, int n) {
    for (int i = 0; i < n; i++) {
        cin >> data[i];
    }
}

void loadPowers(vector<long long>& powers) {
    for (int i = 1; i < 63; i++) {
        powers[i] = 2 * powers[i - 1];
    }
}

int main()
{
    long long n;
    cin >> n;
    long long ans = LLONG_MAX;
    vector<long long> powers(63, 1);
    loadPowers(powers);

    for (long long i = 0; powers[i] <= n; i++) {
        long long j = n / powers[i];
        long long k = n - j * powers[i];
        ans = std::min(ans, i + j + k);
    }

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


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

const int max_n = 2e5+5;
int n, q, c[max_n], par[max_n], num[max_n];
map<int, int> mp[max_n];
void init() {
	rep(i,1,n){
		par[i] = i;
        mp[i].insert({c[i], 1});
	}
}
int ufind(int x){
	if(par[x] == x) return x;
	else {
		int um = ufind(par[x]);
		return par[x] = um;
	}
}
void unite(int x, int y){
	x = ufind(x);
	y = ufind(y);
	if(x == y) return;
	if(mp[x].size() < mp[y].size()) swap(x, y);
	par[y] = x;
	num[x] += num[y];
    num[y] = 0;
    for(auto i = mp[y].begin(); i != mp[y].end(); i++)
        mp[x][i->first] += i->second;
    mp[y].clear();
}

int main() {
    cin >> n >> q;
    rep(i, 1, n){
        cin >> c[i];
    }
    init();
    rep(qs, 1, q){
        int t, a, b;
        cin >> t >> a >> b;
        if(t == 1) unite(a, b);
        if(t == 2) cout << mp[ufind(a)][b] << endl;
    }
    return 0;
}

#define _USE_MATH_DEFINES

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

#define	INF   1010101010
#define INFLL 1010101010101010101

using namespace std;

int mod = 1000000007;

class Union_Find {
public:
	Union_Find(int n) : 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 (-d[x] < -d[y]) swap(x, y);
		d[x] += d[y];
		d[y] = x;
		return true;
	}

	bool same(int x, int y)
	{
		return find(x) == find(y);
	}

	int size(int x)
	{
		return -d[find(x)];
	}

private:
	vector<int> d;
};

int main()
{
	int n, q;
	cin >> n >> q;
	Union_Find uf(n);
	vector<map<int, int>> m(n);
	for (int i = 0; i < n; i++) {
		int t;
		cin >> t;
		t--;
		m[i][t]++;
	}

	for (int i = 0; i < q; i++) {
		int t, a, b;
		cin >> t >> a >> b;
		a--;
		b--;
		if (t == 1) {
			int na = uf.size(a), nb = uf.size(b);
			int pa = uf.find(a), pb = uf.find(b);
			if (uf.unite(a, b)) {
				if (na < nb) {
					for (auto &j : m[pa]) {
						m[pb][j.first] += j.second;
					}
				} else {
					for (auto &j : m[pb]) {
						m[pa][j.first] += j.second;
					}
				}
			}
		} else {
			cout << m[uf.find(a)][b] << endl;
		}
	}

	return 0;
}


#include<iostream>
#include<vector>

using i64 = int64_t;
template<i64 MOD>
struct modint{
  i64 val;
  modint():val(0){}
  modint(i64 v):val(v<0?(-v)%MOD:v%MOD){}
  operator i64(){return val;}
  constexpr modint &operator += (modint other){this->val+=other.val;if(this->val>=MOD)this->val-=MOD;return *this;}
  constexpr modint &operator -= (modint other){this->val-=other.val;if(this->val<0)this->val+=MOD;return *this;}
  constexpr modint &operator *= (modint other){this->val*=other.val;if(this->val>=MOD)this->val%=MOD;return *this;}
  constexpr modint &operator /= (modint other){this->val*=other.inverse();if(this->val>=MOD)this->val%=MOD;return *this;}
  constexpr modint operator + (modint other)const{return modint(val)+=other;}
  constexpr modint operator - (modint other)const{return modint(val)-=other;}
  constexpr modint operator * (modint other)const{return modint(val)*=other;}
  constexpr modint operator / (modint other)const{return modint(val)/=other;}
  template<class T>constexpr modint operator + (T other)const{return modint(val)+=(modint)other;}
  template<class T>constexpr modint operator - (T other)const{return modint(val)-=(modint)other;}
  template<class T>constexpr modint operator * (T other)const{return modint(val)*=(modint)other;}
  template<class T>constexpr modint operator / (T other)const{return modint(val)/=(modint)other;}
  template<class T>
  constexpr modint mpow(T _n)const{
    i64 n = _n;
    modint res(1);
    modint base(val);
    while(n){
      if(n&1)res*=base;
      base *= base;
      n >>= 1;
    }
    return res;
  }
  template<class T,class U>
  constexpr static modint mpow(T t,U u){return modint(t).mpow(u);}
  constexpr modint inverse()const{return mpow(val,MOD-2);}
  friend std::ostream &operator << (std::ostream& os,modint mo){return os<<mo.val;}
  friend std::istream &operator >> (std::istream& is,modint& mo){return is>>mo.val;}
};
constexpr int MOD = 998244353;
using mint = modint<MOD>;
mint operator""_m(unsigned long long x){return (mint)x;}

#define rep(i,n) for(int i=0;i<(int)n;++i)
constexpr int64_t COM_MAX = (int64_t)1e6;

signed main(){

  int n,k;
  std::cin>>n>>k;
  std::vector<mint> a(n);
  for(auto& ai:a)std::cin>>ai;

  std::vector<mint> fac(k+1),inv(k+1),finv(k+1);
  fac[1]=inv[1]=finv[0]=finv[1]=1;
  for(int i=2;i<=k;++i){
    fac[i]=fac[i-1]*i;
    inv[i]=MOD-inv[MOD%i]*(MOD/i);
    finv[i]=finv[i-1]*inv[i];
  }
  std::vector<mint> ushi(k+1);
  rep(j,k+1)rep(i,n)ushi[j]+=(a[i]*2_m).mpow(j);
  std::vector<mint> tapu(k+1);
  rep(j,k+1)rep(i,n)tapu[j]+=a[i].mpow(j)*finv[j];

  auto solve = [&](i64 x){
    mint ans = 0;
    for(int k=0;k<=x;++k){
      ans += tapu[k]*tapu[x-k];
    }
    ans *= fac[x];
    ans -= ushi[x];
    ans /= 2;
    return ans;
  };
  for(int x=1;x<=k;++x)
    std::cout<<solve(x)<<'\n';

}

//Relive your past life.
//Face your demons.
//The past is never dead,it is not even past.
//The memories are not only the key to the past but...also to the future.
//coded in Rusty Lake
#include<cmath>
#include<math.h>
#include<ctype.h>
#include<algorithm>
#include<bitset>
#include<cassert>
#include<cctype>
#include<cerrno>
#include<cfloat>
#include<ciso646>
#include<climits>
#include<clocale>
#include<complex>
#include<csetjmp>
#include<csignal>
#include<cstdarg>
#include<cstddef>
#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<ctime>
#include<cwchar>
#include<cwctype>
#include<deque>
#include<exception>
#include<fstream>
#include<functional>
#include<iomanip>
#include<ios>
#include<iosfwd>
#include<iostream>
#include<istream>
#include<iterator>
#include<limits>
#include<list>
#include<locale>
#include<map>
#include<memory>
#include<new>
#include<numeric>
#include<ostream>
#include<queue>
#include<set>
#include<sstream>
#include<stack>
#include<stdexcept>
#include<streambuf>
#include<string>
#include<typeinfo>
#include<utility>
#include<valarray>
#include<vector>
#include<string.h>
#include<stdlib.h>
#include<stdio.h>
#pragma GCC optimize("Ofast")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#define ll   long long
#define pb   push_back
#define mp   make_pair
#define orz  998244353
using namespace std;
int n,k,c[303][303],a[303][200005];
ll s[303];
int main(){
	scanf("%d%d",&n,&k);
	for(int i=0;i<=k;++i){
		c[i][0]=c[i][i]=1;
		for(int j=1;j<i;++j)c[i][j]=(c[i-1][j-1]+c[i-1][j])%orz;
	}
	for(int i=1;i<=n;++i)a[0][i]=1;
	for(int i=1;i<=n;++i)scanf("%d",a[1]+i);
	for(int i=2;i<=k;++i){
		for(int j=1;j<=n;++j)a[i][j]=a[i-1][j]*1ll*a[1][j]%orz;
	}
	for(int i=0;i<=k;++i){
		for(int j=1;j<=n;++j){
			s[i]+=a[i][j];
			if(s[i]>=orz)s[i]-=orz;
		}
	}
	for(int i=1;i<=k;++i){
		ll o=0;
		for(int j=0;j*2<=i;++j){
			ll p=(s[j]*s[i-j]%orz-s[i]+orz)*c[i][j]%orz;
			if(j*2==i)p=p*499122177ll%orz;
			o=(o+p)%orz;
		}
		printf("%lld\n",o);
	}
    return 0;
}


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

using ll = long long;
using PII = pair<ll, ll>;

#define FOR(i, a, n) for (ll i = (ll)a; i < (ll)n; ++i)
#define REP(i, n) FOR(i, 0, n)
#define ALL(x) x.begin(), x.end()
#define POPCOUNT(x) __builtin_popcount(x)
template <typename T> void chmin(T &a, const T &b) { a = min(a, b); }
template <typename T> void chmax(T &a, const T &b) { a = max(a, b); }

const ll INF = 1LL << 60;

struct FastIO {
    FastIO() {
        cin.tie(0);
        ios::sync_with_stdio(0);
    }
} fastiofastio;

const ll MOD = 1e9 + 7;

vector<int> G[100000];
ll dist[100000];
ll cost[17][17];
ll dp[1 << 17][17];

int main() {
    int N, M;
    cin >> N >> M;
    REP(i, M) {
        int A, B;
        cin >> A >> B;
        A--;
        B--;
        G[A].push_back(B);
        G[B].push_back(A);
    }
    int K;
    cin >> K;
    vector<int> C(K);
    REP(i, K) {
        cin >> C[i];
        C[i]--;
    }
    REP(i, K) {
        fill(dist, dist + N, INF);
        dist[C[i]] = 0;
        queue<int> que;
        que.push(C[i]);
        while (!que.empty()) {
            int now = que.front();
            que.pop();
            for (int to : G[now]) {
                if (dist[to] == INF) {
                    dist[to] = dist[now] + 1;
                    que.push(to);
                }
            }
        }
        FOR(j, i + 1, K) { cost[i][j] = cost[j][i] = dist[C[j]]; }
    }
    fill((ll *)dp, (ll *)(dp + (1 << K)), INF);
    REP(i, K) dp[1 << i][i] = 1;
    for (int bit = 1; bit < (1 << K); bit++) {
        REP(i, K) {
            if ((bit & (1 << i)) == 0)
                continue;
            REP(j, K) {
                if (bit & (1 << j))
                    continue;
                chmin(dp[bit ^ (1 << j)][j], dp[bit][i] + cost[i][j]);
            }
        }
    }
    ll ans = INF;
    REP(i, K) chmin(ans, dp[(1 << K) - 1][i]);
    if (ans == INF)
        cout << -1 << endl;
    else
        cout << ans << endl;
}

/*  Author: Tarun Kumar
    E-mail: tarunkumar281200@gmail.com

    " A code is like love,
        it has created with clear intentions at the beginning,
            but it can get complicated:) "
*/#include <bits/stdc++.h>
#define FAST ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define test ll t;cin>>t;while(t--)
#define ll long long int
#define vll vector<ll>
#define ff first
#define ss second
#define pb push_back
#define f0(i,n) for(i=0;i<n;i++)
#define f1(i,n) for(i=1;i<=n;i++)
#define fab(i,a,b) for(i=a;i<=b;i++)
#define fabr(i,a,b) for(i=b;i>=a;i--)
#define memo(a,b) memset(a,b,sizeof(a))
#define display(x) for(auto dsp:x)cout<<dsp<<" ";cout<<"\n";
#define hi cout<<"hi\n"
#define ln "\n"
using namespace std;
int main()
{FAST;ll n,i,j,k,len,x,y,z,c,f,flag,p,q,mx,mn,l,r,sum,ans,tmp,it,pos,avg,m,cnt;
    // test
    {
        f=0;flag=0;ans=0;cnt=0;sum=0;mn=LLONG_MAX;mx=LLONG_MIN;string s;
        cin>>n;

        vll v;
        ll a[n],b[n];
        f0(i,n)
        {
            cin>>a[i];
            b[i]=a[i];
            if(a[i]==i+1) f=1;
        }
        sort(b,b+n);

        if(f)
        {
            cout<<-1;
            return 0;
        }

        bitset<1000000>bt;
        f0(i,n-1)
        {
            if(bt[i])
            {
                continue;
            }
            else
            {
                pos=i+1;
                while(pos<n&&a[pos]!=b[i]) pos++;

                // cout<<pos<<" ";
                if(pos>=n||i+1>=n) goto lbl;

                fabr(j,i+1,pos)
                {
                    if(bt[j-1]) goto lbl;

                    swap(a[j],a[j-1]);
                    bt[j-1]=1;
                    v.pb(j);//+1
                }
                // i=pos;
                // if(bt[])
            }
        }
        lbl:

        if(is_sorted(a,a+n))
        {
            for(auto it:v) cout<<it<<ln;
        }
        else cout<<-1;
    }
	return 0;
}


#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
#define rep(i, n) for (ll i = 0; i < (ll)(n); i++)
#define repp(i, st, en) for (ll i = (ll)st; i < (ll)(en); i++)
#define repm(i, st, en) for (ll i = (ll)st; i >= (ll)(en); i--)
#define all(v) v.begin(), v.end()
template<class in_chmax> void chmax(in_chmax &x, in_chmax y) {x = max(x,y);}
template<class in_chmin> void chmin(in_chmin &x, in_chmin y) {x = min(x,y);}
void Yes() {cout << "Yes" << endl; exit(0);}
void No() {cout << "No" << endl; exit(0);}
template<class in_Cout> void Cout(in_Cout x) {cout << x << endl; exit(0);}
template<class in_vec_cout>
void vec_cout(vector<in_vec_cout> vec) {
    for (in_vec_cout res : vec) {cout << res << " ";}
    cout << endl;
}

const ll inf = 1e18;
const ll mod = 1e9 + 7;
const ll maxN = 1100;

ll N, M;
bool con[maxN][maxN];
map<char,vector<pair<ll,ll>>> Mp;
vector<ll> G[maxN*maxN];

ll id(pair<ll,ll> p) {return p.first*N + p.second;}
ll id(ll i, ll j) {return id({i,j});}

vector<ll> bfs(ll st) {
    vector<ll> dist(N*N,inf);
    dist[st] = 0;
    queue<ll> que;
    que.push(st);
    while (que.size()) {
        ll now = que.front();
        que.pop();
        ll i = now/N, j = now%N;
        for (ll to : G[now]) {
            if (dist[to]!=inf) continue;
            dist[to] = dist[now]+2;
            que.push(to);
        }
    }
    return dist;
}

int main() {
    cin >> N >> M;
    rep(i,M) {
        ll a, b; char c;
        cin >> a >> b >> c;
        a--; b--;
        Mp[c].push_back({a,b});
        Mp[c].push_back({b,a});
        con[a][b] = con[b][a] = true;
    }
    for (auto p : Mp) {
        vector<pair<ll,ll>> vec = p.second;
        for (pair<ll,ll> s : vec) {
            for (pair<ll,ll> t : vec) {
                pair<ll,ll> from = {s.first,t.first};
                pair<ll,ll> to = {s.second,t.second};
                G[id(from)].push_back(id(to));
                G[id(to)].push_back(id(from));
            }
        }
    }
    vector<ll> dist = bfs(id(0,N-1));
    ll ans = inf;
    rep(id,N*N) {
        ll i = id/N, j = id%N;
        if (i==j) chmin(ans,dist[id]);
        else if (con[i][j]) chmin(ans,dist[id]+1);
    }
    if (ans==inf) ans = -1;
    Cout(ans);
}

#include <bits/stdc++.h>
using Int = long long;  // clang-format off
#define REP_(i, a_, b_, a, b, ...) for (Int i = (a), lim##i = (b); i < lim##i; i++)
#define REP(i, ...) REP_(i, __VA_ARGS__, __VA_ARGS__, 0, __VA_ARGS__)
#define RREP_(i, a_, b_, a, b, ...) for (Int i = Int(b) - 1, low##i = (a); i >= low##i; i--)
#define RREP(i, ...) RREP_(i, __VA_ARGS__, __VA_ARGS__, 0, __VA_ARGS__)
#define ALL(v) std::begin(v), std::end(v)
struct SetupIO { SetupIO() { std::cin.tie(nullptr), std::ios::sync_with_stdio(false), std::cout << std::fixed << std::setprecision(13); } } setup_io;
#ifndef dump
#define dump(...)
#endif  // clang-format on
struct in {
    template <class T> operator T() {
        T t;
        std::cin >> t;
        return t;
    }
};
void out() { std::cout << "\n"; }
template <class Head, class... Tail> void out(Head&& h, Tail&&... t) {
    std::cout << h << (sizeof...(Tail) == 0 ? "" : " "), out(std::forward<Tail>(t)...);
}
template <class T> bool chmin(T& a, const T& b) { return a > b ? a = b, true : false; }
template <class T> bool chmax(T& a, const T& b) { return a < b ? a = b, true : false; }

/**
 *    author:  knshnb
 *    created: Thu Nov 19 18:45:12 JST 2020
 **/

signed main() {
    Int n = in(), X = in();
    std::vector<Int> a(n), b(n - 1);
    REP(i, n) a[i] = in();
    REP(i, n - 1) b[i] = a[i + 1] / a[i];
    std::vector<Int> use(n);
    RREP(i, n) {
        use[i] = X / a[i];
        X %= a[i];
    }
    std::vector<std::map<Int, Int>> dp(n);
    dp[0][use[0]] = 1;
    REP(i, n - 1) {
        for (auto& p : dp[i]) {
            if (p.first != b[i]) dp[i + 1][use[i + 1]] += p.second;
            if (p.first != 0) dp[i + 1][use[i + 1] + 1] += p.second;
        }
    }
    Int ans = 0;
    for (auto& p : dp.back()) ans += p.second;
    out(ans);
}


#include <iostream>
#include <algorithm>

using namespace std;

typedef long long ll;
ll l;

int main()
{
    cin >> l;
    ll ans = 1;
    int j = 1;
    for(int i = l - 11; i <= l - 1; i ++)
    {
        ans *= i;
        ans /= j++;
    }

    cout << ans << endl;

    return 0;
    //39916800
}

#include <bits/stdc++.h>
using namespace std;
#define int long long
#define pb push_back
#define ff first
#define VI vector <int>
#define ss second
#define pii pair<int, int>
#define pci pair<char, int>
#define mii map<int, int>
#define mci map<char, int>
#define setbits(n) __builtin_popcount(n)
#define fill(a,b) memset(a, b, sizeof(a))
#define all(v) (v).begin(), (v).end()
#define yes cout<<"YES"<<endl
#define no cout<<"NO"<<endl
#define endl "\n"
#define IOS std::ios::sync_with_stdio(false); cin.tie(NULL);cout.tie(NULL);
#define PI 3.14159265
const long long N=5e6+5;
const long long mod=1000000007;

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

int32_t main(){
    IOS;
	int t;
	t=1;
// 	cin>>t;
	while (t--){
	    int n;
	    cin>>n;
	    cout<<max(0LL, n);

	}
	return 0;
}