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

using namespace std;

typedef long long ll;

#define MOD 998244353

struct UnionFind {
  vector<int> data;
  void init(int n) { data.assign(n, -1); }
  int root(int x) { return data[x] < 0 ? x : data[x] = root(data[x]); }
  bool same(int x, int y) { return root(x) == root(y); }
  bool unite(int x, int y) {
    x = root(x), y = root(y);
    if (x != y) {
      if (data[y] < data[x]) swap(x, y);
      data[x] += data[y];
      data[y] = x;
    }
    return x != y;
  }
  int size(int x) { return -data[root(x)]; }
};

// x^n
ll mod_pow(ll x, ll n) {
  if (n == 0) return 1;
  ll res = mod_pow(x * x % MOD, n / 2);
  if (n & 1) res = res * x % MOD;
  return res;
}

// x^{-1}
ll mod_inv(ll x) { return mod_pow(x, MOD - 2); }

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

/**
 * Dont raise your voice, improve your argument.
 * --Desmond Tutu
 */
#include <bits/stdc++.h>
using namespace std;

const bool ready = [](){
    ios_base::sync_with_stdio(false); cin.tie(0);
    cout << fixed << setprecision(12);
    return true;
}();

using ld=long double;
const ld PI = acos((ld)-1);
using ll= long long;
#define int ll
#define all(v) (v).begin(), (v).end()
#define fori(n) for(int i=0; i<int(n); i++)

#define cini(i) int i; cin>>i;
#define cins(s) string s; cin>>s;
#define cind(d) ld d; cin>>d;
#define cinai(a,n) vi a(n); fori(n) { cin>>a[i]; }
#define cinas(s,n) vs s(n); fori(n) { cin>>s[i]; }
#define cinad(a,n) vd a(n); fori(n) { cin>>a[i]; }

using pii= pair<int, int>;
using pdd= pair<ld, ld>;
using vd= vector<ld>;
using vb= vector<bool>;
using vi= vector<int>;
using vvi= vector<vi>;
using vs= vector<string>;

#define endl "\n"

const int MOD=998244353;

int mul(const int v1, const int v2, int mod=MOD) {
    return (int)((1LL * v1 * v2) % mod);
}

int pl(int v1, int v2, int mod=MOD) {
    int res = v1 + v2;

    while(res < 0)
        res += mod;

    while(res>=mod)
        res-=mod;

    return res;
}

/* int pow */
int toPower(int a, int p, int mod=MOD) {
    int res = 1;
    while (p != 0) {
        if (p & 1)
            res = mul(res, a, mod);
        p >>= 1;
        a = mul(a, a, mod);
    }
    return res;
}

int inv(const int x, const int mod=MOD) {
    return toPower(x, mod - 2);
}

const int N=1e6;
vector<int> fac(N);

const bool initFac=[](const int mod) {
    fac[1]=1;
    for(int i=2; i<N; i++) {
        fac[i]=mul(fac[i-1], i, mod);
    }
    return true;
}(MOD);

/** see https://cp-algorithms.com/combinatorics/binomial-coefficients.html */
int nCr(int n, int k) {
    if(k==0 || k==n)
        return 1;
    if(k==1 || k==n-1)
        return n;
    if(k>n/2)
        return nCr(n, n-k);

    return mul(mul(fac[n], inv(fac[k])), inv(fac[n - k]));
}

/*
 * Consider including i into the set, so f[i]
 * must be included, too, and so on.
 * So we need to find components in f[].
 * Each complete component satisfies first rule.
 *
 * And such component allways satisfies the second rule, too.
 *
 * So we can put each combination of those components
 * into the set. If c is count of components, then ans=c!
 * ***
 * No, but sample 3 makes not sense.
 * How can answer be 7?
 * There are 7 subsets, but the ones of size 2 do not work,
 * the first rule is not satisfied :/
 * ...It is! It is three independend components.
 * ********************
 * So, only circles can be included at all.
 * Then each combination of those circles can be used.
 * sum(nCr(c, 1..c));
 * ************
 * The circle detection is more complecated :/
 * Starting search somehwere there are several cases:
 * -simply a cicle
 * -> increment circle count and mark all vertex seen
 *
 * -ends in previously seen something
 *  -> just mark visited
 *
 * -ends somewhere else
 *  -> increment cirlce count
 */
void solve() {
    cini(n);
    vi f(n+1);
    for(int i=1; i<=n; i++)
        cin>>f[i];

    int ccnt=0;
    vb vis1(n+1);   /* vis1[i] -> i is checked */
    for(int i=1; i<=n; i++) {
        if(vis1[i])
            continue;

        bool isC=true;
        vi nums;
        vb vis2(n+1);
        int v=i;
        while(!vis2[v] && !vis1[v]) {
            vis2[v]=true;
            nums.push_back(v);
            v=f[v];
            if(vis1[v])
                isC=false;
        }

        if(isC)   /* found a circle */
            ccnt++;

        for(int j=0; j<nums.size(); j++)
                vis1[nums[j]]=true;
    }

    //cerr<<"ccnt="<<ccnt<<endl;

    if(ccnt==0) {
        cout<<0<<endl;
        return;
    }
    int ans=0;
    for(int i=1; i<=ccnt; i++) {
        ans=pl(ans, nCr(ccnt, i));
    }
    cout<<ans<<endl;
}

signed main() {
    solve();
}


#include<bits/stdc++.h>
#include<queue>
using namespace std;
int main () {
  int N;
  cin >> N;
  string S, T;
  cin >> S >> T;
  int s = 0;
  int t = 0;
  for (int i = N - 1; i >= 0; i --) {
    if (S[i] == '1') s ++;
    if (T[i] == '1') t ++;
    if (s < t) {
      cout << -1 << endl;
      return 0;
    }
  }
  if ((s - t) % 2 != 0) {
    cout << -1 << endl;
    return 0;
  }
  int sp = -1;
  queue<int>tp;
  long long ans = 0;
  for (int i = 0; i < N; i ++) {
    if (T[i] == '1') {
      tp.push(i);
    }
    if (S[i] == '1') {
      if (sp != -1) {
        ans += (long long)(i - sp);
        sp = -1;
      } else if (!tp.empty()) {
        ans += (long long)(i - tp.front());
        tp.pop();
      } else {
        sp = i;
      }
    }
    //cout << sp << ' ' << tp << ' ' << ans << endl;
  }
  cout << ans << endl;
}

#include<bits/stdc++.h>
using namespace std;
using LL = long long;
void no(){
    cout << "-1";
    exit(0);
}
int main(){
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    cout.tie(nullptr);
    int N;
    string S, T;
    cin >> N >> S >> T;
    vector<int> s, t;
    for(int i = 0; i < N; i += 1) if(S[i] == '1') s.push_back(i);
    for(int i = 0; i < N; i += 1) if(T[i] == '1') t.push_back(i);
    LL ans = 0;
    for(int i = 0, j = 0; i < s.size() or j < t.size();){
        if(i == s.size()) no();
        if(j == t.size() or s[i] < t[j]){
            if(i + 1 == s.size()) no();
            ans += s[i + 1] - s[i];
            i += 2;
            continue;
        }
        ans += s[i] - t[j];
        i += 1;
        j += 1;
    }
    cout << ans;
    return 0;
}


#include <iostream>

using namespace std;

int main()
{
    int X;

    cin >> X;

    if (X % 100 == 0) {
        X = 100;
    } else {
        X = 100 - X%100;
    }

    cout << X;

   return 0;
}

#include<bits/stdc++.h>
#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define rep2(i, m, n) for(int i = (int)(m); i < (int)(n); i++)
#define rep_inv(i, n, m) for(int i = (int)(n); i > (int)(m); i--)
using namespace std;
using ll = long long;
using vl = vector<ll>;
using vc = vector<char>;
using vvl = vector<vl>;
using vvc = vector<vc>;
using pll = pair<ll, ll>;
using vpll = vector<pll>;

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

  X %= 100;

  cout << 100 - X << "\n";

  return 0;
}


#include <iostream>
#include<stdio.h>
using namespace std;
int a[1010];
int main()
{
    int b;
    int n,c=0;
    scanf("%d",&n);
    for(int i=1; i<=n; i++)
    {
        scanf("%d",&b);
        if(b>n)
        {
            c=-1;
            break;
        }
        a[b]++;
    }
    for(int i=1; i<=n; i++)
    {
        if(a[i]==0)
        {
            c=-1;
        }
    }
    if(c==-1)
    {
        printf("No");
    }
    else printf("Yes");
    return 0;
}

#include<bits/stdc++.h>
using namespace std;
const int N=2e5+6;
char c[N];
char l[N];
int len,top;
int main()
{
	cin>>len;
	scanf("%s",c+1);
	int p=len;
	int tot=1;
	tot=0;
	for(int i=1;i<=len;i++)
	{
		tot++;
		l[tot]=c[i];
		if(tot>=3&&l[tot]=='x'&&l[tot-1]=='o'&&l[tot-2]=='f')
		p-=3,tot-=3;
	}
	cout<<p;
	return 0;
}


#include<functional>
#include<algorithm>
#include<iostream>
#include<iomanip>
#include<cstring>
#include<cstdlib>
#include<utility>
#include<string>
#include<cstdio>
#include<vector>
#include<bitset>
#include<cmath>
#include<ctime>
#include<queue>
#include<deque>
#include<stack>
#include<map>
#include<set>
using namespace std;
const int inf=2147483647,dx[]={-1,0,1,0},dy[]={0,-1,0,1};// 上 左 下 右
const int N=100005,M=1000005,K=200005,mod=1000000007;
const long long llinf=9223372036854775807ll;
//int & long long
int a,b;
int main(){
	cin>>a>>b;
	cout<<(a+b)/2<<' '<<(a+b)/2-b;
	return 0;
}

#pragma GCC optimize("Ofast")
#define _USE_MATH_DEFINES
#include "bits/stdc++.h"

using namespace std;

using u8 = uint8_t;
using u16 = uint16_t;
using u32 = uint32_t;
using u64 = uint64_t;
using i8 = int8_t;
using i16 = int16_t;
using i32 = int32_t;
using i64 = int64_t;

using vi = vector<int>;

constexpr char newl = '\n';
constexpr double eps = 1e-10;

#define FOR(i,a,b) for (int i = (a); i < (b); i++)
#define F0R(i,b) FOR(i,0,b)
#define RFO(i,a,b) for (int i = ((b)-1); i >=(a); i--)
#define RF0(i,b) RFO(i,0,b)
#define fi first
#define se second
#define show(x) cout << #x << " = " << x << '\n';
#define rng(a) a.begin(),a.end()
#define rrng(a) a.rbegin(),a.rend()
#define sz(x) (int)(x).size()
#define YesNo {cout<<"Yes";}else{cout<<"No";}
#define YESNO {cout<<"YES";}else{cout<<"NO";}
#define v(T) vector<T>

template<typename T1, typename T2> inline void chmin(T1& a, T2 b) { if (a > b) a = b; }
template<typename T1, typename T2> inline void chmax(T1& a, T2 b) { if (a < b) a = b; }
template<class T> bool lcmp(const pair<T, T>& l, const pair<T, T>& r) {
  return l.first < r.first;
}
template<class T> istream& operator>>(istream& i, v(T)& v) {
  F0R(j, sz(v)) i >> v[j];
  return i;
}
template<class A, class B> istream& operator>>(istream& i, pair<A, B>& p) {
  return i >> p.first >> p.second;
}
template<class A, class B, class C> istream& operator>>(istream& i, tuple<A, B, C>& t) {
  return i >> get<0>(t) >> get<1>(t) >> get<2>(t);
}
template<class T> ostream& operator<<(ostream& o, const vector<T>& v) {
  F0R(i, v.size()) {
    o << v[i] << ' ';
  }
  o << newl;
  return o;
}
template<class T1, class T2> ostream& operator<<(ostream& o, const map<T1, T2>& m) {
  for (auto& p : m) {
    o << p.first << ": " << p.second << newl;
  }
  o << newl;
  return o;
}

#if 1

// INSERT ABOVE HERE
signed main() {
  cin.tie(0);
  ios_base::sync_with_stdio(false);

  int a, b;
  cin >> a >> b;
  int y = (a - b) / 2;
  int x = a - y;
  cout << x << ' ' << y;
}
#endif


#include <bits/stdc++.h>
using namespace std;
/* ループ処理 0からnまで*/
#define rep(i, n) for (int i = 0; i < (int)(n); i++)

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

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

#define ll long long int
#define ull unsigned long long
#define vi vector <int>
#define vll vector <long long int>
#define pb push_back
#define FIO ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0)
#define time cerr << "Time taken : "<<(float)clock()/CLOCKS_PER_SEC<<" sec"<<endl;
#define sp " "
#define chk cout << "Alhamdulillah" << endl;
#define nl endl

int main ()
{
  FIO;
  #ifndef ONLINE_JUDGE
  freopen("input.txt","r",stdin);
  freopen("output.txt","w",stdout);
  freopen("error.txt", "w", stderr);
  #endif

  int x, y, z;
  cin >> x >> y;

  if(x == y) z = x;
  else{
  	if(x + y == 3) z = 0;
  	if(x + y == 2) z = 1;
  	if(x + y == 1) z = 2;
  }
  cout << z << nl;

  time;
  return 0;
}


#include<bits/stdc++.h>
using namespace std;
int main(){
  int n, x;
  cin >> n >> x;
  string s;
  cin >> s;
  for(int i=0; i<s.size();++i){
    if(s.at(i)=='o') x++;
    else if(x > 0) x--;
  }
  cout << x << endl;
}

#include <bits/stdc++.h>
#define pb push_back
#define mp make_pair
#define sz(a) ((int)a.size())
#define re return
#define all(a) a.begin(),a.end()
#define int long long
#define rept(i,a,b) for(int i=(a);i<(b);i++)
#define rep(i,a) rept(i,0,a)
#define vi vector<int>
#define vvi(_Name,_Height,_Width) vector<vi>_Name(_Height,vi(_Width))
#define vvi_v(_Name,_Height,_Width,_Value) vector<vi>_Name(_Height,vi(_Width,_Value))
#define pii pair<int,int>
using namespace std;
void fail(string s){ cout<<s;exit(0); }
void fail(int s){ cout<<s;exit(0); }
const int dx[4]={-1,1,0,0};
const int dy[4]={0,0,-1,1};
vi v[2000];
vi use(2000);
int n,m;
int dfs(int u){
	use[u]=1;
	int ans=1;
	for(int i:v[u]){
		if(!use[i])
			ans+=dfs(i);
	}
	re ans;
}
void run_test_case(){
	cin>>n>>m;
	rep(i,m){
		int a,b;
		cin>>a>>b;
		v[a-1].pb(b-1);
	}
	int ans=0;
	rep(i,n){
		rep(_,n)use[_]=0;
		ans+=dfs(i);
	}
	cout<<ans<<'\n';
}
signed main()
{
	ios::sync_with_stdio(0);
	cin.tie(0);cout.tie(0);
	int test_cases=1;
//	cin>>test_cases;
	while(test_cases--)
		run_test_case();
	re 0;
}


#include<cstdio>
#include<iostream>
#include<cmath>
#include<cstring>
#include<cctype>
#include<cstdlib>
#include<algorithm>
#define fs(i,x,y) for(int i=(x),_=(y);i<=_;++i)
#define fn(i,x,y) for(int i=(x),_=(y);i>=_;--i)
#define tor(i,v,x) for(int i=head[x],v=to[i];i;i=nxt[i],v=to[i])
#define Li inline
#define R register int
#define ls(x) ch[x][0]
#define rs(x) ch[x][1]
#define mpi(x,y) make_pair(x,y)
#define pi pair<int,int>
#define int ll
using namespace std;
typedef long long ll;
template<typename T>
void read(T &x){
	x=0;char ch=getchar();bool f=0;
	while(ch<'0'||ch>'9'){
		if(ch=='-')f=1;
		ch=getchar();
	}
	while(ch>='0'&&ch<='9')x=(x<<1)+(x<<3)+ch-'0',ch=getchar();
	x=f?-x:x;
}

const int N=2e5+7;
int n,m;
int a[N];
int now;

bool cmp(int x,int y){
	return x>y;
}

signed main(){
	read(n);fs(i,1,n){
		int x,y;read(x);read(y);
		a[i]=x*2+y;now+=x;
	}
	sort(a+1,a+n+1,cmp);
	fs(i,1,n){
		now-=a[i];if(now<0){
			cout<<i;return 0;
		}
	}
	return 0;
}

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

const int MAXN = 1e5 + 5;

int N, M;
int a[MAXN][2];
vector <pair <int, int>> adj[MAXN];
int bio[MAXN], ans[MAXN];
int c[MAXN];

void load() {
  scanf("%d%d", &N, &M);
  for (int i = 0; i < M; i++)
    for (int j = 0; j < 2; j++)
      scanf("%d", a[i] + j);
  for (int i = 1; i <= N; i++)
    scanf("%d", c + i);
}

void dfs(int x, int p) {
  bio[x] = 1;
  for (auto it : adj[x]) {
    int nxt = a[it.first][it.second];
    if (nxt == p || bio[nxt] == 2)
      continue;
    ans[it.first] = it.second;
    if (!bio[nxt])
      dfs(nxt, x);
  }
  bio[x] = 2;
}

void solve() {
  for (int i = 0; i < M; i++)
    if (c[a[i][0]] != c[a[i][1]])
      ans[i] = c[a[i][0]] > c[a[i][1]];
    else
      for (int j = 0; j < 2; j++)
        adj[a[i][j]].push_back({i, j ^ 1});
  for (int i = 1; i <= N; i++)
    if (!bio[i])
      dfs(i, 0);
  for (int i = 0; i < M; i++)
    printf("%s\n", ans[i] ? "->" : "<-");
}

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


#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace std;
using namespace __gnu_pbds;

// #define endl '\n'
#define fi first
#define se second
#define For(i, l, r) for (int i = l; i < r; i++)
#define ForE(i, l, r) for (int i = l; i <= r; i++)
#define FordE(i, l, r) for (int i = l; i >= r; i--)
#define Fora(v, a) for (auto v: a)
#define bend(a) a.begin(), a.end()
#define isz(a) ((signed)a.size())

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

const int N = 1e3 + 5, inf = 1e9 + 7;

int n, m;
vector <pair <int, char>> adj[N];
int ck[N][N], dp[N][N];

queue <pii> qu;

signed main(){
    ios_base::sync_with_stdio(0);
    cin.tie(0); cout.tie(0);
    // freopen(".inp", "r", stdin);
    // freopen(".out", "w", stdout);
    cin >> n >> m;
    ForE(i, 1, m){
        int u, v; char c; cin >> u >> v >> c;
        adj[u].emplace_back(v, c);
        adj[v].emplace_back(u, c);
    }
    memset(dp, 0x3f, sizeof(dp));
    ForE(i, 1, n){
        dp[i][i] = 0;
        qu.push(make_pair(i, i));
    }
    ForE(u, 1, n){
        Fora(&edge, adj[u]){
            int v = edge.fi, w = edge.se;
            if (u >= v){
                continue;
            }
            dp[u][v] = 1;
            qu.push(make_pair(u, v));
        }
    }
    while (!qu.empty()){
        int u = qu.front().fi, v = qu.front().se; qu.pop();
        if (ck[u][v]){
            continue;
        }
        ck[u][v] = 1;
        Fora(&edgeu, adj[u]){
            Fora(&edgev, adj[v]){
                int uv = edgeu.fi, uw = edgeu.se, vv = edgev.fi, vw = edgev.se;
                if (uw != vw){
                    continue;
                }
                if (uv > vv){
                    swap(uv, vv);
                }
                if (dp[uv][vv] > dp[u][v] + 2){
                    dp[uv][vv] = dp[u][v] + 2;
                    qu.push(make_pair(uv, vv));
                }
            }
        }
    }
    if (dp[1][n] == dp[N - 1][N - 1]){
        cout << -1 << endl;
    }
    else{
        cout << dp[1][n] << endl;
    }
}

/*
==================================================+
INPUT:                                            |
--------------------------------------------------|

--------------------------------------------------|
==================================================+
OUTPUT:                                           |
--------------------------------------------------|

--------------------------------------------------|
==================================================+
*/

#pragma GCC optimize("Ofast")
#define _CRT_SECURE_NO_WARNINGS
#include "bits/stdc++.h"

using namespace std;

#define int long long
#define pb push_back
#define all(v) v.begin(),v.end()
#define allr(v) v.rbegin(),v.rend()
#define mod (int)(1e9+7)
#define mod2 998244353
#define PI 3.1415926535897932384626433832795

void solve() {
    int n; cin>>n;
    string s,t; cin>>s>>t;
    int x=0,y=0;
    for(char ch:s)
        x+=(ch=='0');
    for(char ch:t)
        y+=(ch=='0');

    if(x!=y){
        cout<<"-1\n";return;
    }
    int ans=x;
    int prefs=0,preft=0;
    for(int i=0;i<n;i++){
        prefs+=(s[i]=='0');
        preft+=(t[i]=='0');
        if(s[i]==t[i]&&s[i]=='0'&&prefs==preft)ans--;
    }
    cout<<ans;
}

int32_t main() {
    #ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
    #endif
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    int t=1;
    // cin>>t;
    while(t--){
        solve();
    }
    return 0;
}


#include <bits/stdc++.h>
using namespace std;
#define LL long long
//#define MOD 1000000007
#define MOD 998244353
#define INF 1000000000000000000
#define VE vector
#define VL vector<LL>
#define VVL VE<VL>
#define VVVL VE<VVL>
#define LD long double
#define PB push_back
#define POB pop_back
#define FOR(i,a,k) for(LL i=a;i<k;i++)
#define rep(i,k) FOR(i,0,k)
#define ALL(a) a.begin(),a.end()
#define SORT(a) sort(ALL(a))
#define REV(a) reverse(ALL(a))
#define coutl cout<<fixed<<setprecision(15)//

#define MI modint<MOD>
template<int mod>struct modint{
	int x;
	modint():x(0){}
	modint(LL n):x(n>=0?n%mod:(mod-(-n)%mod)%mod){}
	modint &operator+=(const modint &n){if((x+=n.x)>=mod)x-=mod;return *this;}
	modint &operator-=(const modint &n){if((x+=mod-n.x)>=mod)x-=mod;return *this;}
	modint &operator++(){*this+=1;return *this;}
  modint &operator--(){*this-=1;return *this;}
	modint &operator*=(const modint &n){x=(int)((LL)x*n.x%mod);return *this;}
	modint &operator/=(const modint &n){*this*=n.inv();return *this;}
	modint operator-()const{return modint(-x);}
	modint operator+(const modint &n)const{return modint(*this)+=n;}
	modint operator-(const modint &n)const{return modint(*this)-=n;}
	modint operator++(int){modint ret(*this);*this+=1;return ret;}
  modint operator--(int){modint ret(*this);*this-=1;return ret;}
	modint operator*(const modint &n)const{return modint(*this)*=n;}
	modint operator/(const modint &n)const{return modint(*this)/=n;}
	bool operator<(const modint &n)const{return x<n.x;}
	bool operator>(const modint &n)const{return x>n.x;}
	bool operator<=(const modint &n)const{return x<=n.x;}
	bool operator>=(const modint &n)const{return x>=n.x;}
	bool operator!=(const modint &n)const{return x!=n.x;}
	bool operator==(const modint &n)const{return x==n.x;}
	friend istream &operator>>(istream &is,modint &n){LL l;is>>l;n=modint<mod>(l);return is;}
	friend ostream &operator<<(ostream &os,const modint &n){return os<<n.x;}
	int getmod(){return mod;}
	modint inv()const{int a=x,b=mod,c=1,d=0,n;while(b){n=a/b;swap(a-=n*b,b);swap(c-=n*d,d);}return modint(c);}
	modint pow(LL n)const{modint ret(1),m(x);while(n){if(n&1)ret*=m;m*=m;n>>=1;}return ret;}
};

VL yakusuu(LL N){
	LL M=0;
	VL ret;
	for(LL i=0; i<N; i++){
		M++;
		if(M>N/M){
			for(LL i=0; i<N; i++){
				M--;
				if(M==0){
					return ret;
				}
				if(M*M==N){
					continue;
				}
				if(N%M==0){
					ret.PB(N/M);
				}
			}
		}
	  if(N%M==0){
		  ret.PB(M);
		}
	}
	return ret;
}

LL nanjo(LL a,LL n){//aのn乗  N=nanjo(a,n)A
	LL ret=1;
	for(LL i=0;i<n;i++){
		ret*=a;
	}
	return ret;
}

void YesNo(bool f){
	if(f)cout<<"Yes"<<endl;
	else cout<<"No"<<endl;
}

LL kakuketa(LL n){//各桁の和を求める
	LL a=0;
	while(n>0){
		a=a+n%10;
		n=n/10;
	}
	return a;
}

int main(){
	LL X,Y,Z;
	cin>>X>>Y>>Z;
	LL ans=Y*Z/X;
	if(ans*X==Y*Z){
		ans--;
	}
	cout<<ans<<endl;
}

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

int main(){
    int N; cin >> N;
    string S; cin >> S; int a[N+3];
    rep(i,N+1){
        cin >> a[i+1];
    }
    //a[0] = 0; a[N+2] = 0;
    int k = 2000000000;
    rep(i,N){
        k = min(k,abs(a[i+1]-a[i+2]));
    }
    int c[N+1],d[N+1];
    rep(i,N+1){
        c[i] = a[i+1]/k; d[i] = a[i+1]%k;
    }
    cout << k << endl;
    rep(i,k){
        rep(j,N+1){
            if(i<d[j]) cout << c[j]+1 << " ";
            else cout << c[j] << " ";
        }
        cout << endl;
    }
}


//#define _GLIBCXX_DEBUG

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

#define endl '\n'
#define lfs cout<<fixed<<setprecision(10)
#define ALL(a)  (a).begin(),(a).end()
#define ALLR(a)  (a).rbegin(),(a).rend()
#define spa << " " <<
#define fi first
#define se second
#define MP make_pair
#define MT make_tuple
#define PB push_back
#define EB emplace_back
#define rep(i,n,m) for(ll i = (n); i < (ll)(m); i++)
#define rrep(i,n,m) for(ll i = (ll)(m) - 1; i >= (ll)(n); i--)
using ll = long long;
using ld = long double;
const ll MOD1 = 1e9+7;
const ll MOD9 = 998244353;
const ll INF = 1e18;
using P = pair<ll, ll>;
template<typename T1, typename T2>bool chmin(T1 &a,T2 b){if(a>b){a=b;return true;}else return false;}
template<typename T1, typename T2>bool chmax(T1 &a,T2 b){if(a<b){a=b;return true;}else return false;}
ll median(ll a,ll b, ll c){return a+b+c-max({a,b,c})-min({a,b,c});}
void ans1(bool x){if(x) cout<<"Yes"<<endl;else cout<<"No"<<endl;}
void ans2(bool x){if(x) cout<<"YES"<<endl;else cout<<"NO"<<endl;}
void ans3(bool x){if(x) cout<<"Yay!"<<endl;else cout<<":("<<endl;}
template<typename T1,typename T2>void ans(bool x,T1 y,T2 z){if(x)cout<<y<<endl;else cout<<z<<endl;}
template<typename T>void debug(vector<vector<T>>&v,ll h,ll w){for(ll i=0;i<h;i++){cout<<v[i][0];for(ll j=1;j<w;j++)cout spa v[i][j];cout<<endl;}};
void debug(vector<string>&v,ll h,ll w){for(ll i=0;i<h;i++){for(ll j=0;j<w;j++)cout<<v[i][j];cout<<endl;}};
template<typename T>void debug(vector<T>&v,ll n){if(n!=0)cout<<v[0];for(ll i=1;i<n;i++)cout spa v[i];cout<<endl;};
template<typename T>vector<vector<T>>vec(ll x, ll y, T w){vector<vector<T>>v(x,vector<T>(y,w));return v;}
ll gcd(ll x,ll y){ll r;while(y!=0&&(r=x%y)!=0){x=y;y=r;}return y==0?x:y;}
vector<ll>dx={1,-1,0,0,1,1,-1,-1};vector<ll>dy={0,0,1,-1,1,-1,1,-1};
template<typename T>vector<T> make_v(size_t a,T b){return vector<T>(a,b);}
template<typename... Ts>auto make_v(size_t a,Ts... ts){return vector<decltype(make_v(ts...))>(a,make_v(ts...));}
template<typename T1, typename T2>ostream &operator<<(ostream &os, const pair<T1, T2>&p){return os << p.first << " " << p.second;}
template<typename T>ostream &operator<<(ostream &os, const vector<T> &v){for(auto &z:v)os << z << " ";cout<<"|"; return os;}
template<typename T>void rearrange(vector<ll>&ord, vector<T>&v){
  auto tmp = v;
  for(int i=0;i<tmp.size();i++)v[i] = tmp[ord[i]];
}
template<typename Head, typename... Tail>void rearrange(vector<ll>&ord,Head&& head, Tail&&... tail){
  rearrange(ord, head);
  rearrange(ord, tail...);
}
//mt19937 mt(chrono::steady_clock::now().time_since_epoch().count());
int popcount(ll x){return __builtin_popcountll(x);};
int poplow(ll x){return __builtin_ctzll(x);};
int pophigh(ll x){return 63 - __builtin_clzll(x);};
vector<ll> bfs(vector<vector<ll>>&g,ll k=0){
  vector<ll>dist(g.size(),INF);
  queue<P> q;
  ll n=g.size();
  q.emplace(k,0);
  while(!q.empty()){
    ll x=q.front().fi;
    ll len=q.front().se;
    if(dist[x]==INF){
      dist[x]=len;
      for(ll i=0;i<g[x].size();i++){
        q.emplace(g[x][i],len+1);
      }
    }
    q.pop();
  }
  return dist;
}
void check(vector<vector<ll>>g){
  ll n=g.size();
  ll mx=0;
  rep(i,0,n){
    auto d=bfs(g,i);
    rep(j,0,n)chmax(mx,d[j]);
  }
  cout<<mx<<endl;
}
int main(){
  cin.tie(nullptr);
  ios_base::sync_with_stdio(false);
  ll res=0,buf=0;
  bool judge = true;
  ll n;cin>>n;
  vector<P>v(n);
  vector<vector<ll>>g(n);
  rep(i,1,n+1){
    ll l=(2*(i-1))%n+1;
    ll r=(2*(i-1)+1)%n+1;
    cout<<l spa r<<endl;
    g[i-1].PB(l-1);
    g[i-1].PB(r-1);
  }
  //check(g);
  return 0;
}

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

#define INF 1234567890
#define ll long long

int N;
vector<int> g[2020];
int dist[2020];

int main()
{
	scanf("%d", &N);
	for(int i=0; i<N/2; i++)
	{
		g[i].push_back(i*2);
		g[i].push_back(i*2+1);
	}
	for(int i=N/2; i<N; i++)
	{
		g[i].push_back((i*2)%N);
		g[i].push_back((i*2+1)%N);
	}

	// int mx = 0;
	// for(int i=0; i<N; i++)
	// {
	// 	memset(dist, 0x3f, sizeof(dist));
	// 	queue<int> q;
	// 	q.push(i); dist[i] = 0;
	// 	while(!q.empty())
	// 	{
	// 		int n = q.front(); q.pop();
	// 		for(int next : g[n])
	// 		{
	// 			if (dist[next] != 0x3f3f3f3f) continue;
	// 			q.push(next); dist[next] = dist[n] + 1;
	// 		}
	// 	}
	// 	for(int j=0; j<N; j++)
	// 	{
	// 		//if (dist[j] > 10) printf("D[%d][%d] = %d\n", i, j, dist[j]);
	// 		mx = max(mx, dist[j]);
	// 	}
	// }
	// printf("mx : %d\n", mx);

	for(int i=0; i<N; i++)
		printf("%d %d\n", g[i][0]+1, g[i][1]+1);
	return 0;
}


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

#define ll long long
#define drep(i, cc, n) for (ll i = (cc); i <= (n); ++i)
#define rep(i, n) drep(i, 0, n - 1)
#define P pair<ll, ll>
#define all(a) (a).begin(), (a).end()
#define pb push_back
#define fi first
#define se second

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

    vector<ll> a(n);
    rep(i, n) cin >> a[i];

    vector<bool> surplus(200, false);
    vector<vector<ll>> sup_info(200);
    ll cnt = min(n, (ll)8);
    ll mod = 200;
    drep(bit, 1, ((1<<cnt)-1)){
        ll tmp = 0;
        ll count = 0;
        rep(i, n) if((bit>>i) & 1){
            count++;
            tmp += a[i];
            tmp%=mod;
        }
        if(surplus[tmp] == false){
            surplus[tmp] = true;
            rep(i, n) if((bit>>i) & 1) sup_info[tmp].pb(i);
        }else{
            cout << "Yes" << endl;
            ll size = sup_info[tmp].size();
            cout << size;
            rep(i, size) cout << " " << sup_info[tmp][i]+1;
            cout << endl;
            cout << count;
            rep(i, n) if((bit>>i) & 1) cout << " " << i+1;
            cout << endl;
            return 0;
        }
    }
    cout << "No" << endl;
}

#include<bits/stdc++.h>
#define inf 999999999
using namespace std;
const int maxn=1e5+10;
int n,sz[maxn],h[maxn],tot,f[maxn];
struct edge{int t,n;}e[maxn<<1];
void ins(int u,int v){e[++tot]=edge{v,h[u]};h[u]=tot;}
void dfs(int v,int fa)
{
	int sum=0;
	vector<int>seq;
	for(int i=h[v];i;i=e[i].n)
	{
		if(e[i].t==fa)continue;
		dfs(e[i].t,v);
		sz[v]+=sz[e[i].t];
		if(sz[e[i].t]%2)
		{
			seq.push_back(-f[e[i].t]);
		}
		else
		{
			if(f[e[i].t]<0)f[v]+=f[e[i].t];
			else sum-=f[e[i].t];
		}
	}
	sort(seq.begin(),seq.end(),greater<int>{});
	seq.push_back(sum);
	for(int i=0;i<(int)seq.size();i++)
	{
		if(i%2) f[v]+=seq[i];
		else f[v]-=seq[i];
	}
};
signed main()
{
	cin>>n;
	for(int i=2,t;i<=n;i++)
	{
		cin>>t;ins(i,t);ins(t,i);
	}
	for(int i=1;i<=n;i++)f[i]=sz[i]=1;

	dfs(1,0);
	cout<<(f[1]+n)/2<<endl;
	return 0;
}


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

using namespace std;

int main()
{
    int n;
    cin >> n;
    int A[n];
    int B[n];
    for (int i = 0; i < n; i++)
    {
        cin >> A[i] >> B[i];
    }
    int ans = 1000000;
    for (int i = 0; i < n; i++)
    {
        for (int j = 0; j < n; j++)
        {
            if (i == j)
            {
                ans = min(ans, A[i] + B[j]);
            }
            else
            {
                ans = min(ans, max(A[i], B[j]));
            }
        }
    }
    cout << ans << "\n";
}

#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[1011];
int B[1011];

void MAIN() {
    scanf("%d", &N);
    REP (i, N) scanf("%d%d", A+i, B+i);

    int k = min_element(A, A+N) - A;

    int ans = 1<<29;
    REP (i, N) if (i != k) {
	amin(ans, max(A[k], B[i]));
    }

    k = min_element(B, B+N) - B;
    REP (i, N) if (i != k) {
	amin(ans, max(A[i], B[k]));
    }

    REP (i, N) {
	amin(ans, A[i] + B[i]);
    }

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

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


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

int main() {
    ios::sync_with_stdio(0);cin.tie(0);cout.tie(0);
    string s1, s2, s3;
    cin >> s1 >> s2 >> s3;
    set<char> s;
    for(char c : s1) s.insert(c);
    for(char c : s2) s.insert(c);
    for(char c : s3) s.insert(c);
    if(s.size() > 10) {
        cout << "UNSOLVABLE" << endl;
        return 0;
    }
    vector<int> ord(10);
    iota(ord.begin(), ord.end(), 0);
    auto len = [&](ll x) -> int {
        return log10(x) + 1;
    };
    do {
        vector<int> mp(26);
        int it = 0;
        for(char c : s) {
            mp[c - 'a'] = ord[it];
            ++it;
        }
        ll a1 = 0, a2 = 0, a3 = 0;
        for(char c : s1) a1 = a1 * 10 + mp[c - 'a'];
        for(char c : s2) a2 = a2 * 10 + mp[c - 'a'];
        for(char c : s3) a3 = a3 * 10 + mp[c - 'a'];
        if(a1 + a2 == a3 && a1 && a2 && a3 && len(a1) == s1.size() && len(a2) == s2.size() && len(a3) == s3.size()) {
            cout << a1 << endl;
            cout << a2 << endl;
            cout << a3 << endl;
            exit(0);
        }
    }while(next_permutation(ord.begin(), ord.end()));
    cout << "UNSOLVABLE" << endl;
}

#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0;i < (int)(n); i++)
#define all(x) (x).begin(),(x).end()
typedef long long ll;
#define F first
#define S second
#define YES(n)cout << ((n) ? "YES" : "NO"  ) << endl
#define Yes(n) cout << ((n) ? "Yes" : "No"  ) << endl

int main(){
    vector<string> s(3);
    map<char,ll> mp;
    set<char> heads;
    rep(i,3){
        cin>>s[i];
        heads.insert(s[i][0]);
        reverse(all(s[i]));
        ll co=1;
        if(i==2)co=-1;
        for(char c:s[i]){
            mp[c]+=co;
            co*=10;
        }
        reverse(all(s[i]));
    }
    if(mp.size()>10){
        cout<<"UNSOLVABLE"<<endl;
        return 0;
    }
    vector<int> p(10);
    iota(all(p),0);
    do{
        ll tot=0;
        int i=0;
        for(auto x:mp){
            char c=x.first;
            ll co=x.second;
            if(p[i]==0&&heads.count(c)) tot=1e18;
            tot+=co*p[i];
            i++;
        }
        if(tot==0){
            i = 0;
            vector<string> ans(3);
            for(auto& x : mp){
                x.second=p[i];
                ++i;
            }
            rep(i,3){
                ll x=0;
                for(char c:s[i]){
                    x=x*10+mp[c];
                }
                cout<<x<<endl;
            }
            return 0;
        }
    }while(next_permutation(all(p)));
    cout<<"UNSOLVABLE"<<endl;
    return 0;
}


#pragma GCC optimize("Ofast")
#pragma GCC target("avx,avx2,fma")

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

using namespace std;
using namespace __gnu_pbds;

#define LL long long
#define int long long
#define ull unsigned long long
#define fi first
#define se second
#define pll pair<LL, LL>
#define pii pair<int, int>
#define fastio ios::sync_with_stdio(false), cin.tie(0), cout.tie(0);
#define SZ(x) ((int)(x.size()))
#define LC (id<<1)
#define RC (id<<1|1)

constexpr int N = 1e6+9;
constexpr int M = 1e9+7;
#ifdef int
constexpr int INF = 0x3f3f3f3f3f3f3f3f;
constexpr int INF2 = 0xcfcfcfcfcfcfcfcf;
#else
constexpr int INF = 0x3f3f3f3f;
constexpr int INF2 = 0xcfcfcfcf;
#endif

signed main() {
    fastio;
    int n;
    cin >> n;
    vector<int> fa(n, -1);
    vector<vector<int>> ch(n);
    for (int i = 1; i < n; i++) {
        cin >> fa[i];
        fa[i]--;
        ch[fa[i]].emplace_back(i);
    }
    vector<int> sz(n, 1);
    // sz*2 + sz-1
    vector<int> dp(n, 0);
    function<void(int)> dfs = [&](int u) {
        dp[u] = 1;
        array<vector<pii>, 2> sub;
        for (int v: ch[u]) {
            dfs(v);
            sz[u] += sz[v];
            sub[sz[v]&1].emplace_back(dp[v], sz[v]-dp[v]);
        }
        sort(sub[0].begin(), sub[0].end(), [](const pii& p1, const pii& p2) {
            return p1.fi-p1.se > p2.fi-p2.se;
        });
        sort(sub[1].begin(), sub[1].end(), [](const pii& p1, const pii& p2) {
            return p1.fi-p1.se < p2.fi-p2.se;
        });
        while (!sub[0].empty() && sub[0].back().fi <= sub[0].back().se) {
            dp[u] += sub[0].back().fi;
            sub[0].pop_back();
        }
        while (!sub[0].empty()) {
            if (SZ(sub[1]) & 1)
                dp[u] += sub[0].back().se;
            else
                dp[u] += sub[0].back().fi;
            sub[0].pop_back();
        }
        for (int i = 0; i < SZ(sub[1]); i++) {
            if (i & 1) dp[u] += sub[1][i].se;
            else dp[u] += sub[1][i].fi;
        }
    };
    dfs(0);
    cout << dp[0] << "\n";
    return 0;
}

#pragma region head
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using vi = vector<int>;
using vll = vector<ll>;
using pi = pair<int, int>;
using pll = pair<ll, ll>;
template <class T>
using vv = vector<vector<T>>;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define repi(i, a, b) for (int i = (int)(a); i < (int)(b); i++)
#define rrep(i, n) for (int i = (int)(n)-1; i >= 0; i--)
#define rrepi(i, a, b) for (int i = (int)(b)-1; i >= (int)(a); i--)
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define bit(n) (1LL << (n))
template <class T>
inline bool chmax(T &a, const T &b) {
    if (a < b) {
        a = b;
        return 1;
    }
    return 0;
}
template <class T>
inline bool chmin(T &a, const T &b) {
    if (a > b) {
        a = b;
        return 1;
    }
    return 0;
}
const int INF = 1002003004;
const ll LINF = 1002003004005006007ll;
struct preprocess {
    preprocess() {
        cin.tie(nullptr);
        ios::sync_with_stdio(false);
        cout << fixed << setprecision(20);
    }
} ____;
#pragma endregion head

#pragma region library
#pragma endregion library
string inv(const string &s) {
    string res = "";
    rep(i, s.size()) {
        if (s[i] == 'A') {
            res += 'B';
        } else {
            res += 'A';
        }
    }
    return res;
}
int main() {
    int n;
    cin >> n;
    vector<string> ans = {"AB"};
    rep(i, n - 1) {
        vector<string> nxt;
        rep(i, ans.size()) {
            nxt.emplace_back(ans[i] + ans[i]);
            nxt.emplace_back(ans[i] + inv(ans[i]));
        }
        nxt.emplace_back(string(ans[i].size(), 'A') + string(ans[i].size(), 'B'));
        swap(nxt, ans);
    }
    cout << ans.size() << '\n';
    rep(i, ans.size()) {
        cout << ans[i] << '\n';
    }
}


#include <algorithm>
#include <bitset>
#include <cstdio>
#include <iostream>
#include <map>
#include <math.h>
#include <queue>
#include <set>
#include <stack>
#include <vector>
using namespace std;
typedef long long int ll;
typedef long double ld;
#define rep(i,n) for(int i = 0; i < (n); ++i)
#define Sort(Array) sort(Array.begin(), Array.end())
#define Reverse(a) reverse(a.begin(), a.end())
#define out(ans) cout << ans << endl;
int MOD = 1000000007;
const int INF = 2147483647;
const ld PI = 3.14159265358979323846;

int main() {

    string S; cin >> S;
    int k = S.size();
    int ans = INF;
    for (int bit = 0; bit < (1<<k); ++bit) {
        int sum = 0;
        int ans_tmp = 0;
        for (int i=0; i < k; ++i) {
            if (bit & (1<<i)) {
                ans_tmp++;
            } else {
                sum += S[i] - '0';
            }
        }
        if (sum > 0 && sum % 3 == 0) ans = min(ans, ans_tmp);
    }

    if (ans == INF) ans = -1;
    out(ans);

    return 0;
}

#include <iostream>
#include <vector>
using namespace std;
int n, ans = -1;
vector<int> nums, lst;

void dfs(int pos, int s) {
    if (pos == n) {
        if (lst.size() > 0 && s % 3 == 0) ans = max(ans, (int)lst.size());
        return ;
    }
    lst.push_back(nums[pos]);
    dfs(pos + 1, s + nums[pos]);
    lst.pop_back();
    dfs(pos + 1, s);
}

int main() {
    long long tmp;
    cin >> tmp;
    while (tmp) {
        nums.push_back(tmp % 10);
        tmp /= 10;
    }
    n = nums.size();
    dfs(0, 0);
    if (ans == -1) cout << -1 << endl;
    else cout << (int)nums.size() - ans << endl;
    return 0;
}


#include <iostream>

using namespace std;

typedef long long ll;

int main(){
    string S;
    ll a;
    scanf("%lld",&a);
    cin >> S;
    for (ll i=0; i<a-2; i++) {
        if (S[i]=='f' && S[i+1]=='o' && S[i+2]=='x') {
            S.erase(i, 3);
            i-=3;
        }
    }
    cout << S.size() << endl;
}

#include<bits/stdc++.h>
using namespace std;
typedef  long long int ll;
#include<string.h>
#define pi 3.1415926535897932384626433832795028841971
#define fastttt std::ios::sync_with_stdio(false);std::cin.tie(NULL);std::cout.tie(NULL);
#define str_max_len 4294967295
#define mod 1000000007
#define max_ll LLONG_MAX
#define min_ll LLONG_MIN
#define cps CLOCKS_PER_SEC
#define pb push_back
#define fi first
#define se second
#define in insert
#define m_p make_pair
#define p_q priority_queue
#define fo(i,n) for(ll i=0;i<n;i++)
#define fo1(i,n) for(ll i=1;i<=n;i++)
#define vii vector <pair<ll,ll>>
#define pii pair<ll,ll>
#define vi vector <ll>
ll ll_max(ll a,ll b,ll c){return max(a,max(b,c));}
int int_max(int a,int b,int c){return max(a,max(b,c));}
ll ll_min(ll a,ll b,ll c){return min(a,min(b,c));}
int int_min(int a,int b,int c){return min(a,min(b,c));}
ll max(int a,ll b){ return max((ll)a,b);}
ll min(int a,ll b){ return min((ll)a,b);}
ll min(ll a,int b){ return min(a,(ll)b);}
ll max(ll a,int b){ return max(a,(ll)b);}
ll maximum(ll a[],ll n)
{
	ll max1=min_ll;
	fo(i,n)
	{
		max1=max(max1,a[i]);
	}
	return max1;
}
ll minimum(ll a[],ll n)
{
	ll min1=max_ll;
	fo(i,n)
	{
		min1=min(min1,a[i]);
	}
	return min1;
}

ll power(ll x,ll y,ll m){            //power(x,y)=x^y  %m;
    if(y==0)return 1;
    ll a=power(x,y/2,m);
    if(y%2){
        return (a*((a*x)%m))%m;
    }
    else{
        return (a*a)%m;
    }
}
ll mod_inverse(ll x,ll m){
    return power(x,m-2,m);
}
ll fact(ll n,ll m){
    if(n<=1)return 1;
    return (fact(n-1,m)*n)%m;
}
ll ncr(ll n,ll r,ll m){
    if(r>n)return 0;
    ll n1=1,d1=1,d2=1;
    n1=fact(n,m);d1=fact(r,m);d2=fact(n-r,m);
    ll ans=mod_inverse((d1*d2)%m,m);
    ans=(ans*n1)%m;
    return ans;
}
ll gcd(ll a, ll b){
	if(a==0||b==0)return max(a,b);
    if (a < b)return gcd(b, a);
    if (a % b == 0) return b;
    return gcd(b,a % b);}

ll ispal(string s){
    ll len=s.size();
    ll flag=1;
    for(ll i=0;i<len;++i){
        if(s[i]!=s[len-i-1]){
            flag=0;break;
        }
    }
    return flag;
}

bool sortbysec(const pair<ll,ll> &a,
              const pair<ll,ll> &b)
{
    return (a.second < b.second);
}

/***************************code begins here*****************************/

class solver{
	public:

	void solve()
	{
		ll n;cin>>n;
		string s;cin>>s;ll ans=0;
		stack <char> st;
		if(n<=2)
		{
			cout<<n;return;
		}

		fo(i,n)
		{
			st.push(s[i]);
			//cout<<st.size()<<" ";
			if(st.size()>=3)
			{
				char a=st.top();st.pop();
				char b=st.top();st.pop();
				char c=st.top();st.pop();
				if(a=='x' && b=='o'&& c=='f')
				{
					n++;n--;
				}
				else
				{
					st.push(c);
					st.push(b);
					st.push(a);
				}

			}
		}
		cout<<st.size();
	}

};

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

	int test=1,c=1;
//	cin>>test;
	while(test--){
		//cout<<"Case #"<<c<<": ";c++;
		solver o;
		o.solve();
	}
}


#include <bits/stdc++.h>

using namespace std;
#define all(x) (x).begin(),(x).end()
#define rep(i, n) for (int i = 0; i < (n); i++)
#define endl "\n"
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;

template <typename T> ostream &operator<<(ostream &os, const vector<T> &vec) {os << "["; for (const auto &v : vec) {os << v << ","; } os << "]"; return os;}
template <typename T, typename U> ostream &operator<<(ostream &os, const pair<T, U> &p) {os << "(" << p.first << ", " << p.second << ")"; return os;}

void solve() {
    int N;
    cin >> N;
    vector<ll> A(N), T(N);
    for (int i = 0; i < N; i++) {
        cin >> A[i] >> T[i];
    }
    ll inf = 4e18;
    ll lo = -inf, hi = inf;
    ll sum = 0;
    for (int i = 0; i < N; i++) {
        if (T[i] == 1) {
            sum += A[i];
            lo += A[i];
            hi += A[i];
        }
        if (T[i] == 2) {
            lo = max(lo, A[i]);
            hi = max(lo, hi);
        }
        if (T[i] == 3) {
            hi = min(hi, A[i]);
            lo = min(lo, hi);
        }
    }

    ll ok_lo = lo - sum;
    ll ok_hi = hi - sum;

    int Q;
    cin >> Q;
    for (int i = 0; i < Q; i++) {
        ll x;
        cin >> x;
        if (x > ok_hi) {
            cout << hi << endl;
        } else if (x < ok_lo) {
            cout << lo << endl;
        } else {
            cout << x + sum << endl;
        }
    }
}

int main() {
    #ifdef LOCAL_ENV
    cin.exceptions(ios::failbit);
    #endif
    cin.tie(0);
    ios::sync_with_stdio(false);
    cout.setf(ios::fixed);
    cout.precision(16);

    solve();
}


#include "bits/stdc++.h"
using namespace std;
#define int long long int
int32_t main()
{
    int n,m;
    cin>>n>>m;
    vector<int> a(n+1),b(m+1);
    for(int i=1;i<=n;i++)
    {
        cin>>a[i];
    }
    for(int i=1;i<=m;i++)
    {
        cin>>b[i];
    }

    vector<vector<int> > dp(n+1,vector<int>(m+1));

    for(int i=1;i<=m;i++)
    {
        dp[0][i]=i;
    }

    for(int i=1;i<=n;i++)
    {
        dp[i][0]=i;
    }

    for(int i=1;i<=n;i++)
    {
        for(int j=1;j<=m;j++)
        {
            dp[i][j]=min({dp[i-1][j]+1,dp[i][j-1]+1,dp[i-1][j-1]+((a[i]!=b[j])?1:0)});
        }
    }

    cout<<dp[n][m]<<endl;

    return 0;
}

#include "bits/stdc++.h"
using namespace std;
#define ll long long
#define pb push_back
#define all(_obj) _obj.begin(),_obj.end()
#define F first
#define S second
#define pll pair<ll, ll>
#define vll vector<ll>
ll n,m,a,b,c,k,temp,x,y,INF=1e18;
const int MAXN=1e5+11,mod=1e9+7;
ll max(ll a,ll b) {return ((a>b)?a:b);}
ll min(ll a,ll b) {return ((a>b)?b:a);}
vll read(int n) {vll v(n);for (int i = 0; i < v.size(); i++)cin>>v[i];return v;}
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
int dp[1001][1001];
void sol(void)
{
cin>>n>>m;
vll v1=read(n),v2=read(m);
for(int i=0;i<=1000;i++)
for(int j=0;j<=1000;j++)
dp[i][j]=1e9;
for(int i=0;i<=1000;i++)
dp[i][m]=n+m,dp[n][i]=n+m;
for(int i=n-1;i>=0;i--)
{
    for(int j=m-1;j>=0;j--)
    {
        if(v1[i]==v2[j])
        dp[i][j]=min(dp[i][j],dp[i+1][j+1]-2);
        dp[i][j]=min(dp[i][j],dp[i+1][j+1]-1);
        dp[i][j]=min(dp[i][j],dp[i+1][j]);
        dp[i][j]=min(dp[i][j],dp[i][j+1]);
    }
}
cout<<dp[0][0];
return ;
}
int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL),cout.tie(NULL);
    int test=1;
    //cin>>test;
    while(test--) sol();
}


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

#define ff              first
#define ss              second
#define int             long long
#define pb              push_back
#define pii             pair<int,int>
#define vi              vector<int>
#define mii             map<int,int>
#define pqb             priority_queue<int>
#define pqs             priority_queue<int,vi,greater<int> >
#define setbits(x)      __builtin_popcountll(x)
#define zrobits(x)      __builtin_ctzll(x)
#define mod             1000000007
#define inf             1e18
#define ps(x,y)         cout<<setprecision(y)<<x
#define mk(arr,n,type)  type *arr=new type[n];
#define w(x)            int x; cin>>x; while(x--)
#define pw(b,p)         pow(b,p) + 0.1
#define endl            "\n"
mt19937                 rng(chrono::steady_clock::now().time_since_epoch().count());

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

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

char myHeap[200 * 1024 * 1024];
int sz = 0;
void assert_tle(bool q) { while (!q); }
void* operator new  ( std::size_t count ) {
    sz += count;
    assert_tle(sz <= 200 * 1024 * 1024);
    return myHeap + sz - count;
}

void operator delete (void *ptr) { }

void fastIO()
{
    ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
}

struct djsets
{
    vector<int> leader;
    vector<int> rank;

    void init(int n)
    {
        rank.assign(n,1);
        for(int i=0;i<n;i++)
        {
            leader.push_back(i);
        }
    }

    int retleader(int node)
    {
        if(leader[node]==node)
            return node;
        int p= retleader(leader[node]);
        leader[node]=p;

        return p;
    }
    void connect(int a,int b)
    {
        a=retleader(a);
        b=retleader(b);

        if(rank[a]>rank[b])
        {
            leader[b]=a;
        }
        else if(rank[b]>rank[a])
        {
            leader[a]=b;
        }
        else
        {
            leader[b]=a;
            rank[a]++;
        }
    }

    int retans()
    {
        int ans=0;
        for(int i=0;i<leader.size();i++)
            if(leader[i]==i&&rank[i]>1) ans++;

        return ans-1;
    }
};

void solve()
{
    int h,w;
    cin>>h>>w;

    string str[h];

    for(int i=0;i<h;i++)
    {
        cin>>str[i];
    }

    str[0][0]=str[h-1][0]=str[h-1][w-1]=str[0][w-1]='#';

    djsets d;
    d.init(h+w);

    for(int i=0;i<h;i++)
    {
        for(int j=0;j<w;j++)
        {
            if(str[i][j]=='#')
            {
                d.connect(i,h+j);
            }
        }
    }

    int rows=0,col=0;

    for(int i=0;i<h;i++)
    {
        if(d.rank[d.retleader(i)]==1) rows++;
    }
    for(int i=h;i<h+w;i++)
    {
        if(d.rank[d.retleader(i)]==1) col++;
    }
    cout<<d.retans()+min(rows,col);

}

int32_t main()
{
    fastIO();
    //w(t)
    {
        solve();
        cout<<endl;
    }
    return 0;
}

#include <bits/stdc++.h>
#define rep(i, a, b) for(int i = a; i <=b ; ++i)
#define per(i, b, a) for(int i = b; i >= a; --i)
#define ll long long
#define pb push_back
using namespace std;
inline void rd(int &x){scanf("%d", &x);}
inline void rd(ll &x){scanf("%lld", &x);}
int n, m, k;
const int maxn = 1145;
int par[maxn << 1];
int findroot(int u)
{
    return par[u] == u ? par[u] : (par[u] = findroot(par[u]));
}
void merge(int u, int v)
{
    if(findroot(u) == findroot(v)) return;
    par[findroot(u)] = v;
}
int main()
{
    ios::sync_with_stdio(0), cin.tie(0);
    cin >> n >> m;
    rep(i, 1, n + m) par[i] = i;
    rep(i, 1, n)
    {
        string s;
        cin >> s;
        rep(j, 1, m) if(s[j - 1] == '#') merge(i, n + j);
    }
    merge(1, n + 1), merge(1, n + m), merge(n, n + 1), merge(n, n + m);
    int ans = 0;
    unordered_set<int> r, c;
    rep(i, 1, n) r.insert(findroot(i));
    rep(j, 1, m) c.insert(findroot(j + n));
    cout << min(r.size(), c.size()) - 1;
}


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

int main()
{

    int v, t, s, d;
    cin >> v >> t >> s >> d;

    if (t * v <= d && d <= s * v)
    {
        cout << "No" << endl;
    }
    else
    {
        cout << "Yes" << endl;
    }

    return 0;
}

#include<bits/stdc++.h>

using namespace std;

#define ll long long int
#define get(a) ll a ; cin >> a ;
#define show(a) cout << a << endl;

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

	get(v);
	get(t);
	get(s);
	get(d);

	float time = d/float(v);

	if ( time < t or time > s)
		cout << "Yes"<< endl;
	else
		cout<< "No" << endl;

	return 0;
}


#include<bits/stdc++.h>
using namespace std;
typedef long long LL;
const LL MOD=998244353;
LL n,a[105],sum,p[105],fac[105],dp[105][10005];
int main(){
	scanf("%lld",&n);
	for(LL i=1;i<=n;++i)	scanf("%lld",&a[i]),sum+=a[i];
	if(sum&1)	return puts("0")&0;
	for(LL i=1;i<=n;++i)	++p[a[i]];
	fac[0]=1;
	for(LL i=1;i<=100;++i)	fac[i]=fac[i-1]*i%MOD;
	dp[0][0]=1;
	for(LL i=1;i<=n;++i)	for(LL j=i-1;~j;--j)	for(LL k=0;k<=sum;++k)	(dp[j+1][k+a[i]]+=dp[j][k])%=MOD;
	LL ans=dp[n][0];
	for(LL i=1;i<=n;++i)	(ans+=fac[n-i]*fac[i]%MOD*dp[i][sum>>1]%MOD)%=MOD;
	printf("%lld",ans);
	return 0;
}

//Date -> 27-06-2021
//Atcoder Grand Contest
#include <bits/stdc++.h>
using     namespace     std;
typedef   long long     ll;
typedef   vector<int>   vi;
typedef   pair<int,int> pii;
#define   all(x)        (x).begin(),(x).end()
#define   rep(i,a,b)    for(ll i = a; i<b ; i++)
#define   sz(x)         (int)((x).size())
#define   PI             3.141592653589
#define   mod            998244353//1000000007
#define   MAX            1000005 //1e6+5
#define   ppc             __builtin_popcount
#define   ppcll           __builtin_popcountll
long long const INF = 1e6;

ll power(ll a, ll b)
{   ll result =1;
    while(b)
    {   if(b%2) result=(result*a)%mod;
        a=(a*a)%mod;
        b/=2;}
    return result;
}
/*
Let X = T(Takahashi's Score) — A(Aoki's score)

Initially, X = 0 The process is such that, at the first step, some w[i] will be added to X, then for the next
few steps 2,3,4... etc some w[i]'s shall be subtracted and finally the sum becomes 0, at the last step.

So, there are some k elements which are added to X, and some n — k elements which are subtracted from X,
so that X remains 0 finally, after the process.

Let us say we have already chosen these elements: We have some k elements if the W array,
 whose sum is exactly equal to the remaining n — k elements.

The k elements will give positive contribution to X, and n — k will give negative contribution.

Once the elements are chosen, at the first step, the element kept shall be one of the k elements
(as first step is a positive contribution.Then, the next element must be from the
other group (with n — k elements), it can be chosen in (n — k) ways, if the sum is still > 0,
then again some element will be chosen from the 2nd (negative contribution group) group,
this time with (n — k — 1) possibilities... next maybe (n — k — 2) possibilities and so on,
until X becomes < 0, now out of the (k-1) elements of the first group, some will be chosen
(of course in k-1 ways..)

Basically, the above should kind of show that once k elements
with "positive role" and n — k with "negative role" are chosen,
then we can take them individually in any order.
I mean the elements of a particular group can be permuted with each other. So, (n — k)! * k! ways are there.*/
int n;
int a[102];
ll fact[104];
void sol()
{
    cin>>n;
    int sum =0;
    rep(i,0,n) {cin>>a[i]; sum+=a[i];}
    fact[0]=1;
    for(int i=1;i<102;i++)
    {
        fact[i]=fact[i-1]*i;
        fact[i]%=mod;
    }

    if(sum%2 != 0) {cout<<"0"; return;}
    int req = sum/2;

    ll dp[n+1][req+1][n+1]; //dp[n][x][k] is num of way making sum x using exactly k elemnts
    memset(dp,0,sizeof(dp));
    for(int i=0;i<=n;i++) dp[i][0][0] = 1; //making sum 0 with 0 elemnt
    for(int i=1;i<=n;i++)
    {
        for(int j=0;j<=req;j++)
        {
            for(int k=1;k<=i;k++) //k<=i bcz we never get len more than i by using elemnt upto idx i-1
            {
                dp[i][j][k] = dp[i-1][j][k];
                if(j-a[i-1]>=0) {dp[i][j][k] += dp[i-1][j-a[i-1]][k-1]; dp[i][j][k]%=mod;}
            }
        }
    }
    ll ans = 0;
    for(int k=1;k<=n-1;k++)
    {
        ll curr = ((fact[k]*fact[n-k])%mod)*dp[n][req][k];
        curr%=mod;
        ans = ans + curr;
        ans%=mod;
    }
    cout<<ans;
}
int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);cout.tie(NULL);
    int T=1; //cin>>T;
    while(T--) sol();
    return 0;
}


#include<cstdio>
#include<queue>
#define LL long long
using namespace std;
int read() {
	int x=0,f=1;char c=getchar();
	while(c>'9'||c<'0'){if(c=='-')f=-1;c=getchar();}
	while(c>='0'&&c<='9'){x=x*10+c-'0';c=getchar();}
	return x*f;
}
priority_queue<LL>q;
const int N=4e5+5;
int n;
LL v[N],ans;
main() {
	n=read();
	for(int i=1;i<=2*n;++i)v[i]=read(),ans+=v[i];
	for(int i=1,j=n,k=n+1;i<=n;++i) {
		for(;j>=n-i+1;--j)q.push(-v[j]);
		for(;k<=i+n;++k)q.push(-v[k]);
		ans+=q.top();q.pop();
	}
	printf("%lld",ans);
	return 0;
}

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

#include<iostream>
#include<string>
#include<cstdio>
#include<vector>
#include<cmath>
#include<algorithm>
#include<functional>
#include<iomanip>
#include<queue>
#include<ciso646>
#include<random>
#include<map>
#include<set>
#include<bitset>
#include<stack>
#include<unordered_map>
#include<unordered_set>
#include<utility>
#include<cassert>
#include<complex>
#include<numeric>
#include<array>
using namespace std;

//#define int long long
typedef long long ll;

typedef unsigned long long ul;
typedef unsigned int ui;
constexpr ll mod = 1000000007;
const ll INF = mod * mod;
typedef pair<int, int>P;
#define stop char nyaa;cin>>nyaa;
#define rep(i,n) for(int i=0;i<n;i++)
#define per(i,n) for(int i=n-1;i>=0;i--)
#define Rep(i,sta,n) for(int i=sta;i<n;i++)
#define rep1(i,n) for(int i=1;i<=n;i++)
#define per1(i,n) for(int i=n;i>=1;i--)
#define Rep1(i,sta,n) for(int i=sta;i<=n;i++)
#define all(v) (v).begin(),(v).end()
typedef pair<ll, ll> LP;
typedef long double ld;
typedef pair<ld, ld> LDP;
const ld eps = 1e-12;
const ld pi = acosl(-1.0);

ll mod_pow(ll x, ll n, ll m = mod) {
	if (n < 0) {
		ll res = mod_pow(x, -n, m);
		return mod_pow(res, m - 2, m);
	}
	if (abs(x) >= m)x %= m;
	if (x < 0)x += m;
	ll res = 1;
	while (n) {
		if (n & 1)res = res * x % m;
		x = x * x % m; n >>= 1;
	}
	return res;
}
struct modint {
	ll n;
	modint() :n(0) { ; }
	modint(ll m) :n(m) {
		if (n >= mod)n %= mod;
		else if (n < 0)n = (n % mod + mod) % mod;
	}
	operator int() { return n; }
};
bool operator==(modint a, modint b) { return a.n == b.n; }
modint operator+=(modint& a, modint b) { a.n += b.n; if (a.n >= mod)a.n -= mod; return a; }
modint operator-=(modint& a, modint b) { a.n -= b.n; if (a.n < 0)a.n += mod; return a; }
modint operator*=(modint& a, modint b) { a.n = ((ll)a.n * b.n) % mod; return a; }
modint operator+(modint a, modint b) { return a += b; }
modint operator-(modint a, modint b) { return a -= b; }
modint operator*(modint a, modint b) { return a *= b; }
modint operator^(modint a, ll n) {
	if (n == 0)return modint(1);
	modint res = (a * a) ^ (n / 2);
	if (n % 2)res = res * a;
	return res;
}

ll inv(ll a, ll p) {
	return (a == 1 ? 1 : (1 - p * inv(p % a, a)) / a + p);
}
modint operator/(modint a, modint b) { return a * modint(inv(b, mod)); }
modint operator/=(modint& a, modint b) { a = a / b; return a; }
const int max_n = 1 << 2;
modint fact[max_n], factinv[max_n];
void init_f() {
	fact[0] = modint(1);
	for (int i = 0; i < max_n - 1; i++) {
		fact[i + 1] = fact[i] * modint(i + 1);
	}
	factinv[max_n - 1] = modint(1) / fact[max_n - 1];
	for (int i = max_n - 2; i >= 0; i--) {
		factinv[i] = factinv[i + 1] * modint(i + 1);
	}
}
modint comb(int a, int b) {
	if (a < 0 || b < 0 || a < b)return 0;
	return fact[a] * factinv[b] * factinv[a - b];
}
modint combP(int a, int b) {
	if (a < 0 || b < 0 || a < b)return 0;
	return fact[a] * factinv[a - b];
}

void solve() {
	int n; cin >> n;
	vector<int> a(2 * n);
	rep(i, 2 * n)cin >> a[i];
	multiset<int> st;
	rep(i, n) {
		st.insert(a[n - 1 - i]);
		st.insert(a[n + i]);
		st.erase(st.begin());
	}
	ll ans = 0;
	for (int val : st)ans += val;
	cout << ans << "\n";
}

signed main() {
	ios::sync_with_stdio(false);
	cin.tie(0);
	//cout << fixed << setprecision(10);
	//init_f();
	//init();
	//expr();
	//int t; cin >> t;rep(i,t)
	solve();
	return 0;
}


// CODING BEAST
/*******************************************************************************************************************************************************/
#include<bits/stdc++.h>
using namespace std;
#define sum(a)     ( accumulate ((a).begin(), (a).end(), 0ll))
#define mine(a)    (*min_element((a).begin(), (a).end()))
#define maxe(a)    (*max_element((a).begin(), (a).end()))
#define mini(a)    ( min_element((a).begin(), (a).end()) - (a).begin())
#define maxi(a)    ( max_element((a).begin(), (a).end()) - (a).begin())
#define lowb(a, x) ( lower_bound((a).begin(), (a).end(), (x)) - (a).begin())
#define uppb(a, x) ( upper_bound((a).begin(), (a).end(), (x)) - (a).begin())
#define gcd(a, b) __gcd(a, b)
#define lcm(a, b) (a * b) / gcd(a, b)
#define Precision(a) cout << fixed << setprecision(a)
using ll = long long;
ll inf = 1e18;
using vb = vector<bool>; using vc = vector<char>; using vd = vector<double>; using vi = vector<int>; using vvi = vector<vi>;
using vll = vector<ll>; using vvll = vector<vll>; using pi = pair<int, int>; using pll = pair<ll, ll>;
#define endl "\n"
#define pb push_back
#define mp make_pair
#define rep(i,n) for(ll i = 0; i < n; i++)
#define repc(i,a,n) for(ll i=a;i<n;i++)
#define all(a) a.begin(),a.end()
#define pow2(x) (1ll<<(x))
#define Blazing_fast ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
#define trav(a,v) for(auto &a:v)
// int a[8] = { -1, -1, -1, 0, 0, 1, 1, 1};
// int b[8] = { -1, 0, 1, -1, 1, -1, 0, 1};
ll mod = 1e9;
// ll modx(ll a, ll b) {
//     return (((a % b) + b) % b);
// }
// inline ll power(ll x, ll y)
// {
//     ll temp;
//     if ( y == 0)
//         return 1;
//     temp = power(x, y / 2) ;
//     if (y % 2 == 0)
//         return (temp * temp) % mod ;
//     else
//         return (((x * temp) % mod) * temp) % mod ;
// }
// bool cmp(pll & a, pll & b) {
//     if (a.first == b.first) {
//         return (a.second < b.second);
//     }
//     else {
//         return (a.first > b.first);
//     }
// }

// ll fact(ll n)
// {
//     ll res = 1;
//     for (ll i = 2; i <= n; i++)
//         res = (res * i) % mod ;
//     return res;
// }
// ll inv(ll a) {
//     return power(a, mod - 2);
// }
// ll ncr(ll n, ll r)
// {
//     ll x = fact(n);
//     ll y = ((inv(fact(r)) % mod) * (inv(fact(n - r)))) % mod;
//     return ((x % mod) * y) % mod;
// }
// bool isprime(ll n) {
//     if (n <= 1) return false;
//     if (n <= 3) return true;
//     if ((n % 2 == 0) || (n % 3 == 0)) return false;
//     for (ll i = 5; i * i <= n; i = i + 6)
//         if ((n % i == 0) || (n % (i + 2) == 0)) return false;

//     return true;
// }
/*********************************************************************************************************************************************************/
//whenever given equality try to rewrite it
//matrix remember about even odd or modularity

void solve() {
    ll n, k;
    cin >> n >> k;
    ll ans = 0;
    for (ll i = 1; i <= n; i++) {
        ll p = i * 100;
        for (ll j = 1; j <= k; j++) {
            ans += p + j;
        }
    }
    cout << ans << endl;
}

signed main() {
    Blazing_fast
    ll t = 1;
    // ll t; cin >> t;
    while (t--) {
        solve();
    }
}

#include <bits/stdc++.h>
#define sz(x) (int)(x).size()
#define all(x) (x).begin(), (x).end()
using namespace std;

typedef long long ll;
typedef unsigned long long llu;
typedef pair<int, int> pii;
typedef pair<double, double> pdd;
typedef pair<int, pii> piii;
typedef pair<ll, ll> pll;
typedef pair<ll, int> pli;
typedef pair<int, ll> pil;
typedef pair<string, int> psi;
typedef pair<char, int> pci;
typedef pair<int, char> pic;
const int MOD = 998244353;
const long double PI = 3.141592653589793238462643383279502884197;

ll fac[51] = {1}, inv[1] = {1};
ll gcd(ll a,ll b){return b?gcd(b,a%b):a;}
ll mp(ll a,ll b){ll ret=1;while(b){if(b&1)ret=ret*a%MOD;a=a*a%MOD;b>>=1;}return ret;}
ll cmb(ll r, ll c) {return (c>r||c<0) ? 0:fac[r] * inv[c] % MOD * inv[r - c] % MOD;}

int dp[3001][3001];
int go(int n, int k) {
    if (k > n) return 0;
    if (k == 0) return n == 0;
    if (dp[n][k] != -1) return dp[n][k];

    ll ret = 0;
    ret += go(n - 1, k - 1);
    ret += go(n, k * 2);
    return dp[n][k] = ret % MOD;
}

int main() {
    memset(dp, -1, sizeof(dp));
    int n, k;
    scanf("%d %d", &n, &k);
    printf("%d", go(n, k));
}

// author: rdd6584


#include <bits/stdc++.h>

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

using namespace std;

typedef pair<int, int> pii;
typedef vector<int> vi;
typedef vector<pii> vpi;
typedef vector<vi> vvi;
typedef long long i64;
typedef vector<i64> vi64;
typedef vector<vi64> vvi64;
typedef pair<i64, i64> pi64;
typedef double ld;

template<class T> bool uin(T &a, T b) { return a > b ? (a = b, true) : false; }
template<class T> bool uax(T &a, T b) { return a < b ? (a = b, true) : false; }

const int maxn = 101, maxw = 101;
const i64 P = 998244353;
int a[maxn];
i64 dp[2][maxn][2 * maxn * maxw + 1];
i64 *pdp[2][maxn];
i64 fact[maxn];

void add(i64 &x, i64 y) {
    x += y;
    if (x >= P) x -= P;
}

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

    fact[0] = 1;
    forn(i, maxn - 1) fact[i + 1] = fact[i] * (i + 1) % P;

    forn(z, 2) forn(i, maxn) pdp[z][i] = dp[z][i] + maxn * maxw;

    int n;
    cin >> n;
    pdp[0][0][0] = 1;
    int S = 0;
    forn(i, n) {
        int x;
        cin >> x;
        forn(j, i + 1) fore(w, -S, S) {
            if (!pdp[0][j][w]) continue;
            add(pdp[1][j][w - x], pdp[0][j][w]);
            add(pdp[1][j + 1][w + x], pdp[0][j][w]);
        }
        S += x;
        forn(j, i + 2) fore(w, -S, S) {
            pdp[0][j][w] = pdp[1][j][w];
            pdp[1][j][w] = 0;
        }
    }

    i64 ans = 0;
    forn(j, n + 1) (ans += pdp[0][j][0] * fact[j] % P * fact[n - j]) %= P;
    cout << ans << '\n';

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

#include <cstdlib>
#include <cmath>
#include <climits>
#include <cfloat>
#include <map>
#include <utility>
#include <set>
#include <iostream>
#include <memory>
#include <string>
#include <vector>
#include <algorithm>
#include <functional>
#include <sstream>
#include <deque>
#include <complex>
#include <stack>
#include <queue>
#include <cstdio>
#include <cctype>
#include <cstring>
#include <ctime>
#include <iterator>
#include <bitset>
#include <numeric>
#include <list>
#include <iomanip>
#include <cassert>

#if __cplusplus >= 201103L
#include <array>
#include <tuple>
#include <initializer_list>
#include <unordered_set>
#include <unordered_map>
#include <forward_list>

using namespace std;

#define cauto const auto&
#define ALL(v) begin(v),end(v)
#else
#define ALL(v) (v).begin(),(v).end()
#endif

namespace{
typedef long long LL;
typedef pair<int,int> pii;
typedef pair<LL,LL> pll;

typedef vector<int> vint;
typedef vector<vector<int> > vvint;
typedef vector<long long> vll, vLL;
typedef vector<vector<long long> > vvll, vvLL;

#define VV(T) vector<vector< T > >

template <class T>
void initvv(vector<vector<T> > &v, int a, int b, const T &t = T()){
	v.assign(a, vector<T>(b, t));
}
template <class T> inline T &chmin(T &x, const T &y){ return x = min(x, y); }
template <class T> inline T &chmax(T &x, const T &y){ return x = max(x, y); }
template <class F, class T>
void convert(const F &f, T &t){
	stringstream ss;
	ss << f;
	ss >> t;
}
template <class Con>
string concat(const Con &c, const string &spr){
	stringstream ss;
	typename Con::const_iterator it = c.begin(), en = c.end();
	bool fst = true;
	for(; it != en; ++it){
		if(!fst){ ss << spr; }
		fst = false;
		ss << *it;
	}
	return ss.str();
}

template <class Con, class Fun>
vector<typename Con::value_type> cfilter(const Con &c, Fun f) {
	vector<typename Con::value_type> ret;
	typename Con::const_iterator it = c.begin(), en = c.end();
	for(; it != en; ++it){
		if(f(*it)){
			ret.emplace_back(*it);
		}
	}
	return ret;
}
#if __cplusplus >= 201103L
template <class Con, class Fun>
auto cmap(const Con &c, Fun f) -> vector<decltype(f(*c.begin()))> {
	vector<decltype(f(*c.begin()))> ret;
	ret.reserve(c.size());
	for(const auto &x: c){
		ret.emplace_back(f(x));
	}
	return ret;
}
#endif

#if __cplusplus >= 201402L
#define lambda(e) ([&](const auto &_){ return (e); })
#define lambda2(e) ([&](const auto &_a, const auto &_b){ return (e); })
#endif

#define REP(i,n) for(int i=0;i<int(n);++i)
#define RALL(v) (v).rbegin(),(v).rend()
#define tget(t,i) get<i>(t)

#define MOD 1000000007LL
#define EPS 1e-8

void mainmain(){
	using D = double;
	using C = complex<D>;
	int n;
	cin >> n;
	D x0, y0, xh, yh;
	cin >> x0 >> y0 >> xh >> yh;

	C p0(x0, y0), ph(xh, yh);
	D pi = acos(D(-1));
	D dir0 = arg(ph - p0) - pi / 2 + pi / n;
	D dir = dir0;
	C p = p0;
	for(int i = 0; i < n; i += 2){
		p += polar(D(1), dir);
		dir += 2 * pi / n;
	}
	D u = abs(ph - p0) / abs(p - p0);
	C ans = p0 + polar(u, dir0);
	cout << real(ans) << ' ' << imag(ans) << '\n';
}

}
int main() {
	ios::sync_with_stdio(false); cin.tie(0);
	cout << fixed << setprecision(10);
	cerr << fixed << setprecision(4);
	mainmain();
}


#include <iostream>
#include <cmath>
#include <string>
#include <algorithm>
#include <vector>
#include <queue>
#include <stack>
#include <tuple>
#include <utility>
#include <functional>
#include <set>
#include <map>
#include <bitset>
#include <list>
#include<iomanip>

using namespace std;
using ll = long long;
using ULL = unsigned long long;
using pll = std::pair<ll, ll>;
using vi = std::vector<int>;
using vl = std::vector<ll>;
using vb = std::vector<bool>;
using db = double;
using vdb = std::vector<db>;
using qlg= std::priority_queue<ll, vl, std::greater<ll> > ; //ascending
using qll= std::priority_queue<ll, vl, std::less<ll> > ; // descending
using qdg= std::priority_queue<db, vdb, std::greater<db> > ; //ascending
using qdl= std::priority_queue<db, vdb, std::less<db> > ; // descending
using tlll = tuple<ll, ll, ll> ;
template<class T>
using vv = std::vector<std::vector<T> >;

#define REPL(i, n) for (ll i = 0; i < (ll)(n); i++)
#define FORL(i, a, b) for (ll i = (ll)(a); i < (ll)(b); i++)
#define REP(i, n) FORL(i, 0, n)

#define MREP(i, n) for (ll i= (ll)(n)-1; i>=0; i-- )
#define MFOR(i, a, b) for (ll i = (ll)(b)-1; i >= (ll)(a); i--)
#define rrep(i, n) for (int i = (int)(n)-1; i >= 0; i--)
#define rreps(i, a, b) for (int i = (int)(b)-1; i >= (int)(a); i--)
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define bit(n) (1LL << (n))
#define INF pow(10, 10)

int main(void)
{
    ll S, P, N, Q;

    cin >>N;
    vector<pll> Edges(N-1);
    vv<ll> Graph(N);
    vl adds(N, 0);
    vl pars(N, -1);
    vl sums(N, 0);

    REP(i, N-1)
    {
        ll a, b;
        cin >> a >> b;
        a --; b --;
        Edges[i] = {a, b};
        Graph[a].push_back(b);
        Graph[b].push_back(a);
    }

    cin >> Q;
    vv<ll> Tasks(Q, vl(3) );
    REP(i, Q)
    {
        ll t, e, x;
        cin >> Tasks[i][0] >> Tasks[i][1] >> Tasks[i][2];
        Tasks[i][1] --;
    }

    queue<ll> Que;
    ll Parent_Tree = 0;
    Que.push(Parent_Tree); // 0を頂点とする木
    vb used(N);
    while( !Que.empty() )
    {
        ll from = Que.front(); Que.pop();
        used[from] = true;
        REP(i, Graph[from].size() )
        {
            ll to = Graph[from][i];
            if(used[to]) continue;
            pars[to] = from;
            Que.push(to);
        }
    }

    REP(i, N)
    {
        used[i] = false;
    }

    REP(i, Q)
    {
        if(Tasks[i][0]==1)
        {
            ll v = Edges[ Tasks[i][1] ].first;
            ll through = Edges[ Tasks[i][1] ].second;

            if(pars[v]==through)
            {
                adds[v] += Tasks[i][2];
            }
            else
            {
                adds[Parent_Tree] += Tasks[i][2];
                adds[through] -= Tasks[i][2];
            }
        }
        else
        {
            ll through = Edges[ Tasks[i][1] ].first;
            ll v = Edges[ Tasks[i][1] ].second;
            if(pars[v]==through)
            {
                adds[v] += Tasks[i][2];
            }
            else
            {
                adds[Parent_Tree] += Tasks[i][2];
                adds[through] -= Tasks[i][2];
            }
        }
    }

    Que.push(Parent_Tree);
    while( !Que.empty() )
    {
        ll from = Que.front(); Que.pop();
        used[from] = true;
        sums[from] += adds[from];
        REP(i, Graph[from].size() )
        {
            ll to = Graph[from][i];
            // if(used[to] == true) continue;
            if(pars[to] != from) continue;
            adds[to] += sums[from];
            Que.push(to);
        }

    }

    REP(i, N)
    {
        cout << sums[i] << endl;
    }

    return 0;
}

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

using namespace std;

int n;
vector <int> num, used, tin, tout, add, dist, num1;
vector <vector <int> > graph, up;
vector <pair <int, int> > smth;
map <int, int> kek;
int timer = 0, res = 0;
const int l = 27;

int dfs(int v, int par) {
    used[v] = 1;
    int size_of_now = 1;
    timer++;
    tin[v] = timer;
    dist[v] = dist[par] + num[v];
    up[v][0] = par;
    for (int i = 1; i < l; i++) up[v][i] = up[up[v][i - 1]][i - 1];
    for (auto to : graph[v]) {
        if (!used[to]) size_of_now += dfs(to, v);
    }
    timer++;
    tout[v] = timer;
    smth.push_back({v, size_of_now});
    kek[v] = n - (int)smth.size();
    return size_of_now;
}

bool check(int a, int b) {
    return (tin[a] <= tin[b] && tout[a] >= tout[b]);
}

int lca(int a, int b) {
    if (check(a, b)) return a;
    if (check(b, a)) return b;
    for (int i = l - 1; i >= 0; i--) {
        if (!check(up[a][i], b)) a = up[a][i];
    }
    return up[a][0];
}

void push(int v) {
    add[v * 2] += add[v];
    add[v * 2 + 1] += add[v];
    add[v] = 0;
}

void upd(int v, int tl, int tr, int l, int r, int k) {
    if (r <= tl || l >= tr) return;
    else if (l <= tl && r >= tr) add[v] += k;
    else {
        int tm = (tl + tr) / 2;
        upd(v * 2, tl, tm, l, r, k);
        upd(v * 2 + 1, tm, tr, l, r, k);
    }
}

int get(int v, int tl, int tr, int pos) {
    if (tl == tr - 1) {
        return add[v];
    }
    else {
        int tm = (tl + tr) / 2;
        if (pos < tm) {
            return add[v] + get(v * 2, tl, tm, pos);
        }
        else {
            return add[v] + get(v * 2 + 1, tm, tr, pos);
        }
    }
}

void upd2(int v, int tl, int tr, int pos) {
    if (tl + 1 == tr) {
        add[v] = 0;
        return;
    }
    else {
        push(v);
        int tm = (tl + tr) / 2;
        if (pos < tm) upd2(v * 2, tl, tm, pos);
        else upd2(v * 2 + 1, tm, tr, pos);
    }
}
int32_t main() {
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);
    cin >> n;
    num.resize(n);
    used.resize(n);
    tin.resize(n);
    tout.resize(n);
    graph.resize(n);
    up.resize(n);
    add.resize(4 * n);
    dist.resize(n);
    num1.resize(n);
    for (int i = 0; i < n; i++) {
        up[i] = vector <int> (l, 0);
    }
    vector <pair <int, int> > edges;
    for (int i = 0; i < n - 1; i++) {
        int a, b;
        cin >> a >> b;
        a--;
        b--;
        edges.push_back({a, b});
        graph[a].push_back(b);
        graph[b].push_back(a);
    }
    dfs(0, 0);
    reverse(smth.begin(), smth.end());
    int sum = 0;
    int q;
    cin >> q;
    while (q--) {
        int req;
        cin >> req;
        int a, b;
        if (req == 1) {
            int x;
            cin >> x;
            x--;
            a = edges[x].first;
            b = edges[x].second;
        }
        else {
            int x;
            cin >> x;
            x--;
            a = edges[x].first;
            b = edges[x].second;
            swap(b, a);
        }
        int delta;
        cin >> delta;
        if (up[a][0] == b) {
            int pos = kek[a];
            int len = smth[pos].second;
            upd(1, 0, n, pos, pos + len, delta);
        }
        else {
            sum += delta;
            int pos = kek[b];
            int len = smth[pos].second;
            upd(1, 0, n, pos, pos + len, -delta);
        }
    }
    for (int i = 0; i < n; i++) {
        int res = get(1, 0, n, kek[i]) + sum;
        cout << res << "\n";
    }
    return 0;
}


#include <algorithm>
#include <bitset>
#include <cassert>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <vector>
#define m_p make_pair
#define sz(x) (int)x.size()
#define line cerr<<"--------------------\n";
#define see(x) cerr<<x<<" "
#define seeln(x) cerr<<x<<endl
#define out(x) cerr<<#x<<" = "<<x<<" "
#define outln(x) cerr<<#x<<" = "<<x<<endl
#define outarr(x,l,r) cerr<<#x"["<<l<<"-"<<r<<"] = "; for (int _i=l;_i<=r;++_i) cerr<<x[_i]<<" ";cerr<<endl;
using namespace std;
typedef long long ll;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
#define gc() getchar()
//char buf[1<<23],*p1=buf,*p2=buf;
//#define gc() (p1==p2&&(p2=(p1=buf)+fread(buf,1,1<<21,stdin),p1==p2)?EOF:*p1++)
template <class T> void read(T &x)
{
    x=0; char c=gc(); int flag=0;
    while (c<'0'||c>'9') flag|=(c=='-'),c=gc();
    while (c>='0'&&c<='9') x=(x<<3)+(x<<1)+(c^48),c=gc();
    if (flag) x=-x;
}
template <class T> inline T _max(T a,T b){return a>b ? a : b;}
template <class T> inline T _min(T a,T b){return a<b ? a : b;}
template <class T> inline bool checkmax(T &a,T b){return b>a ? a=b,1 : 0;}
template <class T> inline bool checkmin(T &a,T b){return b<a ? a=b,1 : 0;}
int n,k,mod;
int Add(int x,int y){x+=y; return x>=mod ? x-mod : x;}
int Sub(int x,int y){x-=y; return x<0 ? x+mod : x;}
int Mul(int x,int y){return (ll)x*y%mod;}
void add(int &x,int y){x=Add(x,y);}
void sub(int &x,int y){x=Sub(x,y);}
void mul(int &x,int y){x=Mul(x,y);}
int dp[102][128000];
void init()
{
	read(n); read(k); read(mod);
	dp[0][0]=1;
	for (int i=1;i<=n;++i)
	{
		int tmp=_min(i,50);
		for (int r=0;r<=k;++r)
		{
			for (int j=r*i;j<=tmp*(tmp+1)/2*k;++j)
			{
				add(dp[i][j],dp[i-1][j-r*i]);
			}
		}
	}
}

int calc(int x)
{
	int tmp=_min(x-1,n-x);
	int ans=0;
	for (int i=0;i<=tmp*(tmp+1)/2*k;++i)
	{
		if (i) add(ans,Mul(Mul(dp[x-1][i],dp[n-x][i]),k+1));
		else add(ans,k);
	}
	return ans;
}

void solve()
{
	for (int i=1;i<=n;++i)
	{
		printf("%d\n",calc(i));
	}
}

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

#include <iostream>
#include <vector>

using namespace std;

int main(){
    int N, K, M; cin >> N >> K >> M;
    vector<vector<int>> dp;
    dp.push_back(vector<int>(1, 1));
    for(int i=1;i<=N;i++){
        int n = dp.back().size();
        int m = min(n + i*K, 122501);
        vector<int> v(m, 0);
        for(int j=0;j<n;j++){
            for(int k=j;k<=min(m-1, j+K*i);k+=i) v[k] = (v[k] + dp.back()[j]) % M;
        }
        dp.push_back(v);
    }
    for(int i=1;i<=N;i++){
        const auto& a = dp[i-1];
        const auto& b = dp[N-i];
        const int m = min(a.size(), b.size());
        long long res = 0;
        for(int j=0;j<m;j++){
            res += (long long)a[j] * b[j];
            res %= M;
        }
        res = (res * (K+1)) % M;
        res = (res + M - 1) % M;
        cout << res << endl;
    }
}


#include <iostream>
#include<vector>
#include<algorithm>
#include<string>
#include<map>
#include<set>
#include<stack>
#include<queue>
#include<math.h>
using namespace std;
typedef long long ll;
#define int long long
#define double long double
typedef vector<int> VI;
typedef pair<int, int> pii;
typedef vector<pii> VP;
typedef vector<string> VS;
typedef priority_queue<int> PQ;
template<class T>bool chmax(T &a, const T &b) { if (a < b) { a = b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b < a) { a = b; return 1; } return 0; }
#define fore(i,a) for(auto &i:a)
#define REP(i,n) for(int i=0;i<n;i++)
#define eREP(i,n) for(int i=0;i<=n;i++)
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define eFOR(i,a,b) for(int i=(a);i<=(b);++i)
#define SORT(c) sort((c).begin(),(c).end())
#define rSORT(c) sort((c).rbegin(),(c).rend())
#define LB(x,a) lower_bound((x).begin(),(x).end(),(a))
#define UB(x,a) upper_bound((x).begin(),(x).end(),(a))
#define PRINT(a) printf("%.15Lf\n",a);
#define YESNO(a) cout << (a ? "YES" : "NO") << endl
#define YesNo(a) cout << (a ? "Yes" : "No") << endl
#define yesno(a) cout << (a ? "yes" : "no") << endl
#define INF 1000000000
#define LLINF 9223372036854775807
#define mod 1000000007
#define eps 1e-12
//priority_queue<int,vector<int>, greater<int> > q2;

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

	bool ok = 1;
	int A, B, C, X, Y;
	string S, T;

	int D;
	cin >> A >> B >> C >> D;

	int ans = -INF;

	eFOR(x, A, B) {
		eFOR(y, C, D) {
			chmax(ans, x - y);
		}
	}

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

// D - increment of coins
#include <bits/stdc++.h>
using namespace std;

#define N 100
double dp[N][N][N];
bool vis[N][N][N];

double f(int g, int s, int b){ // g=gold, s=silver, b=bronze
	if(g==N || s==N || b==N) return 1;
	if(vis[g][s][b]) return dp[g][s][b] + 1;
	vis[g][s][b] = true;
	int t = g + s + b;
	dp[g][s][b] = f(g+1,s,b)*g/t + f(g,s+1,b)*s/t + f(g,s,b+1)*b/t;
	return dp[g][s][b] + 1;
}

int main(){
	int G, S, B; cin>>G>>S>>B;
	cout<<setprecision(9)<<fixed<< f(G, S, B) - 1 <<endl;
}


#include<bits/stdc++.h>
using namespace std;
int main()
{
    long long  n,i;
   cin>>n;
 long long a[n];
   for(i=0;i<n;i++){cin>>a[i];}
   unsigned long long int s=0,t=0;
   sort(a,a+n);
   for(i=1;i<n;i++)
   {
       t=t+(a[i]-a[i-1])*i;
       s+=t;
   }
   cout<<s;
}

#include "bits/stdc++.h"
#define int long long
#define endl '\n'
using namespace std;

typedef long long ll;
typedef long double ld;
#define db(x) cerr << #x << ": " << x << '\n';
#define read(a) int a; cin >> a;
#define reads(s) string s; cin >> s;
#define readb(a, b) int a, b; cin >> a >> b;
#define readc(a, b, c) int a, b, c; cin >> a >> b >> c;
#define readarr(a, n) int a[(n) + 1] = {}; FOR(i, 1, (n)) {cin >> a[i];}
#define readmat(a, n, m) int a[n + 1][m + 1] = {}; FOR(i, 1, n) {FOR(j, 1, m) cin >> a[i][j];}

#define print(a) cout << a << endl;
#define printarr(a, n) FOR (i, 1, n) cout << a[i] << " "; cout << endl;
#define printv(v) for (int i: v) cout << i << " "; cout << endl;
#define printmat(a, n, m) FOR (i, 1, n) {FOR (j, 1, m) cout << a[i][j] << " "; cout << endl;}
#define all(v) v.begin(), v.end()
#define sz(v) (int)(v.size())
#define rz(v, n) v.resize((n) + 1);
#define pb push_back
#define fi first
#define se second
#define vi vector <int>
#define pi pair <int, int>
#define vpi vector <pi>
#define vvi vector <vi>
#define setprec cout << fixed << showpoint << setprecision(20);
#define FOR(i, a, b) for (int i = (a); i <= (b); i++)
#define FORD(i, a, b) for (int i = (a); i >= (b); i--)
const ll inf = 1e18;
const ll mod = 1e9 + 7;
const ll N = 2e5 + 1;
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());

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

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

	read(n);
	readarr(a, n);
	sort(a + 1, a + n + 1);
	int pre[n + 1] = {}, sum = 0;
	FOR (i, 1, n)
	{
	    pre[i] = pre[i - 1] + a[i];
	    sum += i*a[i] - pre[i];
	}

    print(sum);
}


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

int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  long N;
  cin >> N;
  int x = (int)log10(N) + 1;
  long long res = 0;
  if (x >= 4) {
    int y = x - 3;
    rep(i, y) {
      int z = i + 3;
      if (i < y - 1)
        res += ((long)pow(10, z) * 9) * ((int)z / 3);
      else
        res += (N - (long)pow(10, z) + 1) * ((int)z / 3);
    }
  }
  cout << res << endl;
}


#include <bits/stdc++.h>

using namespace std;
using ll = long long;
using Graph = vector<vector<int>>;
using WGraph = vector<vector<pair<int, ll>>>;

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

constexpr int INF = 1e9;
constexpr long long LINF = 1e18;
constexpr double EPS = 1e-10;
constexpr double PI = M_PI;

void solve() {
    int N;
    cin >> N;
    vector<pair<int, int>> A(1<<N);
    for (int i=0; i<(1<<N); ++i) {
        cin >> A[i].first;
        A[i].second = i+1;
    }

    vector<pair<int, int>> nA(1<<N);
    for (int i=0; i<N-1; ++i) {
        for (int j=0; j<(1<<(N-i-1)); ++j) nA[j] = max(A[2*j], A[2*j+1]);
        A.swap(nA);
    }
    cout << min(A[0], A[1]).second << '\n';
}

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

    solve();

    return 0;
}


#include<cstdio>

bool vis[15];
int a[15][15], ans, n, k;

void dfs(int now, int tot, int cs) {
	vis[now] = 1;
//	printf("%d %d %d\n", now, tot, cs);
	if(cs == n + 1) {
		if(tot == k) {
			ans ++;
		} return;
	}
	if(cs == n) dfs(1, tot + a[now][1], cs + 1);
	else {
		for(int i = 1; i <= n; i ++) {
			if(i == now) continue;
			if(vis[i]) continue;
			vis[i] = 1;
			dfs(i, tot + a[now][i], cs + 1);
			vis[i] = 0;
		} vis[now] = 0;
	}
}

int main() {
	scanf("%d %d", &n, &k);
	for(int i = 1; i <= n; i ++) {
		for(int j = 1; j <= n; j ++) {
			scanf("%d", &a[i][j]);
		}
	} dfs(1, 0, 1);
	printf("%d", ans);
}

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

#define FIO                     ios::sync_with_stdio(false); cin.tie(nullptr)
#define TC(t)                   int t; cin >> t; for(int i = 1; i <= t; i++)
#define deb(x)                  cerr << #x << " = " << x << endl
#define deb2(x, y)              cerr << #x << " = " << x << ", " << #y << " = " << y << endl
#define f0(i, a, n)             for(i = a; i < n; i++)
#define f1(i, a, n)             for(i = a; i <= n; i++)
#define ini(x, y)               memset(x, y, sizeof(x))
#define all(x)                  x.begin(), x.end()
#define sz(x)                   x.size()
#define ll                      long long int
#define pb                      push_back
#define ppb                     pop_back
#define mp                      make_pair
#define ff                      first
#define ss                      second
#define M                       1000000007
#define endl                    '\n'
#define bits(x)                 __builtin_popcountll(x)
#define zrbits(x)               __builtin_ctzll(x)
#define vi                      vector<int>
#define pii                     pair<int,int>
#define vpii                    vector<pii>
#define ordered_set             tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update>
#define multi_ordered_set       tree<int, null_type, less_equal<int>, rb_tree_tag, tree_order_statistics_node_update>

const int N = 1e5 + 1;
const int MX = 1e9;
const ll INF = 1e18;

using namespace std;
using namespace __gnu_pbds;

inline ll uceil(ll a,ll b) {return (a % b ? a / b + 1 : a / b);}
inline ll mod(ll x) {return ( (x % M + M) % M );}

template<typename T> ostream& operator<<(ostream& os, const vector<T>& v) {for(auto& x : v) os << x << " "; return os << '\n';}
template<typename... T> void in(T&... args) {((cin >> args), ...);}
template<typename... T> void out(T&&... args) {((cout << args << endl), ...);}
template<typename... T> void out2(T&&... args) {((cout << args << " "), ...);}

void solve() {
        ll n, k, i, j;
        cin >> n >> k;

        vector<vector<ll>> a(n, vector<ll>(n));
        f0(i, 0, n) {
                f0(j, 0, n) {
                        cin >> a[i][j];
                }
        }

        vector<ll> v(n);
        f0(i, 1, n) {
                v[i] = i;
        }

        ll ans = 0;
        ll sum = 0;
        sum += a[0][v[0]];
        f0(i, 0, n-1) {
                sum += a[v[i]][v[i+1]];
        }
        sum += a[v[i]][0];
        if(sum == k) ans++;
        while(next_permutation(all(v))) {
                sum = 0;
                sum += a[0][v[0]];
                f0(i, 0, n-1) {
                        sum += a[v[i]][v[i+1]];
                }
                sum += a[v[i]][0];
                if(sum == k) ans++;
        }
        out(ans/2);
}

int main () {
        FIO;
        // TC(t)
        solve();
        return 0;
}


#include<bits/stdc++.h>
using namespace std;
#define MAXN 100005
#define lowbit(x) (x&-x)
#define reg register
#define mkpr make_pair
#define fir first
#define sec second
typedef long long LL;
typedef unsigned long long uLL;
const LL INF=0x7f7f7f7f7f7f7f7f;
const int mo=998244353;
const int zero=500;
const LL jzm=2333;
const int iv2=499122177;
const double Pi=acos(-1.0);
typedef pair<int,int> pii;
const double PI=acos(-1.0);
template<typename _T>
_T Fabs(_T x){return x<0?-x:x;}
template<typename _T>
void read(_T &x){
	_T f=1;x=0;char s=getchar();
	while(s>'9'||s<'0'){if(s=='-')f=-1;s=getchar();}
	while('0'<=s&&s<='9'){x=(x<<3)+(x<<1)+(s^48);s=getchar();}
	x*=f;
}
template<typename _T>
void print(_T x){if(x<0){x=(~x)+1;putchar('-');}if(x>9)print(x/10);putchar(x%10+'0');}
int t;LL X,Y,P,Q,x[1005],y[1005],d[1005];
LL exgcd(LL a,LL b,LL &x,LL &y){
	if(!b){x=1;y=0;return a;}
	LL d=exgcd(b,a%b,y,x);y-=x*(a/b);return d;
}
signed main(){
	read(t);
	while(t--){
		read(X);read(Y);read(P);read(Q);
		LL A=P+Q,B=2ll*X+2ll*Y,res=INF;
		for(LL i=-Q;i<=Y;i++)d[i+zero]=exgcd(A,B,x[i+zero],y[i+zero]);
		for(LL i=P;i<P+Q;i++)
			for(LL j=X;j<X+Y;j++){
				LL t=j-i,d1=d[t+zero-X+P];if(t%d1!=0)continue;
				LL ax=t/d1*x[t+zero-X+P],ay=i/d1*y[t+zero-X+P],a1=B/d1,b1=A/d1,k;
				if(ax<0)k=(a1-ax)/a1,ax+=k*a1,ay-=k*b1;
				if(ax>=0)k=(ax-1)/a1,ax-=k*a1,ay+=k*b1;
				if(ay>0)k=(ay-1)/b1,ax+=k*a1,ay-=k*b1;
				res=min(ax%a1*A+i,res);
			}
		for(LL i=-Q;i<=Y;i++)d[i+zero]=x[i+zero]=y[i+zero]=0;
		if(res>INF-1)puts("infinity");else printf("%lld\n",res);
	}
	return 0;
}
/*
[(2X+2Y)n+X,(2X+2Y)n+X+Y)
[(P+Q)m+P,(P+Q)(m+1))
(X-P)<=(P+Q)m%(2X+2Y)<(X+Y-P)
(P+Q)x+(2X+2Y)y=+j-i
*/

#include<bits/stdc++.h>
using namespace std;
//#define int long long
#define REP(i,m,n) for(int i=(m);i<(n);i++)
#define rep(i,n) REP(i,0,n)
#define pb push_back
#define all(a) a.begin(),a.end()
#define rall(c) (c).rbegin(),(c).rend()
#define mp make_pair
#define endl '\n'
#define vec vector<ll>
#define mat vector<vector<ll> >
#define fi first
#define se second
typedef long long ll;
typedef unsigned long long ull;
typedef pair<ll,ll> pll;
typedef long double ld;
typedef complex<double> comp;
const ll INF=1e9+7;
const ll inf=INF*INF;
const ll MOD=1e9+7;
const ll mod=MOD;
const int MAX=200010;

int main(){
    ll n;cin>>n;
    map<ll,ll>ma;
    ll b=1LL;
    ll cnt=0;
    while(b*3LL<inf){
        b*=3LL;
        cnt++;
        ma[b]=cnt;
    }
    ll c=1LL;
    bool f=0;
    cnt=0;
    pll ans;
    while(c*5LL<=n){
        cnt++;
        c*=5LL;
        if(ma.find(n-c)!=ma.end()){
            ans.fi=ma[n-c];
            ans.se=cnt;
            f=1;
        }
        if(f)break;
    }
    if(f){
        cout<<ans.fi<<' '<<ans.se<<endl;
    }else{
        cout<<-1<<endl;
    }
}


#include <bits/stdc++.h>

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

using namespace std;

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

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

  ll N, M;
  scanf("%lld %lld", &N, &M);

  vector<ll> alist;
  for (ll i = 0; i < N; i++) {
    ll v;
    scanf("%lld", &v);
    alist.emplace_back(v);
  }

  mll m;

  ll ans;

  ll mex = 0;
  for (ll i = 0; i < M; i++) {
    ll v = alist[i];
    m[v]++;

    if (v == mex) {
      mex = v + 1;
      for (;;) {
        if (m[mex] == 0) {
          break;
        }
        mex++;
      }
    }
  }

  ans = mex;

  ll left = 0;
  ll right = M - 1;

  for (;;) {
    if (right >= N - 1) {
      break;
    }

    ll lost_value = alist[left];
    ll new_value = alist[right + 1];

    // cout << "lost_value:" << (lost_value) << ",new_value:" << (new_value) << endl;

    m[lost_value]--;
    m[new_value]++;

    ll new_mex = mex;

    if (lost_value == new_value) {
      // NOP
    } else if (m[lost_value] == 0 && lost_value < mex) {
      new_mex = lost_value;
    } else if (new_value == mex) {
      new_mex = new_value + 1;
      for (;;) {
        if (m[new_mex] == 0) {
          break;
        }
        new_mex++;
      }
    }

    left++;
    right++;

    mex = new_mex;

    chmin(ans, new_mex);
  }

  cout << ans << endl;
}

//clear adj and visited vector declared globally after each test case
//check for long long overflow
//Mod wale question mein last mein if dalo ie. Ans<0 then ans+=mod;
//Incase of close mle change language to c++17 or c++14
/**#pragma GCC target ("avx2")
#pragma GCC optimization ("O3")
#pragma GCC optimization ("unroll-loops”)**/
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#define int long long
#define IOS std::ios::sync_with_stdio(false); cin.tie(NULL);cout.tie(NULL);cout.precision(dbl::max_digits10);
#define pb push_back
#define mod 1000000007ll //998244353ll
#define lld long double
#define mii map<int, int>
#define pii pair<int, int>
#define ff first
#define ss second
#define all(x) (x).begin(), (x).end()
#define rep(i,x,y) for(int i=x; i<y; i++)
#define fill(a,b) memset(a, b, sizeof(a))
#define vi vector<int>
#define setbits(x) __builtin_popcountll(x)
#define print2d(dp,n,m) for(int i=0;i<=n;i++){for(int j=0;j<=m;j++)cout<<dp[i][j]<<" ";cout<<"\n";}
typedef std::numeric_limits< double > dbl;
using namespace __gnu_pbds;
using namespace std;
typedef tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update> indexed_set;
//member functions :
//1. order_of_key(k) : number of elements strictly lesser than k
//2. find_by_order(k) : k-th element in the set
const long long N=200005, INF=2000000000000000000;
lld pi=3.1415926535897932;
int lcm(int a, int b)
{
    int g=__gcd(a, b);
    return a/g*b;
}
int power(int a, int b, int p)
    {
        if(a==0)
        return 0;
        int res=1;
        a%=p;
        while(b>0)
        {
            if(b&1)
            res=(res*a)%p;
            b>>=1;
            a=(a*a)%p;
        }
        return res;
    }

int32_t main()
{
    IOS;
    int n;
    cin>>n;
    string s;
    cin>>s;
    int ar[n+1];
    rep(i,0,n+1)
    cin>>ar[i];
    int mi=1e6;
    rep(i,1,n+1)
    mi=min(mi, abs(ar[i]-ar[i-1]));
    cout<<mi<<"\n";
    int b[mi][n+1];
    int sub=0;
    rep(i,0,n+1)
    {
        int base=ar[i]/mi;
        int lim=ar[i]%mi;
        rep(j,0,lim)
        b[j][i]=base+1;
        rep(j,lim,mi)
        b[j][i]=base;
    }
    print2d(b, mi-1, n);
}


#include <bits/stdc++.h>
//#include <chrono>
#pragma GCC optimize("O3")
using namespace std;
#define reps(i,s,n) for(int i = s; i < n; i++)
#define rep(i,n) reps(i,0,n)
#define Rreps(i,n,e) for(int i = n - 1; i >= e; --i)
#define Rrep(i,n) Rreps(i,n,0)
#define ALL(a) a.begin(), a.end()

using ll = long long;
using vec = vector<ll>;
using mat = vector<vec>;

ll N,M,H,W,Q,K,A,B;
string S;
using P = pair<ll, ll>;
const ll INF = (1LL<<60);

template<class T> bool chmin(T &a, const T b){
    if(a > b) {a = b; return true;}
    else return false;
}
template<class T> bool chmax(T &a, const T b){
    if(a < b) {a = b; return true;}
    else return false;
}
template<class T> void my_printv(std::vector<T> v,bool endline = true){
    if(!v.empty()){
        for(std::size_t i{}; i<v.size()-1; ++i) std::cout<<v[i]<<" ";
        std::cout<<v.back();
    }
    if(endline) std::cout<<std::endl;
}

vec prime;

int main(){
    cin.tie(nullptr);
    ios::sync_with_stdio(false);
    reps(i, 2, 51){
        bool pr = true;
        reps(j, 2, i) if(i%j == 0) pr = false;
        if(pr) prime.push_back(i);
    }
    M = 15;
    ll res = INF;
    cin>>N;
    vec a(N);
    rep(i, N) cin>>a[i];
    rep(s, 1<<M){
        ll cmp = 1;
        rep(i, M) if((s>>i)&1) cmp *= prime[i];
        rep(i, N){
            bool ok = false;
            rep(j, M){
                if(((s>>j)&1) && a[i]%prime[j] == 0){
                    ok = true;
                    break;
                }
            }
            if(!ok){
                cmp = -1;
                break;
            }
        }
        if(cmp != -1) chmin(res, cmp);
    }
    cout<<res<<endl;
}

#include<bits/stdc++.h>
using namespace std;
int n, x[50];
int prime[] = {2,3,5,7,11,13,17,19,23,29,31,37,41,43,47};
int gcd(long long a, long long b) {
	return b ? gcd(b, a % b) : a;
}
int main() {
	cin >> n;
	for (int i = 1; i <= n; i++) cin >> x[i];
	long long ans = 0x3f3f3f3f3f3f3f3f;
	for (int i = 0; i < (1<<15); i++) {
		long long val = 1;
		for (int j = 0; j < 15; j++)
			if (i & (1<<j)) val *= prime[j];
		bool flag = 1;
		for (int j = 1; j <= n; j++)
			if (gcd(val, x[j]) == 1) flag = 0;
		if (flag) ans = min(ans, val);
	}
	cout << ans << endl;
}


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

int main(){
    int n;
    cin >> n;
    vector<int>x(n);
    ll man = 0;
    ll euc = 0;
    int a = 0;
    rep(i,n){
        cin >> x[i];
        x[i] = abs(x[i]);
        man += x[i];
        euc += ll(x[i])*x[i];
        a = max(a,x[i]);
    }
    cout << man << endl;
    cout << setprecision(20) << sqrt(euc) <<endl;
    cout << a << endl;

  }

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

int main(){
  ios::sync_with_stdio(0); cin.tie(0);
  long long n, m=0; cin >> n; double e=0;
  vector<long long> x(n), c(n);
  for(long long i=0;i<n;i++) cin >> x[i];
  for(long long i=0;i<n;i++) m += abs(x[i]);
  for(long long i=0;i<n;i++) e += pow(abs(x[i]), 2);
  for(long long i=0;i<n;i++) c.push_back(abs(x[i]));
  sort(c.begin(), c.end());
  cout << setprecision(15) << endl;
  cout << m << endl;
  cout << sqrt(e) << endl;
  cout << c[c.size()-1] << endl;
  return 0;
}


#include <bits/stdc++.h>
const int mu=1e9+7,N=100005;
int n,a[N];
int main(){
	scanf("%d",&n);
	for (int i=1;i<=n;i++) scanf("%d",&a[i]);
	std::sort(a+1,a+n+1);
	n=std::unique(a+1,a+n+1)-a-1;
	int p=1;
	for (int i=1;i<=n;i++) p=(long long)p*(a[i]-a[i-1]+1)%mu;
	printf("%d\n",p);
}

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

#define all(v) v.begin(), v.end()

//問題文を理解できなかった
// しきりを入れて区間に分ける
// 区間内はor演算、区間をまたぐときはxor演算を全ての要素同士で先頭から順に
// しきりを入れるパターンは、2^n-1(しきりを入れるか入れないか)
// 計算する場所としきりの場所がずれている!!
// 区間をor演算し終わったもの同士でxor演算する

// A={5,3,7,2,8}のとき
//   0 1 2 3 4
// 0 5|3 7|2 8|
// i=0 0とA[0](5)をor演算、しきりがあるのでoredをxoredに保持。oredを0に
// i=1 0とA[1](3)をor演算
// i=2 oredとA[2](7)をor演算 区間全てor演算したoredと保持していたxoredでxor演算
int main() {
  int N;
  cin >> N;
  vector<int> A(N);
  for (int i = 0; i < N; ++i) cin >> A[i];

  int ans = 1 << 30; // 10^9x1.073 使いやすい!　いいね!!
  // int型は4byte(32bit)、1<<31で10^9x2.147になる

  for (int bit = 0; bit < (1 << N - 1); ++bit) {
    int ored = 0, xored = 0;
    for (int i = 0; i < N; ++i) {
      //計算回数はN回、0とA[i]を最初に計算
      ored |= A[i];
      if (bit >> i & 1) { //一致すれば区間をまたぐ
        xored ^= ored;
        // or演算し終わった区間同士をxor演算する
        ored = 0;
      }
    }
    xored ^= ored;
    ans = min(ans, xored);
  }
  cout << ans << endl;
  return 0;
}

// int main() {
//   int N;
//   cin >> N;
//   vector<int> A(N);
//   for (int i = 0; i < N; ++i) cin >> A[i];
//   vector<int> a;
//   for (int i = 0; i < N; i += 2) {
//     int tmp = A[i] | A[i + 1];
//     a.push_back(tmp);
//   }
//   int ans = a[0];
//   for (int i = 1; i < a.size(); ++i) { ans ^= a[i]; }

//   cout << ans << endl;
//   //  sort(all(A));

//   // int tmp = 0;
//   // for (int i = 0; i < N - 1; ++i) { tmp |= A[i]; }
//   // tmp ^= A.back();
//   // cout << tmp << endl;
//   return 0;
// }