                                //ABHISHEK AGRAWAL,BIT mesra//
                        //Newbie......You have to be odd to be no. ONE :)//
  //Authhor: Abhishekagrawal
  //Date: 20/02/2021
  //Time: 17:30:13
  #include<bits/stdc++.h>
  using namespace std;
  #define ll long long int
  #define ld long double
  #define fl float
  #define vll vector<ll>
  #define pii pair<int,int>
  #define vpll vector<pair<ll,ll>>
  #define pb push_back
  #define f first
  #define s second
  #define mll map<ll,ll>
  #define mp make_pair
  #define sp(n) fixed<<setprecision(n)
  #define mod (ll)1000000007
  #define sortv(v) sort(v.begin(),v.end())
  #define INF (ll)(1e15)
  #define loop(i,n) for(int i=0;i<n;i++)
  #define loop1(i,n) for(int i=1;i<=n;i++)
  #define rloop(n,i) for(int i=n-1;i>=0;i--)
  #define sorta(a) sort(a,a+n,greater<ll>())
  #define countone(n) __builtin_popcount(n)
  #define numoftrailzero(n) __builtin_ctz(n)
  #define maxpowoftwo(n) __builtin_clz(n)
  #define leastindexwithone(n)  __builtin_ffs(n)
  #define what_is(x) cerr << #x << " is " << x << endl;
  #define pfv(v) cout<<v.size()<<"\n";loop(i,v.size()) cout<<v[i]<<" ";cout<<"\n";
  #define pv(v) loop(i,v.size()) cout<<v[i]<<" ";
  #define all(v) v.begin(),v.end()
  #define mset(dp,val) memset(dp,val,sizeof(dp))
  ll test,n;ll sum,ans;
  // #ifdef TESTING
  // #define DEBUG fprintf(stderr, "====TESTING====\n")
  // #define VALUE(x) cerr << "The value of " << #x << " is " << x << endl
  // #define debug(...) fprintf(stderr, __VA_ARGS__)
  // #else
  // #define DEBUG
  // #define VALUE(x)
  // #define debug(...)
  // #endif
  void the_happiest_place_on_earth()
  {
      ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
    #ifdef ENABLE_FILE_IO
      freopen("out.txt", "r", stdin);
      freopen("out1.txt", "w", stdout);
    #endif
  }
  // bool comp(const pair<ll,ll> &a, const pair<ll,ll> &b){
  //   if(a.s+2*a.f==b.s+2*b.f) return a.f>b.f;
  //   return (a.s+2*a.f>b.s+2*b.f);
  // }

  const int N=200040;ll a[N],b[N],c[N],par[N],Size[N],present[N],color[N];
  ll power(ll a,ll b,ll M){a%=M;ll res=1;while(b>0){if(b%2 ==1){res=(res*a)%M;}a=(a*a)%M;b/=2;} return res;}
  void testcase(){
    string s;
    cin>>s;
    ans=0;
    ll cur='*';
    int cnt=1;
    loop1(i,s.length()-2){
      if(s[i]==cur) ans--;
      if(s[i]==s[i-1]&&s[i]!=s[i+1]&&s[i]!=cur){
        ans+=(s.length()-i-1);
        cur=s[i];
      }
    }
    if(s[s.length()-1]==cur) ans--;
    cout<<ans<<"\n";
    return;
  }

  int main(){
    the_happiest_place_on_earth();
    // Today's thought: Push yourself,because no one else is going to do it for you.
    // Things are not always #000000 and #FFFFFF
    // START OF PROGRAM LOGIC
    // g++ -o a BB.cpp -DENABLE_FILE_IO;./a
    // g++ -std=c++17 -Wshadow -Wall -g -fsanitize=address -fsanitize=undefined -D_GLIBCXX_DEBUG -o a file_name.cpp;./a
    test=1;int t=0;
    // cin>>test;
    while(test--){
      //cout<<"Case #"<<++t<<": ";
      testcase();
    }
    cerr << "Time : " << 1000 *((double)clock()) / (double)CLOCKS_PER_SEC << "ms\n";
    // //END OF PROGRAM LOGIC
    return 0;
  }
  /* stuff you should look for
      * int overflow, array bounds
      * special cases (n=1?)
      * do smth instead of nothing and stay organized
      * WRITE STUFF DOWN
      * DON'T GET STUCK ON ONE APPROACH
  */

#include <bits/stdc++.h>

using namespace std;

typedef long long ll;
typedef double db;

#define in read()
#define pii pair<int,int>
#define fi first
#define se second
#define FILE(x) freopen(x".in","r",stdin);\
	freopen(x".out","w",stdout);
#define pb push_back

int read(){
	int x = 0,sgn = 1;char ch = getchar();
	for(;!isdigit(ch);ch = getchar()) if(ch == '-') sgn = -1;
	for(;isdigit(ch);ch = getchar()) x = (x<<1)+(x<<3)+(ch^48);
	return x*sgn;
}

const int mod = 998244353;

int n,m,k;
ll ans;

ll qp(ll x,int t){ll res=1;for(;t;t>>=1,x=x*x%mod)if(t&1)res=res*x%mod;return res;}

int main (){
#ifndef ONLINE_JUDGE
	freopen("1.in","r",stdin);
#endif
	n = in,m = in,k = in; if(n == 1 && m == 1) return printf("%d\n",k),0;
	if(n == 1 || m == 1) return printf("%d\n",qp(k,n+m-1) % mod),0;
	for(int i = 1;i <= k;i++){
		ans = (ans + (qp(i,n) - qp(i-1,n)) % mod * qp(k-i+1,m) % mod) % mod;
	}
	printf("%lld\n",(ans+mod)%mod);
	return 0;
}


#include <bits/stdc++.h>
#define ll long long
#define ull unsigned long long
#define ld long double
#define pii pair <int, int>
#define pll pair <ll, ll>
#define pci pair <char, int>
#define pld pair <ld, ld>
#define ppld pair <pld, pld>
#define ppll pair <pll, pll>
#define pldl pair <ld, ll>
#define vll vector <ll>
#define vvll vector <vll>
#define vpll vector <pll>
#define pb push_back
#define eb emplace_back
#define mp make_pair
#define fi first
#define se second
#define mll map <ll, ll>
#define fastmap gp_hash_table
#define cd complex <double>
#define vcd vector <cd>
#define PI 3.14159265358979
#pragma 03
using namespace std;
mt19937_64 rng(chrono::steady_clock::now().time_since_epoch().count());
ll x[200005], y[200005];
pll tx[200005], ty[200005];
int main(){
	ios_base::sync_with_stdio(0);
	cin.tie(0); cout.tie(0);
	ll n; cin >> n;
	for (ll i = 1; i <= n; i++){
		cin >> x[i] >> y[i];
		tx[i] = mp(x[i], i);
		ty[i] = mp(y[i], i);
	}
	sort(tx + 1, tx + n + 1);
	sort(ty + 1, ty + n + 1);
	ll ans = 0;
	if (tx[n].fi - tx[1].fi < ty[n].fi - ty[1].fi){
		for (ll i = 1; i <= n; i++){
			swap(x[i], y[i]);
			swap(tx[i], ty[i]);
		}
	}
	ans = max(ans, tx[n - 1].fi - tx[1].fi);
	ans = max(ans, tx[n].fi - tx[2].fi);
	ll id[4];
	id[0] = tx[1].se, id[1] = tx[n].se;
	if (id[0] > id[1]) swap(id[0], id[1]);
	id[2] = ty[1].se, id[3] = ty[n].se;
	if (id[2] > id[3]) swap(id[2], id[3]);
	bool c = 1;
	if ((id[0] == id[2]) && (id[1] == id[3])) c = 0;
	if (c) ans = max(ans, ty[n].fi - ty[1].fi);
	ans = max(ans, ty[n - 1].fi - ty[1].fi);
	ans = max(ans, ty[n].fi - ty[2].fi);
	cout << ans << "\n";
}

#include<bits/stdc++.h>
using namespace std;
#define int long long
#define vi vector<int>
#define ff first
#define ss second
#define pb push_back
#define mp make_pair
#define pi 3.141592653589793238
#define rep(i,a,b) for (int i = a; i <= b; i++)
#define zip(i,a,b) for(int i=a;i<b;i++)
#define rzip(i,a,b) for(int i=a;i>=b;i--)
#define ll unsigned int
#define test int t;cin>>t; while(t--)
#define en '\n'
typedef pair<int, int>     pii;
typedef pair<char, int>    pci;
typedef pair<char, char>   pcc;
typedef vector<pii>       vii;
typedef long double ld;
#define all(v) v.begin(), v.end()
#define rall(v) v.rbegin(),v.rend()
#define sz(x) (int)x.size()
#define INF (1e18+5)
#define inf (1e9+5)
#define mod 1000000007

void __print(int 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");}
// You should only debug a pair of simple data types. For example,
// the debug won't work if one of pair's elements is collection type
// (std::vector, std::map, std::set...).
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

// bool check_prime(int n)  return whether a number is prime or not O(sqrt(N));
// int BE(int x,int n,int m)  return x^n%m; O(logN);
// void sieve()  from number 1-1000001 saare prime store kar lega  in bool is_prime[1000001] array
// vector<int> z_array(string s)  return vector which is Z-array of string s;
// vector<int> lps(string s)      return vector which is lps array of string s;
// int power(int x,int n) return x^n; O(logN);
// using_ordered_set (template for using ordered set , replace first 2 lines of this page with this code..);
const int gf = 1e6 + 9;

int32_t main()
{
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(0);
#ifndef ONLINE_JUDGE
  if (fopen("input.txt", "r"))
  {
    freopen ("input.txt" , "r" , stdin);
    freopen ("output.txt" , "w" , stdout);
  }
#endif
  //__________-code starts-________________

  int n;
  cin >> n;
  int x[n], y[n];
  vii v1, v2;

  zip(i, 0, n) {
    cin >> x[i] >> y[i];
    v1.pb({x[i], i});
    v2.pb({y[i], i});
  }
  sort(all(v1));
  sort(all(v2));
  set<pair<int, pii>>s;
  s.insert({v1[n - 1].ff - v1[0].ff, {min(v1[n - 1].ss, v1[0].ss), max(v1[n - 1].ss, v1[0].ss)}});
  s.insert({v1[n - 1].ff - v1[1].ff, {min(v1[n - 1].ss, v1[1].ss), max(v1[n - 1].ss, v1[1].ss)}});
  s.insert({v1[n - 2].ff - v1[0].ff, {min(v1[n - 2].ss, v1[0].ss), max(v1[n - 2].ss, v1[0].ss)}});
  s.insert({v2[n - 1].ff - v2[0].ff, {min(v2[n - 1].ss, v2[0].ss), max(v2[n - 1].ss, v2[0].ss)}});
  s.insert({v2[n - 1].ff - v2[1].ff, {min(v2[n - 1].ss, v2[1].ss), max(v2[n - 1].ss, v2[1].ss)}});
  s.insert({v2[n - 2].ff - v2[0].ff, {min(v2[n - 2].ss, v2[0].ss), max(v2[n - 2].ss, v2[0].ss)}});
  auto var = *s.rbegin();
  s.erase(s.find(var));
  cout << (*s.rbegin()).ff << en;

  return 0;
}


#include<bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define rrep(i, k, n) for (int i = k; i < (int)(n); i++)
#define repd(i, n) for (int i = n-1; i >= 0; i--)
#define rrepd(i, k, n) for (int i = n-1; i >= (int)(k); i--)
#define all(x) (x).begin(),(x).end()
#define chmax(x,y) x=max(x,y)
#define chmin(x,y) x=min(x,y)
#define F first //pairの一つ目の要素  //遅延セグ木使うときは注意
#define S second //pairの二つ目の要素  //遅延セグ木使うときは注意
#define PB push_back //挿入
#define MP make_pair //pairのコンストラクタ
//V,Pは大文字i,l,bは小文字
using ll = long long;
using Vi = vector<int>;
using VVi = vector<Vi>;
using Vl = vector<ll>;
using VVl = vector<Vl>;
using Vb = vector<bool>;
using VVb = vector<Vb>;
using P = pair<int,int>;
using Pl = pair<ll, ll>;
using Vs = vector<string>;
const ll mod = 1000000007;
const ll inf = 1000000000000000000;//10の18乗
#define yn {puts("Yes");}else{puts("No");}
#define dame { puts("-1"); return 0;}

int main() {
    ll n;
    cin >> n;
    Vl v(n);
    rep(i,n) cin >> v[i];
    sort(all(v));
    ll ok=1;
    rep(i,n) if(v[i]!=i+1) ok=0;
    if(ok) yn;
}

#include<bits/stdc++.h>

using namespace std;

int main(){
    int a;
    cin>>a;
    priority_queue<int> pq;
    for(int i=0;i<a;i++){
        int c;
        cin>>c;
        pq.push(c);
    }
    while(pq.size()){
        if(pq.top()!=a){
            cout<<"No";
            return 0;
        }
        pq.pop();
        a--;
    }
    cout<<"Yes";
    return 0;
}


#include "bits/stdc++.h"
using namespace std;
//#include "atcoder/all"
//using namespace atcoder;
#define int long long
#define REP(i, n) for (int64_t i = 0; i < (int)n; ++i)
#define RREP(i, n) for (int64_t i = (int)n - 1; i >= 0; --i)
#define FOR(i, s, n) for (int64_t i = s; i < (int)n; ++i)
#define RFOR(i, s, n) for (int64_t i = (int)n - 1; i >= s; --i)
#define ALL(a) a.begin(), a.end()
#define IN(a, x, b) (a <= x && x < b)
template<class T>istream&operator >>(istream&is,vector<T>&vec){for(T&x:vec)is>>x;return is;}
template<class T>inline void out(T t){cout << t << "\n";}
template<class T,class... Ts>inline void out(T t,Ts... ts){cout << t << " ";out(ts...);}
template<class T>inline bool CHMIN(T&a,T b){if(a > b){a = b;return true;}return false;}
template<class T>inline bool CHMAX(T&a,T b){if(a < b){a = b;return true;}return false;}
constexpr int64_t INF = 1000000000000000000; // 10^18

int64_t getRoot(int N) {
    int64_t ret = 1;
    while(ret * ret <= N) {
        ret++;
    }
    return ret - 1;
}

signed main() {
    int K;
    cin >> K;
    int ans = 0;
    FOR(i, 1, K + 1) {
        auto f = [&](int N) {
            int ret = 0;
            int root = getRoot(N);
            for(int64_t j = 1; j * j <= N; j++) {
                ret += N / j * 2;
            }
            return ret - root * root;
        };
        ans += f(K / i);
        //out(i, ans);
    }
    out(ans);
}

#define _USE_MATH_DEFINES

#include <bits/stdc++.h>

using namespace std;

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

constexpr ll MOD = 1000000007;

#ifndef ONLINE_JUDGE
template <class T, class U>ostream &operator<<(ostream &o, const map<T, U>&obj) {o << "{"; for (auto &x : obj) o << " (" << x.first << " : " << x.second << ")" << ","; o << " }"; return o;}
template <class T>ostream &operator<<(ostream &o, const set<T>&obj) {o << "{"; for (auto itr = obj.begin(); itr != obj.end(); ++itr) o << (itr != obj.begin() ? ", " : "") << *itr; o << "}"; return o;}
template <class T>ostream &operator<<(ostream &o, const multiset<T>&obj) {o << "{"; for (auto itr = obj.begin(); itr != obj.end(); ++itr) o << (itr != obj.begin() ? ", " : "") << *itr; o << "}"; return o;}
template <class T>ostream &operator<<(ostream &o, const vector<T>&obj) {o << "["; for (int i = 0; i < (int)obj.size(); ++i)o << (i > 0 ? ", " : "") << obj[i]; o << "]"; return o;}
ostream &operator<<(ostream &o, const string &obj) {o << "\""; o << obj.c_str(); o << "\""; return o;}
template <class T, class U>ostream &operator<<(ostream &o, const pair<T, U>&obj) {o << "(" << obj.first << ", " << obj.second << ")"; return o;}
template <template <class tmp>  class T, class U> ostream &operator<<(ostream &o, const T<U> &obj) {o << "{"; for (auto itr = obj.begin(); itr != obj.end(); ++itr)o << (itr != obj.begin() ? ", " : "") << *itr; o << "}"; return o;}
void print_sim_py(void) {cout << endl;}
template <class Head> void print_sim_py(Head&& head) {cout << head;print_sim_py();}
template <class Head, class... Tail> void print_sim_py(Head&& head, Tail&&... tail) {cout << head << " ";print_sim_py(forward<Tail>(tail)...);}

#define print(...) print_sim_py(__VA_ARGS__);
#else
#define print(...);
#endif

template <typename... Ts>
std::istream& IN(Ts&... xs){ return (std::cin >> ... >> xs); }

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

// a^n mod を計算する
long long modpow(long long a, long long n, long long mod) {
    long long res = 1;
    while (n > 0) {
        if (n & 1) res = res * a % mod;
        a = a * a % mod;
        n >>= 1;
    }
    return res;
}

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

    ll a,b,c;
    ll ca,cb;
    IN(a,b,c);

    ca=cb=1;
    ll ans = 0;
    ll a1=a%10;
    a1=(a1*(a%10))%10;
    while(a1!=(a%10)){
        ca++;
        a1=(a1*(a%10))%10;
    }
    cb = modpow(b,c,ca);
    cb = (cb+(ca-1))%ca;
    print(ca,cb)

    ll ap=a%10;

    rep(i,cb){
        ap=(ap*(a%10))%10;
    }

    ans = ap;

    cout << ans << endl;

    return 0;
}


#pragma GCC optimize("Ofast")
#include <bits/stdc++.h>
#define ud unsigned int
#define ll long long
#define ull unsigned long long
#define MAX_INF 0x3f
#define MAX_INF_VAL 0x3f3f3f3f
#define MAX_INF_VAL_LL 0x3f3f3f3f3f3f3f3f
//#define pi 3.141592653589
#define eps 1e-9
#define F(x) ((x)/3+((x)%3==1?0:tb))
#define G(x) ((x)<tb?(x)*3+1:((x)-tb)*3+2)
//#define p 2173412051LL
//#define sz 2

using namespace std;

template< typename T > void read( T &x ) {
	x = 0;
	char ch = getchar();
	ll f = 1;
	while( !isdigit( ch ) ) {
		if( ch == '-' )
		f *= -1;
		ch = getchar();
	}
	while( isdigit( ch ) ) {
		x = x * 10 + ch - 48;
		ch = getchar();
	}
	x *= f;
}

struct custom_hash {
    static uint64_t splitmix64( uint64_t x ) {
        x += 0x9e3779b97f4a7c15;
        x = ( x ^ ( x >> 30 ) ) * 0xbf58476d1ce4e5b9;
        x = ( x ^ ( x >> 27 ) ) * 0x94d049bb133111eb;
        return x ^ ( x >> 31 );
    }

    size_t operator() ( uint64_t x ) const {
        static const uint64_t FIXED_RANDOM = chrono::steady_clock::now().time_since_epoch().count();
        return splitmix64( x + FIXED_RANDOM );
    }
};

const ll p = 998244353;

int a[ 110 ];
ll f[ 110 ][ 10010 ];
ll fac[ 110 ];

int main() {
	ios::sync_with_stdio( false );
	cin.tie( 0 ), cout.tie( 0 );
	int n;
	cin >> n;
	fac[ 0 ] = 1;
	ll sum = 0;
	for( int i = 1; i <= n; ++i ) {
		cin >> a[ i ];
		fac[ i ] = fac[ i - 1 ] * i % p;
		sum += a[ i ];
	}
	if( sum & 1 ) {
		cout << 0;
		return 0;
	}
	sum >>= 1;
	f[ 0 ][ 0 ] = 1;
	for( int i = 1; i <= n; ++i ) {
		for( int j = i; j; --j ) {
			for( int k = j * 100; k >= a[ i ]; --k )
				f[ j ][ k ] = ( f[ j ][ k ] + f[ j - 1 ][ k - a[ i ] ] ) % p;
		}
	}
	ll ans = 0;
	for( int i = 1; i <= n; ++i )
		ans = ( ans + fac[ i ] * f[ i ][ sum ] % p * fac[ n - i ] ) % p;
	cout << ans;
	return 0;
}

#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(ll i=0;i<ll(n);i++)
#define REP(i,k,n) for(ll i=k;i<ll(n);i++)
#define all(a) a.begin(),a.end()
#define eb emplace_back
#define lb(v,k) (lower_bound(all(v),k)-v.begin())
#define ub(v,k) (upper_bound(all(v),k)-v.begin())
#define fi first
#define se second
#define PQ(T) priority_queue<T>
#define SPQ(T) priority_queue<T,vector<T>,greater<T>>
#define UNIQUE(a) sort(all(a));a.erase(unique(all(a)),a.end())
#define decimal cout<<fixed<<setprecision(10)
#define summon_tourist cin.tie(0);ios::sync_with_stdio(false)
using ll=long long;
using P=pair<ll,ll>;
using vi=vector<ll>;
using vvi=vector<vi>;
using vvvi=vector<vvi>;
constexpr ll inf=1001001001001001;
constexpr int INF=1001001001;
constexpr int mod=998244353;
template<class T> bool chmin(T&a,T b){if(a>b){a=b;return true;}return false;}
template<class T> bool chmax(T&a,T b){if(a<b){a=b;return true;}return false;}
template<class T> bool isin(T x,T l,T r){return (l)<=(x)&&(x)<=(r);}
template<class T> void out(T a){cout<<a<<'\n';}
template<class T> void outp(T a){cout<<'('<<a.fi<<','<<a.se<<')'<<'\n';}
template<class T> void outvp(T v){rep(i,v.size())cout<<'('<<v[i].fi<<','<<v[i].se<<')';cout<<'\n';}
template<class T> void outv(T v){rep(i,v.size()){if(i)cout<<' ';cout<<v[i];}cout<<'\n';}
template<class T> void outvv(T v){rep(i,v.size())outv(v[i]);}
void YesNo(bool b){if(b)out("Yes");else out("No");}
void yesno(bool b){if(b)out("yes");else out("no");}
void YESNO(bool b){if(b)out("YES");else out("NO");}
ll modpow(ll a,ll b){ll c=1;while(b>0){if(b&1){c=a*c%mod;}a=a*a%mod;b>>=1;}return c;}
vi calc(ll x){vi v;while(x>0){v.eb(x%10);x/=10;}reverse(all(v));return v;}

vector<P> p_fac(ll n){
	vector<P> res;
	for(ll a=2;a*a<=n;a++){
		if(n%a!=0) continue;
		ll ex=0; //exponent number
		while(n%a==0){
			ex++; n/=a;
		}
		res.eb(make_pair(a,ex));
	}
	if(n!=1) res.eb(make_pair(n,1));
	return res;
}

const ll max_n=205000; //please define
vi fac(max_n),finv(max_n),inv(max_n);
// O(max_n)
void init(){
    fac[0]=fac[1]=1;
    finv[0]=finv[1]=1;
    inv[1]=1;
    REP(i,2,max_n){
        fac[i]=fac[i-1]*i%mod;
        inv[i]=mod-inv[mod%i]*(mod/i)%mod;
        finv[i]=finv[i-1]*inv[i]%mod;
    }
}
// O(1)
ll COM(int n,int k){
    if(n<k) return 0;
    if(n<0||k<0) return 0;
    return fac[n]*(finv[k]*finv[n-k]%mod)%mod;
}

int main(){
    init();
	ll n,m;
	cin>>n>>m;
    ll ans=1;
	REP(i,2,m+1){
        vector<P> v=p_fac(i);
        ll c=1;
        rep(j,v.size()){
            ll x=v[j].se;
            c*=COM(x+n-1,x);
            c%=mod;
        }
        ans+=c;
        ans%=mod;
	}
    out(ans);
}


#include <iostream>

int main(){
  int a, b, c;
  std::cin >> a >> b >> c;
  std::cout << (21-(a+b+c)) << '\n';
}

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

int main() {
int a,b,c,d;
  cin >> a >> b >> c >> d;
  cout << b - c << endl;

}


#include<bits/stdc++.h>
using namespace std;
const int N=22;
const int M=110;
#define pii pair<int,int>
using ll=long long;
#define mp make_pair
#define mid (l+r>>1)

vector<vector<int> > v(N);
vector<int> status(1<<N,0);

inline int read() {
    char c = getchar();
    int x = 0, f = 1;
    while (c < '0' || c > '9') {
        if (c == '-')f = -1;
        c = getchar();
    }
    while (c >= '0' && c <= '9') {
        x = x * 10 + c - '0';
        c = getchar();
    }
    return x * f;
}

//vector<int> f(N,1);
//
//void init(){
//    for(int i=1;i<N;i++) f[i]=f[i-1]<<2;
//}
int main(){
    int n=read(),m=read();
    for(int i=1;i<=m;i++){
        int a=read()-1,b=read()-1;
        v[a].push_back(b);
        v[b].push_back(a);
        for(int j=0;j<(1<<n);j++) if((j>>a&1)&&(j>>b&1)) status[j]=-1;
    }
    ll ans=0;
    for(int i=0;i<(1<<n);i++){
        if(status[i]==-1) continue;
        vector<int> color(N,-1);
        for(int j=0;j<n;j++) if(i>>j&1) color[j]=2;
        queue<int> q;
        int num=0;
        bool ok=false;
        for(int j=0;j<n;j++){
            if(color[j]!=-1) continue;
            q.push(j);
//            cout<<i<<" "<<j<<"\n";
            color[j]=0;
            num++;
            while(q.size()){
                int x=q.front();
                q.pop();
                for(auto y:v[x]){
                    if(color[x]==color[y]){
                        ok=true;
                        break;
                    }
//                    cout<<x<<" "<<y<<"\n";
                    if(color[y]==-1){
                        color[y]=color[x]^1;
                        q.push(y);

                    }
                }
                if(ok) break;
            }
            if(ok) break;
        }
//        cout<<i<<" "<<num<<"\n";
        if(!ok) ans+=1<<num;
    }
    printf("%lld\n",ans);
}

#include <bits/stdc++.h>
using namespace std;
#define ll long long int
#define ff first
#define ss second
#define pb push_back
#define mp make_pair
#define deb(x) cout<< #x << " " << x << "\n";
#define MAX 9223372036854775807
#define MIN -9223372036854775807
#define setbits(n) __builtin_popcountll(n)
#define mkunique(a) sort(a.begin(),a.end()); a.resize(unique(a.begin(),a.end())-a.begin());
#define print(s) for(ll u: s) cout<<u<<" "; cout<<"\n";
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
const ll mod=1e9+7;

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

int main(){

    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);
    ll TT=clock();

    ll n,m;
    cin>>n>>m;
    for(ll i=0;i<m;i++){
        ll u,v,c,d;
        cin>>u>>v>>c>>d; u--,v--;
        a[u].pb({v,{c,d}});
        a[v].pb({u,{c,d}});
    }
    vector<ll> d(n,mod*mod);
    d[0] = 0;
    set<pair<ll,ll>> s;
    s.insert({0,0});
    while(!s.empty()){
        ll v = s.begin()->ss;
        s.erase(s.begin());
        for(auto ed: a[v]){
            ll u = ed.ff, c = ed.ss.ff, dd = ed.ss.ss;
            ll t = d[v];
            ll wait = max(0ll,(ll)sqrt(dd) - 1ll - t);
            for(ll i=max(0ll,wait-1);i<=wait+1;i++){
                ll cost = t + i + c + dd/(t+i+1);
                if(cost < d[u]){
                    s.erase({d[u],u});
                    d[u] = cost;
                    s.insert({d[u],u});
                }
            }
        }
    }
    if(d[n-1]==mod*mod)
        cout<<-1;
    else
        cout<<d[n-1];

    cerr<<"\n\nTIME: "<<(long double)(clock()-TT)/CLOCKS_PER_SEC<<" sec\n";
    TT = clock();
    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;
// using ordered_set = tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update>;

void __dbg() { cout << endl; }
template<typename Arg, typename... Args> void __dbg(Arg A, Args... B) { cout << " " << A; __dbg(B...); }
#define dbg(...)  cout << "(" << #__VA_ARGS__ << "):", __dbg(__VA_ARGS__)

#define rep(i,a,b) for(int i=a;i<b;i++)
#define lprin(n) printf("%lld\n", n)
#define lpri(n) printf("%lld ", n)
#define lscn(n) scanf("%lld", &n)
#define prin(n) printf("%d\n", n)
#define pri(n) printf("%d ", n)
#define scn(n) scanf("%d", &n)
#define vi vector<int>
#define ll long long
#define pb push_back
#define mp make_pair
#define F first
#define S second

const int inf  = INT_MAX;
const int ninf = INT_MIN;
const int mod  = 1e9 + 7;
const int maxN = 1e6 + 2;

map<ll, ll> dp, vis;
ll x, y, ans;

ll rec(ll val)
{
   if(vis[val]) return dp[val];

   vis[val] = 1;
   dp[val] = 1e18;

   ll& ret = dp[val];
   ret = abs(x - val);

   if(val == 1)
      return ret;

   if(val % 2 == 0)
      ret = min(ret, 1 + rec(val / 2));
   else
      ret = min(ret, 1 + min(rec(val + 1), rec(val - 1)));

   return ret;
}

int main()
{
   lscn(x); lscn(y);

   lprin(rec(y));

   return 0;
}


#include <bits/stdc++.h>
using namespace std;
#define ll long long
vector<ll> arr, fact;
#define mod 998244353
// (1/a)%p = (pow(a,p-2))%p
void precalc()
{
    fact[0] = 1;
    fact[1] = 1;
    for (int i = 1; i <= 300; i++)
    {
        fact[i] = (i * fact[i - 1]) % mod;
    }
}
ll power(ll a, ll b)
{
    ll res = 1;
    while (b > 0)
    {
        if (b % 2)
            res = (res * a) % mod;
        a = (a * a) % mod;
        b = b / 2;
    }
    return res;
}
ll nCk(ll n, ll k)
{
    return (((fact[n] * power(fact[k], mod - 2)) % mod) * power(fact[n - k], mod - 2)) % mod;
}
int main()
{
    int n, k;
    cin >> n >> k;
    arr = vector<ll>(n);
    fact = vector<ll>(301);
    precalc();
    ll sum3 = 0;
    for (int i = 0; i < n; i++)
    {
        cin >> arr[i];
        // sum3 = (sum3 + arr[i])%mod;
    }
    // sum3 = (sum3*2)%mod;
    vector<ll> sumarr(k + 1);
    for (int i = 0; i <= k; i++)
    {
        ll sum = 0;
        for (int j = 0; j < n; j++)
        {
            sum = (sum + power(arr[j], i)) % mod;
        }
        sumarr[i] = sum;
    }
    for (int x = 1; x <= k; x++)
    {
        ll sum = 0, sum4;
        for (int p = 0; p <= x; p++)
        {
            sum4 = 0;
            sum4 = (sum4 + nCk(x, p)) % mod;
            // cout<<"x: "<<x<<" p: "<<p<<" nCk: "<<nCk(x,p)<<endl;
            ll sum1 = 0, sum2 = 0;
            sum1 = sumarr[p];
            sum2 = sumarr[x - p];
            // for (int i = 0; i < n; i++)
            // {
            //     sum1 = (sum1 + power(arr[i], p))%mod;
            //     sum2 = (sum2 + power(arr[i], x - p))%mod;
            // }
            // cout<<"x: "<<x<<" p: "<<p<<" sum: "<<sum<<" sum1: "<<sum1<<" sum2: "<<sum2<<endl;
            sum4 = (sum4 * sum1) % mod;
            sum4 = (sum4 * sum2) % mod;
            sum = (sum + sum4) % mod;
            // cout<<"#"<<sum4<<endl;
        }
        // cout<<"*sum: "<<sum<<endl;
        sum3 = (sumarr[x] * power(2, x)) % mod;
        // for(int i=0;i<n;i++){
        //     sum3 = (sum3 + power(2*arr[i],x))%mod;
        // }
        // cout<<"sum3: "<<sum3<<endl;
        ll num1 = (sum - sum3 + mod) % mod;
        // cout<<"@num1: "<<num1<<endl;
        sum = (num1 * power(2, mod - 2)) % mod;
        cout << sum << "\n";
    }
    return 0;
}

#include<bits/stdc++.h>
#define ll long long
#define pb push_back
#define mkp make_pair
#define vi vector<int>
#define pii pair<int,int>
#define FI(n) FastIO::read(n)
#define FO(n) FastIO::write(n)
#define ull unsigned long long
#define mst(a,b) memset(a,b,sizeof(a))
#define foR(i,k,j) for(int i=(k);i>=(j);i--)
#define For(i,k,j) for(int i=(k);i<=(j);i++)
#define Foe(i,u) for(int i=lst[u],v=e[i].v;i;i=e[i].nxt,v=e[i].v)
#define IOS ios::sync_with_stdio(0),cin.tie(0),cout.tie(0)
#define Fin(s) freopen(s,"r",stdin)
#define Fout(s) freopen(s,"w",stdout)
#define file(s) Fin(s".in"),Fout(s".out")
#define INF ((1<<30)-1)
#define int long long
const int P=998244353; //
using namespace std;
template<typename T>inline void ckmax(T &a,T b) {(a<b)&&(a=b);}
template<typename T>inline void ckmin(T &a,T b) {(a>b)&&(a=b);}
inline int mul(int a,int b) {return 1ull*a*b%P;}
inline int add(int a,int b) {return a+b>=P?a+b-P:a+b;}
inline int sub(int a,int b) {return a-b>=0?a-b:a-b+P;}
inline void mulmod(int &a,int b) {a=mul(a, b);}
inline void addmod(int &a,int b) {((a+=b)>=P)&&(a-=P);}
inline void submod(int &a,int b) {((a-=b)<0)&&(a+=P);}
inline int ksm(int a,int b) {int ans=1; for(;b;b>>=1) {if(b&1) ans=1ll*ans*a%P;a=1ll*a*a%P;}return ans;}
inline void fprint(const int &x,char c=' ') {fprintf(stderr,"%lld%c",x,c);}
inline void fprint(const pii &x,char c='\n') {fprintf(stderr,"%lld %lld%c",x.first,x.second,c);}
inline void fprint(const int *f,const int &n,char c='\n') {for(int i=1;i<=n;i++) fprint(f[i]); fprintf(stderr,"%c",c);}
inline void fprint(const vector<int> &f,char c='\n') {for(int i=0;i<(int)f.size();i++) fprint(f[i]); fprintf(stderr,"%c",c);}
inline int inv(int a) {return ksm(a,P-2);}
namespace FastIO {
  const int SIZE=1<<16; char buf[SIZE],obuf[SIZE],str[64]; int bi=SIZE,bn=SIZE,opt;
  int read(char *s) {
    while (bn) {for (;bi<bn&&buf[bi]<=' ';bi++);if (bi<bn) break; bn=fread(buf,1,SIZE,stdin),bi=0;}
    int sn=0;while (bn) {for (;bi<bn&&buf[bi]>' ';bi++) s[sn++]=buf[bi];if (bi<bn) break; bn=fread(buf,1,SIZE,stdin),bi=0;}s[sn]=0;return sn;
  }
  bool read(int& x) {if(x)x=0;int bf=0,n=read(str); if(!n) return 0; int i=0; if (str[i]=='-') bf=1,i=1; for(x=0;i<n;i++) x=x*10+str[i]-'0'; if(bf) x=-x; return 1;}
  void write(int x) {
    if(!x) obuf[opt++]='0'; else {if(x<0) obuf[opt++]='-',x=-x;int sn=0; while(x)str[sn++]=x%10+'0',x/=10;for (int i=sn-1;i>=0;i--) obuf[opt++]=str[i];}
    if (opt>=(SIZE>>1)){fwrite(obuf,1,opt,stdout); opt=0;}
  }
  void write(char x) {obuf[opt++]=x;if (opt>=(SIZE>>1)){fwrite(obuf,1,opt,stdout); opt=0;}}
	void Fflush() {if (opt) fwrite(obuf,1,opt,stdout); opt=0;}
};
inline int read() {int x; FI(x); return x;}
const int MN=2e5+5,MK=305;
int n,K,t[MN][MK],S[MK],a[MN];
int fac[MN],ifac[MN];
int C(int n,int m) {
	if(n<m||n<0||m<0) return 0;
	return 1ll*fac[n]*ifac[m]%P*ifac[n-m]%P;
}
void init(int n=MN-5) {
	fac[0]=1; For(i,1,n) fac[i]=mul(fac[i-1],i); ifac[n]=inv(fac[n]);
	foR(i,n,1) ifac[i-1]=mul(ifac[i],i);
}
signed main() {
	#ifndef ONLINE_JUDGE
		freopen("pro.in","r",stdin);
		freopen("pro.out","w",stdout);
	#endif
	n=read(),K=read(); init();
	For(i,1,n) a[i]=read(),t[i][0]=1;
	For(i,1,n) {
		For(j,1,K) {
			t[i][j]=mul(t[i][j-1],a[i]);
		}
//		For(j,1,K) addmod(t[i][j],t[i][j-1]);
		For(j,0,K) addmod(S[j],t[i][j]);
	}
	For(x,1,K) {
		int ans=0;
		For(t,0,x) {
			addmod(ans,mul(C(x,t),mul(S[x-t],S[t])));
		} int p2=ksm(2,x);
		For(i,1,n) submod(ans,mul(p2,t[i][x]));
//		cerr<<p2<<endl;
		printf("%lld\n",mul(ans,inv(2)));
	}
	return FastIO::Fflush(),0;
}


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

/*input

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

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

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

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

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

	return true;
}

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

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

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

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

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

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

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

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

	input(int, num1); input(int, num2);
	if (num2 % num1 == 0) {
		cout <<	"Yes";
	} else {
		cout << "No";
	}

}

#include<bits/stdc++.h>
using namespace std;
int main() {
    int t;
    t=1;
    while(t--){
        int n; cin>>n;
        string str;
        bool is = false;
        unordered_set<string> st;
        for(int i=0;i<n;i++){
            cin>>str;
            if(str[0] == '!'){
                if(st.find(str.substr(1)) != st.end()){
                    is = true;
                    cout<<str.substr(1);
                    break;
                }
                else st.insert(str);
            }
            else{
                if(st.find("!"+str) != st.end()){
                    is = true;
                    cout<<str;
                    break;
                }
                else st.insert(str);
            }
        }
        if(!is)cout<<"satisfiable";
        // cout<<"\n";
    }
}


#include <iostream>
#include <cstdio>
#include <algorithm>
#include <bits/stdc++.h>
#define ALL(x) (x).begin(), (x).end()
#define sz(a) int(a.size())
#define rep(i,x,n) for(int i=x;i<n;i++)
#define repd(i,x,n) for(int i=x;i<=n;i++)
#define pii pair<int,int>
#define pll pair<long long ,long long>
#define gbtb ios::sync_with_stdio(false),cin.tie(0),cout.tie(0)
#define MS0(X) memset((X), 0, sizeof((X)))
#define MSC0(X) memset((X), '\0', sizeof((X)))
#define pb push_back
#define mp make_pair
#define fi first
#define se second
#define eps 1e-6
#define chu(x)  if(DEBUG_Switch) cout<<"["<<#x<<" "<<(x)<<"]"<<endl
#define du3(a,b,c) scanf("%d %d %d",&(a),&(b),&(c))
#define du2(a,b) scanf("%d %d",&(a),&(b))
#define du1(a) scanf("%d",&(a));
using namespace std;
typedef long long ll;
ll gcd(ll a, ll b) {return b ? gcd(b, a % b) : a;}
ll lcm(ll a, ll b) {return a / gcd(a, b) * b;}
ll powmod(ll a, ll b, ll MOD) { if (a == 0ll) {return 0ll;} a %= MOD; ll ans = 1; while (b) {if (b & 1) {ans = ans * a % MOD;} a = a * a % MOD; b >>= 1;} return ans;}
ll poww(ll a, ll b) { if (a == 0ll) {return 0ll;} ll ans = 1; while (b) {if (b & 1) {ans = ans * a ;} a = a * a ; b >>= 1;} return ans;}
void Pv(const vector<int> &V) {int Len = sz(V); for (int i = 0; i < Len; ++i) {printf("%d", V[i] ); if (i != Len - 1) {printf(" ");} else {printf("\n");}}}
void Pvl(const vector<ll> &V) {int Len = sz(V); for (int i = 0; i < Len; ++i) {printf("%lld", V[i] ); if (i != Len - 1) {printf(" ");} else {printf("\n");}}}
inline long long readll() {long long tmp = 0, fh = 1; char c = getchar(); while (c < '0' || c > '9') {if (c == '-') { fh = -1; } c = getchar();} while (c >= '0' && c <= '9') { tmp = tmp * 10 + c - 48, c = getchar(); } return tmp * fh;}
inline int readint() {int tmp = 0, fh = 1; char c = getchar(); while (c < '0' || c > '9') {if (c == '-') { fh = -1; } c = getchar();} while (c >= '0' && c <= '9') { tmp = tmp * 10 + c - 48, c = getchar(); } return tmp * fh;}
void pvarr_int(int *arr, int n, int strat = 1) {if (strat == 0) {n--;} repd(i, strat, n) {printf("%d%c", arr[i], i == n ? '\n' : ' ');}}
void pvarr_LL(ll *arr, int n, int strat = 1) {if (strat == 0) {n--;} repd(i, strat, n) {printf("%lld%c", arr[i], i == n ? '\n' : ' ');}}
const int maxn = 1000010;
const int inf = 0x3f3f3f3f;
/*** TEMPLATE CODE * * STARTS HERE ***/
#define DEBUG_Switch 0
int n, m;
char s[105][105];
int dx[4] = {1, 0, -1, 0};
int dy[4] = {0, 1, 0, -1};

int main()
{
#if DEBUG_Switch
    freopen("D:\\code\\input.txt", "r", stdin);
#endif
    //freopen("D:\\code\\output.txt","w",stdout);
    cin >> n >> m;
    repd(i, 1, n) {
        cin >> s[i] + 1;
    }
    int ans = 0;
    repd(i, 1, n) {
        repd(j, 1, m) {
            repd(k, 0, 3) {
                int x = i + dx[k];
                int y = j + dy[k];
                if (s[i][j] == '.' && s[x][y] == '.') {
                    ans++;
                }
            }
        }
    }
    ans >>= 1;
    cout << ans << endl;
    return 0;
}

#include <iostream>
#include <string>
#include <vector>

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

using std::cin;
using std::cout;
using std::endl;
using std::string;
using std::vector;

int main()
{
  int H, W;
  cin >> H >> W;

  vector<string> S(H);
  rep(i, H) cin >> S[i];

  int count = 0;
  rep(i, H)
  {
    rep(j, W)
    {
      if (S[i][j] == '.')
      {
        if (i != H - 1 && S[i + 1][j] == '.')
        {
          count++;
        }
        if (j != W - 1 && S[i][j + 1] == '.')
        {
          count++;
        }
      }
    }
  }

  cout << count << endl;

  return 0;
}


#include <bits/stdc++.h>

using namespace std;

int main()
{
	int r1, c1, r2, c2;

	cin >> r1 >> c1 >> r2 >> c2;

	int r = r2 - r1, c = c2 - c1;

	if (r == 0 && c == 0) {
		cout << 0 << endl;
	} else if (r == c || r == -c || abs(r) + abs(c) <= 3) {
		cout << 1 << endl;
	} else if ((r ^ c ^ 1) & 1) {
		cout << 2 << endl;
	} else if ( abs(r + c) <= 3 || abs(r - c) <= 3 || abs(r) + abs(c) <= 6) {
		cout << 2 << endl;
	} else {
		cout << 3 << endl;
	}

	return 0;
}

#include<bits/stdc++.h>
#define ll long long
#define int ll
#define mp make_pair
#define pii pair<int,int>
#define pb push_back
#define r1 rt<<1
#define r2 rt<<1|1
#define fi first
#define se second
#define db double
#define ld long db
#define ri register int
#define rep(i,a,b) for(ri i=(a);i<=(b);++i)
#define rep2(i,a,b,c) for(ri i=(a);i<=(b);i+=(c))
#define REP(i,a,b) for(ri i=(a);i>=(b);--i)
#define REP2(i,a,b,c) for(ri i=(a);i>=(b);i-=(c))
using namespace std;

inline int read(){
	ri x=0,f=1;char c=getchar();
	while(c<'0'||c>'9'){if(c=='-')f=-1;c=getchar();}
	while(c>='0'&&c<='9') x=(x<<1)+(x<<3)+(c^'0'),c=getchar();
	return x*f;
}
bool chk(ri a,ri b,ri c,ri d){
	if(a+b==c+d)return 1;
	if(a-b==c-d)return 1;
	if(abs(a-c)+abs(b-d)<=3)return 1;
	return 0;
}
signed main()
{
	ri a1=read(),b1=read(),a2=read(),b2=read();
	if(a1==a2&&b1==b2){
		puts("0");
		return 0;
	}
	if(chk(a1,b1,a2,b2)){
		puts("1");
		return 0;
	}
	rep(x,a1-3,a1+3)rep(y,b1-3,b1+3){
		if(abs(a1-x)+abs(b1-y)<=3){
			if(chk(x,y,a2,b2)){
				puts("2");
				return 0;
			}
		}
	}
	rep(x,a2-3,a2+3)rep(y,b2-3,b2+3){
		if(abs(a2-x)+abs(b2-y)<=3){
			if(chk(x,y,a1,b1)){
				puts("2");
				return 0;
			}
		}
	}
	if((a1+a2+b1+b2)%2==0){
		puts("2");
		return 0;
	}
	puts("3");
	return 0;
}
/*
1353 1025 3426 458
9 2 46 17
10 4 3 17
6 8 9 1
*/


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

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

	int64_t count=0;
	int i,j,k;
	for (i=1;i<=kk;++i)
	{
		for (j=1;j<=kk;++j)
		{
			for (k=1;k<=kk;++k)
			{
				if (i*j*k<=kk)
				{
					++count;
				}
				else
				{
					break;
				}
			}
			if (i*j>kk)
			{
				break;
			}
		}
	}
	cout << count << endl;
}

#include <bits/stdc++.h>
#define FOR(i, a, n) for (int i = a; i < n; i++)
#define REP(w, n) FOR(w, 0, n)
using namespace std;
typedef long long ll;
/* UnionFind：素集合系管理の構造体(union by size)
    isSame(x, y): x と y が同じ集合にいるか。 計算量はならし O(α(n))
    unite(x, y): x と y を同じ集合にする。計算量はならし O(α(n))
    treeSize(x): x を含む集合の要素数。
*/
struct UnionFind
{
	vector<int> size, parents;
	UnionFind() {}
	UnionFind(int n)
	{ // make n trees.
		size.resize(n, 0);
		parents.resize(n, 0);
		for (int i = 0; i < n; i++)
		{
			makeTree(i);
		}
	}
	void makeTree(int x)
	{
		parents[x] = x; // the parent of x is x
		size[x] = 1;
	}
	bool isSame(int x, int y) { return findRoot(x) == findRoot(y); }
	bool unite(int x, int y)
	{
		x = findRoot(x);
		y = findRoot(y);
		if (x == y)
			return false;
		if (size[x] > size[y])
		{
			parents[y] = x;
			size[x] += size[y];
		}
		else
		{
			parents[x] = y;
			size[y] += size[x];
		}
		return true;
	}
	int findRoot(int x)
	{
		if (x != parents[x])
		{
			parents[x] = findRoot(parents[x]);
		}
		return parents[x];
	}
	int treeSize(int x) { return size[findRoot(x)]; }
};

// グループ数える関数
int countTree(UnionFind tree, int n)
{
	set<int> group;
	REP(i, n)
	{
		group.insert(tree.findRoot(i));
	}
	return (group.size());
}
int main()
{
	int n;
	cin >> n;
	vector<ll> a(2 * 100000);
	REP(i, n) { cin >> a[i]; }
	UnionFind tree(2 * 100000);
	REP(i, n / 2)
	{
		if (a[i] != a[n - i - 1])
		{
			tree.unite(a[i] - 1, a[n - i - 1] - 1);
		}
	}
	ll ans = 0;
	vector<ll> b(2 * 100000);
	REP(i, 2 * 100000)
	{
		if (b[tree.findRoot(i)] != 1)
		{

			ans += tree.treeSize(i) - 1;
			b[tree.findRoot(i)] = 1;
		}
	}
	cout << ans << endl;
	return (0);
}


#include<iostream>
#include<algorithm>
#include<string>
#include<vector>
#include<cstdlib>
#include<queue>
#include<set>
#include<cstdio>
#include<map>
#include<cassert>

using namespace std;

#define ll long long
#define reps(i, a, b) for(int i = a; i < b; i++)
#define rreps(i, a, b) for(int i = a-1; i >= b; i--)
#define rep(i, n) reps(i, 0, n)
#define rrep(i, n) rreps(i, n, 0)
#define P pair<int, int>
#define vec vector<int>
#define mat vector<vec>

const ll mod = 1000000007;
const int INF = 1001001001;

vec determined;
int h, w;
int a, b;
int ans = 0;

int f(int x, int y) {return x * w + y;}
P f_i(int pos) {return P(pos/w, pos%w);}

void dfs(int pos){
    if(pos == h*w){
        // cout << a << " " << b << endl;
        // rep(i, h){
        //     rep(j, w){
        //         cout << determined[f(i, j)];
        //     }cout << endl;
        // }cout << endl;
        if(a == 0 && b == 0) ans++;
        return;
    }
    P p = f_i(pos);
    if(determined[pos] != 0){
        dfs(pos+1);
    }else{
        // bを置く
        if(b > 0){
            b--;
            determined[pos] = 1;
            dfs(pos+1);
            determined[pos] = 0;
            b++;
        }

        // aを横に置く
        if(a > 0 && pos%w < w-1 && determined[pos+1] == 0){
            a--;
            determined[pos] = 2;
            determined[f(p.first, p.second+1)] = 2;
            dfs(pos+1);
            determined[pos] = 0;
            determined[f(p.first, p.second+1)] = 0;
            a++;
        }

        // if(pos==2){
        //     cout << a << endl;
        //     cout << b << endl;
        //     cout << pos << endl;
        //     cout << p.first+1 << " " << p.second << endl;
        //     cout << f(p.first+1, p.second) << endl;
        //     // cout << pos/w << endl;
        //     // cout << h-1 << endl;

        // }
        // aを縦に置く
        if(a > 0 && pos/w < h-1){

            a--;
            determined[pos] = 3;
            determined[f(p.first+1, p.second)] = 3;
            dfs(pos+1);
            determined[pos] = 0;
            determined[f(p.first+1, p.second)] = 0;
            a++;
        }
    }

}

int main(){
    cin >> h >> w;
    cin >> a >> b;
    determined = vec(h*w);
    // determined[f(0,0)] = 2;
    // determined[f(0,1)] = 2;
    // a--;
    dfs(0);
    cout << ans << endl;
}


#include <bits/stdc++.h>
using namespace std;
int main() {
	int A, B;
	cin >> A >> B;
	int X = (A + B) / 2, Y = (A - B) / 2;
	printf("%d %d\n", X, Y);
	return 0;
}

/*
=============================================================

------------------Welcome To My Code-------------------------

---------Ankit Kumar || IIITBH || CSE || 2018-2022-----------

=============================================================
*/

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

#define FASTIO  ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0)
#define ll long long int
#define ld long double
#define vll vector<ll>
#define pll pair<ll,ll>
#define vl(p) vector<p>
#define w while
#define For(i,s,x) for(i=s;i<x;i++)
#define Fore(i,s,x) for(i=s;i<=x;i++)
#define FOR(i,x) for(i=0;i<x;i++)
#define Rof(i,s,x) for(i=s;i>=x;i--)
#define all(v) v.begin(),v.end()
#define it(r,v) for(auto r=v.begin();r!=v.end();r++)
#define pb push_back
#define in insert
#define sz size()
#define F first
#define S second
#define nl cout<<"\n"
#define pr(a) cout<<a<<" "
#define pr2(a,b) cout<<a<<" "<<b<<"\n"
#define pr3(a,b,c) cout<<a<<" "<<b<<" "<<c<<"\n"
#define mod 1000000007
map<ll, ll>::iterator itr;
vector<ll>::iterator it, it1;
const double PI = 3.141592653589793238;

int main()
{
	FASTIO;

        ll i,j,k,x,y,z,m,n,a,b,c,c1=0,c2=0,flag=0,sum=0;
	string s1,str;
	map<ll,ll>MAP;
	vector<ll>v;
	set<ll>s;

	cin>>a>>b;

	x=(a+b)/2;
	y=a-x;
	cout<<x<<" "<<y;

}


#include <bits/stdc++.h>
#define int long long
using namespace std;
const int maxN = 2e5+10;
int X[maxN],Y[maxN];
struct node
{
    int k1,b1,k2,b2;
    bool swap;
    node(){k1=k2=1;b1=b2=0;swap=false;}
    node(int a,int b,int c,int d,bool e){k1=a,b1=b,k2=c,b2=d,swap=e;}
    node clockwise()
    {
        if(!swap)return node(-k1,-b1,k2,b2,!swap);
        return node(k1,b1,-k2,-b2,!swap);
    }
    node counterclockwise()
    {
        if(!swap)return node(k1,b1,-k2,-b2,!swap);
        return node(-k1,-b1,k2,b2,!swap);
    }
    node X_symmetric(int p)
    {
        if(!swap)return node(-k1,2*p-b1,k2,b2,swap);
        return node(k1,b1,-k2,2*p-b2,swap);
    }
    node Y_symmetric(int p)
    {
        if(!swap)return node(k1,b1,-k2,2*p-b2,swap);
        return node(-k1,2*p-b1,k2,b2,swap);
    }
}op[maxN];
signed main()
{
    int N,M,Q;
    cin>>N;
    for(int i=1;i<=N;i++)cin>>X[i]>>Y[i];
    cin>>M;
    for(int i=1;i<=M;i++)
    {
        int c;
        cin>>c;
        if(c==1)op[i]=op[i-1].clockwise();
        else if(c==2)op[i]=op[i-1].counterclockwise();
        else
        {
            int val;
            cin>>val;
            if(c==3)op[i]=op[i-1].X_symmetric(val);
            else if(c==4)op[i]=op[i-1].Y_symmetric(val);
        }
    }
    cin>>Q;
    for(int i=1;i<=Q;i++)
    {
        int A,B;
        cin>>A>>B;
        int x=op[A].k1*X[B]+op[A].b1;
        int y=op[A].k2*Y[B]+op[A].b2;
        if(op[A].swap)swap(x,y);
        cout<<x<<" "<<y<<endl;
    }
}

#include <iostream>
#include <vector>
#include <algorithm>
#include <string>
#include <numeric>
#include <utility>
#include <tuple>

#define rep(i, a, b) for (int i = int(a); i < int(b); i++)
using namespace std;
using ll = long long int;
using P = pair<ll, ll>;

// clang-format off
#ifdef _DEBUG_
#define dump(...) do{ cerr << __LINE__ << ":\t" << #__VA_ARGS__ << " = "; PPPPP(__VA_ARGS__); cerr << endl; } while(false)
template<typename T> void PPPPP(T t) { cerr << t; }
template<typename T, typename... S> void PPPPP(T t, S... s) { cerr << t << ", "; PPPPP(s...); }
#else
#define dump(...) do{ } while(false)
#endif
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 T> bool chmin(T &a, T b) { if (a > b) {a = b; return true; } return false; }
template<typename T> bool chmax(T &a, T b) { if (a < b) {a = b; return true; } return false; }
template<typename T> void print(T a) { cout << a << '\n'; }
template<typename T, typename... Ts> void print(T a, Ts... ts) { cout << a << ' '; print(ts...); }
template<typename T> istream &operator,(istream &in, T &t) { return in >> t; }
// clang-format on

#include <array>

using m = array<ll, 3>;
using matrix = array<m, 3>;

matrix calc(matrix a, matrix b) {
    matrix res = {m{0, 0, 0}, m{0, 0, 0}, m{0, 0, 0}};
    rep(i, 0, 3) {
        rep(j, 0, 3) {
            rep(k, 0, 3) {
                res[i][j] += a[i][k] * b[k][j];
            }
        }
    }
    return res;
}

matrix q2() {
    return {m{0, -1, 0}, m{1, 0, 0}, m{0, 0, 1}};
}

matrix q1() {
    return {m{0, 1, 0}, m{-1, 0, 0}, m{0, 0, 1}};
}

matrix q3(ll q) {
    return {m{-1, 0, 2 * q}, m{0, 1, 0}, m{0, 0, 1}};
}

matrix q4(ll q) {
    return {m{1, 0, 0}, m{0, -1, 2 * q}, m{0, 0, 1}};
}

matrix init() {
    return {m{1, 0, 0}, m{0, 1, 0}, m{0, 0, 1}};
}

P solve(matrix mat, P p) {
    return P{mat[0][0] * p.first + mat[0][1] * p.second + mat[0][2], mat[1][0] * p.first + mat[1][1] * p.second + mat[1][2]};
}

void print(matrix m) {
    rep(i, 0, 3) {
        rep(j, 0, 3) {
            cout << m[i][j] << ",";
        }
        cout << endl;
    }
}

int main() {
    cin.tie(nullptr);
    ios::sync_with_stdio(false);
    int n;
    cin, n;
    vector<ll> x(n), y(n);
    rep(i, 0, n) {
        cin, x[i], y[i];
    }
    int m;
    cin, m;
    vector<P> op(m);
    rep(i, 0, m) {
        ll a, b = -1;
        cin, a;
        if (a == 3 || a == 4) {
            cin, b;
        }
        op[i] = P(a, b);
    }
    int q;
    cin, q;
    vector<vector<P>> query(m + 1);
    // index, b
    rep(i, 0, q) {
        int a, b;
        cin, a, b;
        query[a].emplace_back(i, b);
    }
    vector<P> ans(q, P(0, 0));
    matrix mat = init();
    rep(i, 0, m + 1) {
        for (auto [idx, b] : query[i]) {
            ans[idx] = solve(mat, P(x[b - 1], y[b - 1]));
        }
        if (i != m) {
            matrix qmat = init();
            if (op[i].first == 1) {
                qmat = q1();
            } else if (op[i].first == 2) {
                qmat = q2();
            } else if (op[i].first == 3) {
                qmat = q3(op[i].second);
            } else if (op[i].first == 4) {
                qmat = q4(op[i].second);
            }
            mat = calc(qmat, mat);
        }
    }
    for (auto [X, Y] : ans) {
        print(X, Y);
    }
    return 0;
}


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

//#define ACL
#ifdef ACL
#if __has_include(<atcoder/all>)
#include <atcoder/all>
using namespace atcoder;
#endif
#if __has_include("acl-all.h")
#include "acl-all.h" //on Wandbox
using namespace atcoder;
#endif
#endif //#ifdef ACL

typedef long double ld;
typedef long long int ll;
typedef unsigned long long int ull;
typedef vector<int> vi;
typedef vector<char> vc;
typedef vector<bool> vb;
typedef vector<double> vd;
typedef vector<string> vs;
typedef vector<ll> vll;
typedef vector<pair<ll, ll> > vpll;
typedef vector<vector<int> > vvi;
typedef vector<vector<char> > vvc;
typedef vector<vector<string> > vvs;
typedef vector<vector<ll> > vvll;
typedef vector<vector<bool> > vvb;
typedef pair<ll, ll> pll;

#define rep(i, n) for (int i = 0; i < int(n); ++i)
#define rrep(i, n) for (int i = 1; i <= int(n); ++i)
#define irep(it, stl) for (auto it = stl.begin(); it != stl.end(); it++)
#define drep(i, n) for (int i = int(n)-1; i >= 0; --i)

#define MES(a) MES2 a
#define MES2(a0,a1,a2,a3,a4,x,...) x
#define mes_1(x1) cout<<x1<<endl
#define mes_2(x1,x2) cout<<x1<<" "<<x2<<endl
#define mes_3(x1,x2,x3) cout<<x1<<" "<<x2<<" "<<x3<<endl
#define mes_4(x1,x2,x3,x4) cout<<x1<<" "<<x2<<" "<<x3<<" "<<x4<<endl
#define mes_5(x1,x2,x3,x4,x5) cout<<x1<<" "<<x2<<" "<<x3<<" "<<x4<<" "<<x5<<endl
#define mes(...) CHOOSE((__VA_ARGS__,mes_5,mes_4,mes_3,mes_2,mes_1,~))(__VA_ARGS__)

#define CHOOSE(a) CHOOSE2 a
#define CHOOSE2(a0,a1,a2,a3,a4,x,...) x
#define debug_1(x1) cout<<#x1<<": "<<x1<<endl
#define debug_2(x1,x2) cout<<#x1<<": "<<x1<<", "#x2<<": "<<x2<<endl
#define debug_3(x1,x2,x3) cout<<#x1<<": "<<x1<<", "#x2<<": "<<x2<<", "#x3<<": "<<x3<<endl
#define debug_4(x1,x2,x3,x4) cout<<#x1<<": "<<x1<<", "#x2<<": "<<x2<<", "#x3<<": "<<x3<<", "#x4<<": "<<x4<<endl
#define debug_5(x1,x2,x3,x4,x5) cout<<#x1<<": "<<x1<<", "#x2<<": "<<x2<<", "#x3<<": "<<x3<<", "#x4<<": "<<x4<<", "#x5<<": "<<x5<<endl
#define debug(...) CHOOSE((__VA_ARGS__,debug_5,debug_4,debug_3,debug_2,debug_1,~))(__VA_ARGS__)

#define Ynmes(a) (a) ? mes("Yes") : mes("No")
#define YNmes(a) (a) ? mes("YES") : mes("NO")
#define re0 return 0
#define mp(p, q) make_pair(p, q)
#define pb(n) push_back(n)
#define all(a) a.begin(), a.end()
#define rall(a) a.rbegin(), a.rend()
#define Sort(a) sort(a.begin(), a.end())
#define rSort(a) sort(a.rbegin(), a.rend())
#define Rev(a) reverse(a.begin(), a.end())

int dx[8] = { 1, 0, -1, 0, 1, -1, -1, 1 };
int dy[8] = { 0, 1, 0, -1, 1, 1, -1, -1 };
template <class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template <class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }
struct io { io() { ios::sync_with_stdio(false); cin.tie(0); } };
const int INF = INT_MAX;
const ll LLINF = 1LL << 60;
const ll MOD = 1000000007;
const double EPS = 1e-9;

ll fact_mod(ll n, ll mod) {
    ll f = 1; for (ll i = 2; i <= n; i++) f = f * (i % mod) % mod;
    return f;
}

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

ll modncr(ll n, ll r, ll mod) {
    if(r > n-r) r = n-r;
    if(r == 0) return 1;
    ll a = 1;
    rep(i, r) a = a * ((n-i) % mod) % mod;
    ll b = modpow(fact_mod(r, mod), mod-2, mod);
    return (a % mod) * (b % mod) % mod;
}

signed main() {
	ll n;
	string s, t;
	cin >> n >> s >> t;

	ll r = 0;
	vll a(n+1, 0), b(n+1, 0);

	rep(i, n) {
		a[i+1] = a[i] ^ (s[i]-'0');
		b[i+1] = b[i] ^ (t[i]-'0');
	}

	ll sc = 0;
	for(ll tc = 0; tc <= n; tc++) {
		chmax(sc, tc);
		if (a[sc] == b[tc]) continue;
		while (sc+1 <= n && a[sc] == a[sc+1]) {
			sc++;
		}

		if (sc == n) {
			mes(-1);
			re0;
		}

		sc++;

		r += sc-tc;
	}

	mes(r);

}

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

bool solve() {
    ll N;
    cin >> N;
    string S, X;
    cin >> S >> X;
    vector<vector<int>> win(N+1, vector<int>(7)); // 1:win
    win[N][0] = 1;
    ll b = 1;
    for ( int i = N-1; i >= 0; i-- ) {
        ll c = S[i] - '0';
        if ( X[i] == 'T' ) {
            for ( int j = 0; j < 7; j++ ) {
                if ( win[i+1][j] == 1 ) {
                    win[i][j] = 1;
                }
                int jp = (j + 7 - (c * b)%7 ) % 7;
                if ( win[i+1][jp] == 1 ) {
                    win[i][j] = 1;
                }
            }
        } else {
            for ( int j = 0; j < 7; j++ ) {
                int w = 1;
                if ( win[i+1][j] == 0 ) {
                    w = 0;
                }
                int jp = (j + 7 - (c * b)%7 ) % 7;
                if ( win[i+1][jp] == 0 ) {
                    w = 0;
                }
                win[i][j] = w;
            }
        }
        b = b * 10 % 7;
    }
    // bool ans;
    // if ( X[0] == 'T' ) {
    //     ans = false;
    //     for ( int i = 0; i < 7; i++ ) {
    //         if ( win[0][i] ) ans = true;
    //     }
    // } else {
    //     ans = true;
    //     for ( int i = 0; i < 7; i++ ) {
    //         if ( !win[0][i] ) ans = false;
    //     }
    // }

    return win[0][0]==1;
}

int main() {
    string ans = solve() ? "Takahashi" : "Aoki";
    cout << ans << "\n";
    return 0;
}


#include <iostream>

#include <map>
#include <set>
#include <list>
#include <cmath>
#include <deque>
#include <stack>
#include <queue>
#include <array>
#include <bitset>
#include <cstdio>
#include <string>
#include <vector>
#include <random>
#include <chrono>
#include <utility>
#include <numeric>
#include <cstdlib>
#include <cstring>
#include <climits>
#include <sstream>
#include <assert.h>
#include <iomanip>
#include <algorithm>
#include <functional>
#include <unordered_map>

using namespace std;
struct _ { ios_base::Init i; _() { ios_base::sync_with_stdio(false), cin.tie(NULL), cout.tie(NULL); } } _;

#define sim template < class c
#define ris return * this
#define dor > debug & operator <<
#define eni(x) sim > typename \
  enable_if<sizeof dud<c>(0) x 1, debug&>::type operator<<(c i) {
sim > struct rge { c b, e; };
sim > rge<c> range(c i, c j) { return rge<c> {i, j}; }
sim > auto dud(c* x) -> decltype(cerr << *x, 0);
sim > char dud(...);
struct debug {
#ifdef HOME
	~debug() { cerr << endl; }
	eni( != ) cerr << boolalpha << i; ris;
}
eni( == ) ris << range(begin(i), end(i));
}
sim, class b dor(pair < b, c > d) {
	ris << "(" << d.first << ", " << d.second << ")";
}
sim dor(rge<c> d) {
	*this << "[";
	for (auto it = d.b; it != d.e; ++it)
		*this << ", " + 2 * (it == d.b) << *it;
	ris << "]";
}
#else
	sim dor(const c&) { ris; }
#endif
};
#define imie(...) " [" << #__VA_ARGS__ ": " << (__VA_ARGS__) << "] "

#define ff first
#define ss second
#define REP(i,st,en) for (int i = st; i <= en; i++)
#define REPR(i,st,en) for (int i = st; i >= en; i--)

const int MOD = 1e9 + 7;

class MainClass {
public:

	void solve() {

		map<int, int> freq;
		int a, b, c; cin >> a >> b >> c;
		freq[a]++, freq[b]++, freq[c]++;

		if ((freq.size() == 3)) cout << 0;
		else {
			if (freq[a] == 1) cout << a;
			else if (freq[b] == 1) cout << b;
			else cout << c;
		}

		return;
	}
};

int main() {

	int test = 1; //cin >> test;
	for (int tst = 1; tst <= test; ++tst) {
		MainClass Ausmosian;

		Ausmosian.solve();
		cout << "\n";
	}

	return 0;
}

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

int main(){
    int a,b,c;
    cin >> a >> b >> c;
    if(a == b) cout << c << endl;
    else if(b == c) cout << a << endl;
    else if(c == a) cout << b << endl;
    else cout << 0 << endl;
}


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

int main() {
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    cout.tie(nullptr);
    ll n, t, m, res = 0;
    cin >> n >> t;
    vector<ll> a, b;
    for (int i = 0; i < n; i++) {
        ll x; cin >> x;
        if (i & 1) {
            b.push_back(x);
        } else {
            a.push_back(x);
        }
    }
    n = a.size(), m = b.size();
    vector<ll> va, vb;
    for (int i = 1; i < (1 << n); i++) {
        ll sum = 0;
        for (int j = 0; j < n; j++) {
            if (i & (1 << j)) {
                sum += a[j];
            }
        }
        va.push_back(sum);
    }
    for (int i = 1; i < (1 << m); i++) {
        ll sum = 0;
        for (int j = 0; j < m; j++) {
            if (i & (1 << j)) {
                sum += b[j];
            }
        }
        vb.push_back(sum);
    }
    sort(vb.begin(), vb.end());
    for (auto i : va) {
        if (i <= t) res = max(res, i);
        int j = upper_bound(vb.begin(), vb.end(), t - i) - vb.begin();
        if (j > 0) {
            res = max(res, i + vb[j - 1]);
        }
    }
    for (auto i : vb) {
        if (i <= t) {
            res = max(res, i);
        }
    }
    cout << res;
    return 0;
}

#include<bits/stdc++.h>
using namespace std;
#define ll  long long
const ll INF = 10e7+7;
#define rep(i,n) for(int i=0;i<n;i++)
const double pi = acos(-1);
const ll MOD = 1000000007;
ll cnt =0,ans=0;
typedef pair<int , int > P;
//cout << setprecision(11) << fixed;
const int di[] = {0,0,-1,1};
const int dj[] = {1,-1,0,0};

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

  vector<int> a(N);
  rep(i,N) cin >> a[i];

  vector<ll>s,t;
  s = t = {0};

  for(int i=0;i<N;i++){
    for(int j = s.size()-1;j>=0;j--){
      s.push_back(s[j]+a[i]);
    }
    swap(s,t);
  }

  sort(s.begin(),s.end());

  for(auto x : t){
    if(x>T)continue;
    ll si = upper_bound(s.begin(),s.end(),T-x) - s.begin();
    ans=max(ans,x+s[si-1]);
  }
  cout << ans << endl;
}


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

typedef long long ll;
#ifdef LOCAL
    const int N = 105;
#else
    const int N = 2e5 + 105;
#endif
const int INF = 0x3f3f3f3f;
int n, k, tot = 0, Mid;
vector<int> edge[N];
int f[N]; // 离最远的未被覆盖的关键点
int g[N]; // 离最近的已经选择的点
void dfs(int u, int fa){
    f[u] = -INF;
    g[u] = INF;
    for(auto v : edge[u]){
        if(v == fa) continue;
        dfs(v, u);
        f[u] = max(f[u], f[v] + 1);
        g[u] = min(g[u], g[v] + 1);
    }
    f[u] = max(f[u], 0);
    if(f[u] + g[u] <= Mid){
        f[u] = -INF;
    }
    if(f[u] == Mid){
        ++tot;
        f[u] = -INF;
        g[u] = 0;
    }
}
bool check(int mid){
    Mid = mid;
    tot = 0;
    dfs(1, 0);
    tot += f[1] >= 0;
    return tot <= k;
}
void solve() {
    cin >> n >> k;
    for(int i = 1; i < n; ++i){
        int u, v; cin >> u >> v;
        edge[u].push_back(v);
        edge[v].push_back(u);
    }
    int l = 0, r = n, mid, ans = n;
    while(l <= r){
        mid = l + r >> 1;
        if(check(mid)){
            ans = min(ans, mid);
            r = mid - 1;
        }else{
            l = mid + 1;
        }
    }
    cout << ans << endl;
}
int main() {
#ifdef LOCAL
    freopen("in.txt", "r", stdin);
    freopen("out.txt", "w", stdout);
    cout << "start Debug" << endl;
#endif
    int _ = 1;
    // cin >> _;
    for(int i = 1; i <= _; ++i) solve();
}

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

#define REP(i,n) for(int i=0;i<(n);i++)
#define ALL(v) v.begin(),v.end()

struct tree{
  vector<vector<int>> G,son,ancestor;
  vector<int> depth,parent;
  queue<int> que;
  int n,root=-1;
  bool made_lca=false;

  tree(int n_):G(n_),son(n_),parent(n_,-1),depth(n_,-1),ancestor(n_),n(n_){
    for(int i=0;i<n_;i++)ancestor[i].resize(30);
  }

  void add_edge(int u,int v){
    G[u].push_back(v);
    G[v].push_back(u);
  }

  inline void reset_root(){
    root=-1;
    fill(depth.begin(),depth.end(),-1);
    fill(parent.begin(),parent.end(),-1);
    for(auto &p:ancestor)for(int &q:p)q=-1;
    for(auto &p:son)p.resize(0);
    made_lca=false;
  }

  void have_root(int r){
    reset_root();
    root=r;
    que.push(r);
    while(que.size()){
      int p=que.front();que.pop();
      for(int q:G[p]){
        if(parent[p]==q)continue;
        son[p].push_back(q);
        parent[q]=p;
        que.push(q);
      }
    }
  }

  void set_depth(){
    assert(~root);
    depth[root]=0;
    que.push(root);
    while(que.size()){
      int p=que.front();que.pop();
      for(int q:son[p]){
        depth[q]=depth[p]+1;
        que.push(q);
      }
    }
  }

  inline void make_lca(){
    assert(~root);
    if(depth[root]<0)set_depth();
    for(int i=0;i<G.size();i++)ancestor[i][0]=parent[i];
    for(int j=1;j<30;j++)
      for(int i=0;i<G.size();i++)
        if(~ancestor[i][j-1])
          ancestor[i][j]=ancestor[ancestor[i][j-1]][j-1];
    made_lca=1;
  }

  int lca(int u,int v){
    if(!made_lca)make_lca();
    if(depth[u]>depth[v])swap(u,v);
    int diff=depth[v]-depth[u],cnt=0;
    while(diff){
      if(diff&1)v=ancestor[v][cnt];
      cnt++;
      diff>>=1;
    }
    if(u==v)return u;
    for(int k=28;k>=0;k--)
      if(ancestor[u][k]!=ancestor[v][k])
        u=ancestor[u][k],v=ancestor[v][k];
    return ancestor[u][0];
  }
};
typedef pair<int,int> P;
const double TIMELIMIT=2.98*CLOCKS_PER_SEC;
int ans=234567;
priority_queue<P> que;
queue<P> tmp;

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

int main(){
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
  clock_t start = clock();
  int n,k;cin>>n>>k;
  tree t(n);
  REP(i,n-1){
    int a,b;cin>>a>>b;a--;b--;
    t.add_edge(a,b);
  }
  int ans=n;
  t.have_root(0);
  t.set_depth();
  int ng=-1,ok=n;
  while(ok-ng>1){
    int m=(ok+ng)>>1;
    //cout<<"M:"<<m<<endl;
    vector<int> used(n,-1),in(n);
    REP(i,n)in[i]=t.son[i].size();
    while(que.size())que.pop();
    REP(i,n)if(!in[i])que.push(P(t.depth[i],i));
    int cnt=0;
    while(que.size()){
      P quenonaka=que.top();que.pop();
      int p=quenonaka.second,D=quenonaka.second;
      if(~used[p])continue;//ここは今回のやつを助けるやつ探すところ
      cnt++;if(cnt>k){
        //cout<<"WA"<<p<<endl;
        break;
      }
      int now=p;
      for(int i=0;i<m&&now!=t.root;i++)now=t.parent[now];
      //cout<<p<<" "<<now<<endl;
      while(tmp.size())tmp.pop();
      tmp.push(P(now,m));//nowが今回新しく塗るやつ
      used[now]=m;if(now!=t.root&&!--in[t.parent[now]])que.push(P(t.depth[t.parent[now]],t.parent[now]));
      while(tmp.size()){
        P q=tmp.front();tmp.pop();
        int v=q.first,aa=q.second;
        for(int w:t.son[v]){
          if(used[w]<0){
            used[w]=aa-1;
            if(aa>1)tmp.push(P(w,aa-1));
          }
          else if(used[w]<aa-1){
            used[w]=aa-1;
            tmp.push(P(w,aa-1));
          }
        }
        if(v!=t.root){
          int PA=t.parent[v];
          if(used[PA]<0){
            used[PA]=aa-1;
            if(PA!=t.root&&!--in[t.parent[PA]])que.push(P(t.depth[t.parent[PA]],t.parent[PA]));
            if(aa>1)tmp.push(P(PA,aa-1));
          }
          else if(used[PA]<aa-1){
            used[PA]=aa-1;
            tmp.push(P(PA,aa-1));
          }
        }
      }
    }
    if(cnt>k)ng=m;
    else ok=m;
  }
  cout<<ok<<endl;
}


#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define P pair<ll,ll>
#define FOR(I,A,B) for(ll I = ll(A); I < ll(B); ++I)
#define FORR(I,A,B) for(ll I = ll((B)-1); I >= ll(A); --I)
#define TO(x,t,f) ((x)?(t):(f))
#define SORT(x) (sort(x.begin(),x.end())) // 0 2 2 3 4 5 8 9
#define POSL(x,v) (lower_bound(x.begin(),x.end(),v)-x.begin()) //xi>=v  x is sorted
#define POSU(x,v) (upper_bound(x.begin(),x.end(),v)-x.begin()) //xi>v  x is sorted
#define NUM(x,v) (POSU(x,v)-POSL(x,v))  //x is sorted
#define REV(x) (reverse(x.begin(),x.end())) //reverse
ll gcd_(ll a,ll b){if(a%b==0)return b;return gcd_(b,a%b);}
ll lcm_(ll a,ll b){ll c=gcd_(a,b);return ((a/c)*b);}
#define NEXTP(x) next_permutation(x.begin(),x.end())
const ll INF=ll(1e16)+ll(7);
const ll MOD=1000000007LL;
#define out(a) cout<<fixed<<setprecision((a))
//tie(a,b,c) = make_tuple(10,9,87);
#define pop_(a) __builtin_popcount((a))
ll keta(ll a){ll r=0;while(a){a/=10;r++;}return r;}
#define num_l(a,v) POSL(a,v) //v未満の要素数
#define num_eql(a,v) POSU(a,v) //v以下の要素数
#define num_h(a,v) (a.size() - POSU(a,v)) //vより大きい要素数
#define num_eqh(a,v) (a.size() - POSL(a,v)) //v以上の要素数
// static_cast< long long ll >

int N = 30*30;
int L = 30;
// (i,j) i個下 , j個右
int ind(int a,int b){
	return a*L + b;
}

//vector< vector<string> > S(N,vector<string>(N));
vector<vector<long double>> H(L,vector<long double>(L,5000.0));
vector<vector<long double>> V(L,vector<long double>(L,5000.0));

// 上は下より(i,j)のiが小さい　右は左より(i,j)のjが大きい

// 順路正の向きで
const int From_U = 0;//上から来た
const int From_D = 1;//下から来た
const int From_L = 2;//左から来た
const int From_R = 3;//右から来た

// 復元
string make_char = "DURL";
const int dy[] = {-1,1,0,0};
const int dx[] = {0,0,-1,1};

int main(){
	int sy,sx,ty,tx;
	int s,t;
	FOR(k,0,1000){
		cin >> sy >> sx >> ty >> tx;

		int dir_y = 1;
		int dir_x = 1;
		if(sy > ty) dir_y = -1;
		if(sx > tx) dir_x = -1;

		// (i,j) には (i - dir_y , j) or (i , j - dir_x) から行く

		vector< vector<long double> > score(L,vector<long double>(L,INF));
		vector< vector<int> > from(L,vector<int>(L,-1));

		score[sy][sx] = 0;
		for(int y=sy;(y-dir_y)!=ty;y+=dir_y){
			for(int x=sx;(x-dir_x)!=tx;x+=dir_x){
				//cout << y << " " << x << endl;

				if(y==sy && x==sx) continue;
				long double a = INF,b = INF;
				if(y != sy) a = score[y-dir_y][x] + H[min(y-dir_y,y)][x];
				if(x != sx) b = score[y][x-dir_x] + V[y][min(x,x-dir_x)];

				if(a < b){
					from[y][x] = (dir_y == 1 ? From_U : From_D );
					score[y][x] = a;
				}else{
					from[y][x] = (dir_x == 1 ? From_L : From_R );
					score[y][x] = b;
				}

			}
		}
		//return 0;
		//cout << "95" << endl;

		string T;
		int y=ty,x=tx;
		while(y!=sy || x!=sx){
			int a = from[y][x];
			T += make_char[a];
			assert(0 <= a && a <= 3);
			y += dy[a];
			x += dx[a];
			//cout << "from[" << y <<  "][" << x << "] = "  << a << endl;
		}

		//cout << "106" << endl;

		//cout << T << endl;
		REV(T);
		/*{ // チェック
			assert(T.size() == (abs(sy-ty)+abs(sx-tx)));
			int ud=0,lr=0;
			for(auto c:T){
				if(c == 'U' || c == 'D') ud++;
				if(c == 'L' || c == 'R') lr++;
			}
			assert(abs(sy-ty) == ud);
			assert(abs(sx-tx) == lr);
		}*/
		cout << T << endl;
		cout << flush;

		long double score_now,r;
		cin >> score_now;

		r = pow( score_now / score[ty][tx] , 1.0 - 1.0*(abs(sy-ty) + abs(sx-tx)) / 80.0 ) * exp(-(1000.0 - 1.0*k)/1000.0);

		y=ty,x=tx;
		while(y!=sy || x!=sx){
			int a = from[y][x];
			int by = y + dy[a],bx = x + dx[a];
			if(by != y){
				H[min(by,y)][x] *= r;
			}else{
				V[y][min(bx,x)] *= r;
			}
			y += dy[a];
			x += dx[a];
		}
	}
}

#include <algorithm>
#include <climits> // FOO_MAX, FOO_MIN
#include <cmath>
#include <cstdlib> // abs(int)
#include <deque>
#include <iomanip>
#include <iostream>
#include <map>
#include <numeric>
#include <string>
#include <unordered_map>
#include <vector>

using namespace std;

#define roundup(n, d) (((n) + ((d)-1)) / (d))
#define assign_max(into, compared) (into = max((into), (compared)))
#define assign_min(into, compared) (into = min((into), (compared)))
#define rep(i, n) for (long long i = 0; i < (long long)n; ++i)
#define v_in(v)        \
    for (auto&& i : v) \
    cin >> i
#define vv_in(vv) rep(I, (long long)vv.size()) for (auto&& J : vv[I]) cin >> J
#define FAST_IO                  \
    ios::sync_with_stdio(false); \
    cin.tie(nullptr);
#define fix(n) fixed << setprecision(n)
#define ALL(v) v.begin(), v.end()
#define printvar(x) cout << #x << ":" << x << endl

#define PI 3.14159265358979323846

typedef long long ll;
using ull = unsigned long long;
using vll = vector<long long>;
using vvll = vector<vector<long long>>;

map<pair<ll, ll>, ll> m;

ll patterns(ll a, ll b) {
    if (a == 0 && b == 0) return 0;
    if (a == 0 || b == 0) return 1;
    if (m.find(make_pair(a, b)) != m.end()) {
        return m[make_pair(a, b)];
    }

    ll result = patterns(a - 1, b) + patterns(a, b - 1);
    m[make_pair(a, b)] = result;
    return result;
}

string binsearch(ll a, ll b, ll k) {
    if (a == 0 && b == 0) return "";
    if (a == 0 || b == 0) {
        char appendch = a == 0 ? 'b' : 'a';
        string s;
        rep(i, max(a, b)) {
            s += appendch;
        }
        return s;
    }

    ll max_pattern = patterns(a - 1, b);

    if (k <= max_pattern) {
        // cout << "\"a\" + binsearch(a - 1, b, k)" << endl;
        return "a" + binsearch(a - 1, b, k);
    } else {
        // cout << "\"b\" + binsearch(a, b - 1, k - max_pattern)" << endl;
        return "b" + binsearch(a, b - 1, k - max_pattern);
    }
}

int main(void) {
    FAST_IO
    ll a, b, k;
    cin >> a >> b >> k;
    cout << binsearch(a, b, k) << endl;

    return 0;
}


#include<iostream>
#include<iomanip>
#include<cassert>
#include<math.h>
#include<complex>
#include<algorithm>
#include<utility>
#include<queue>
#include<stack>
#include<string.h>
#include<string>
#include<set>
#include<map>
#include<unordered_map>
#include<functional>
#include<vector>
#include<bitset>
using namespace std;
typedef long long ll;
typedef pair<ll,ll> P;
const ll INF=2e18;
const ll MOD=1e9+7;

ll H,W;
string s[2010];
ll vertical[2010],horizontal[2010],diagonal[4010];
int main(){
    cin>>H>>W;
    for(ll i=0;i<H;i++)cin>>s[i];

    vertical[0]=horizontal[0]=diagonal[W]=1;
    for(ll i=0;i<H;i++){
        for(ll j=0;j<W;j++){
            if(i==0 && j==0)continue;
            if(s[i][j]=='#'){
                horizontal[i]=0;
                vertical[j]=0;
                diagonal[i-j+W]=0;
                continue;
            }
            ll now=horizontal[i]+vertical[j]+diagonal[i-j+W];
            now%=MOD;
            if(i==H-1 && j==W-1){
                cout<<now<<endl;
                return 0;
            }
            horizontal[i]+=now;
            horizontal[i]%=MOD;
            vertical[j]+=now;
            vertical[j]%=MOD;
            diagonal[i-j+W]+=now;
            diagonal[i-j+W]%=MOD;
        }
    }

    return 0;
}

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

typedef tree<int, null_type, less<int>, rb_tree_tag,
             tree_order_statistics_node_update>
    ordered_set;
#define pf                  printf
#define sf(a)               scanf("%d",&a)
#define sfl(a)              scanf("%lld",&a)
#define sff(a,b)            scanf("%d %d",&a,&b)
#define sffl(a,b)           scanf("%lld %lld",&a,&b)
#define sfff(a,b,c)         scanf("%d %d %d",&a,&b,&c)
#define sfffl(a,b,c)        scanf("%lld %lld %lld",&a,&b,&c)
#define sffff(a,b,c,d)      scanf("%d %d %d %d",&a,&b,&c,&d)
#define sffffl(a,b,c,d)     scanf("%lld %lld %lld %lld",&a,&b,&c,&d)
#define sfffff(a,b,c,d,e)   scanf("%d %d %d %d %d",&a,&b,&c,&d,&e)
#define sfffffl(a,b,c,d,e)  scanf("%lld %lld %lld %lld %lld",&a,&b,&c,&d,&e)
#define sfc(a)              scanf("%c",&a)
#define pii                 pair<int,int>
#define ms(a,b)             memset(a,b,sizeof(a))
#define pb(a)               push_back(a)
#define pbp(a,b)            push_back({a,b})
#define db                  double
#define ft                  float
#define ll                  long long
#define ull                 unsigned long long
#define pii                 pair<int,int>
#define ff                  first
#define ss                  second
#define sz(x)               x.size()
#define all(x)              x.begin(),x.end()
#define CIN                 ios_base::sync_with_stdio(0); cin.tie(0)
#define max3(a, b, c)       max(a, b) > max(b, c) ? max(a, b) : max(b, c)
#define min3(a, b, c)       min(a, b) < min(b, c) ? min(a, b) : min(b, c)
#define for0(i,n)           for(int i=0;i<n;i++)
#define for1(i,n)           for(int i=1;i<=n;i++)
#define forrev(i,n)         for(int i=n-1; i>=0; i--)
#define forab(i,a,b)        for(int i=a;i<=b;i++)
#define forba(i,b,a)        for(int i=b;i>=a;i--)
#define stlloop(x)          for(__typeof(x.begin()) it=x.begin();it!=x.end();it++)
#define gcd(a, b)           __gcd(a, b)
#define lcm(a, b)           ((a)*((b)/gcd(a,b)))
#define case1(z)            cout<<"Case "<<z<<": "
#define case2(z)            printf("Case %d: ",z)
#define PI                  acos(-1) //3.14159265358979323846264338328
#define valid(tx,ty)        tx>=0 && tx<row && ty>=0 && ty<col
#define intlim              2147483648
#define N                   2005
#define inf                 100000008
#define mod                 1000000007

/*------------------------------Graph Moves----------------------------*/
//const int fx[]={+1,-1,+0,+0};
//const int fy[]={+0,+0,+1,-1};
//const int fx[]={+0,+0,+1,-1,-1,+1,-1,+1};   // Kings Move
//const int fy[]={-1,+1,+0,+0,+1,+1,-1,-1};  // Kings Move
//const int fx[]={-2, -2, -1, -1,  1,  1,  2,  2};  // Knights Move
//const int fy[]={-1,  1, -2,  2, -2,  2, -1,  1}; // Knights Move
/*---------------------------------------------------------------------*/
char a[N][N];
ll h[N][N],v[N][N],d[N][N],o[N][N],dp[N][N];
int main()
{
    ll n,m,i,j;
    cin>>n>>m;
    for1(i,n)
    {
        for1(j,m)
        {
            cin>>a[i][j];
            o[i][j] = a[i][j]=='#';
        }
    }
    h[1][1] = 1,v[1][1] = 1,d[1][1] = 1,o[1][1] = 1;
    for1(i,n)
    {
        for1(j,m)
        {
            if(o[i][j])continue;
            dp[i][j] += v[i-1][j];
            dp[i][j] %= mod;
            v[i][j] = v[i-1][j];

            dp[i][j] += h[i][j-1];
            dp[i][j] %= mod;
            h[i][j] = h[i][j-1];

            dp[i][j] += d[i-1][j-1];
            dp[i][j] %= mod;
            d[i][j] = d[i-1][j-1];

            v[i][j] += dp[i][j];
            v[i][j] %= mod;
            h[i][j] += dp[i][j];
            h[i][j] %= mod;
            d[i][j] += dp[i][j];
            d[i][j] %= mod;
        }
    }
    cout<<dp[n][m]<<endl;
	return 0;
}


#include<bits/stdc++.h>
#define L(i, j, k) for(int i = (j); i <= (k); i++)
#define R(i, j, k) for(int i = (j); i >= (k); i--)
#define ll long long
#define sz(a) ((int) a.size())
#define vi vector<int>
using namespace std;
const int N = 5e5 + 7, inf = 1e9 + 7;
int n, a[N];
ll m;
int main() {
	ios::sync_with_stdio(false);
	cin.tie(0); cout.tie(0);
	cin >> n >> m;
	L(i, 1, 100) {
		int k = (100 + n) * i / 100;
		a[k] = true;
	}
	ll all = n + 100, o = (m - 1) / n, cnt = m - o * n, ns = o * all;
	L(i, 1, all) if(!a[i] && cnt)
		ns = o * all + i, --cnt;
	cout << ns << "\n";
	return 0;
}

#pragma GCC optimize("O3")
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <string>
#include <cstring>
#include <deque>
#include <list>
#include <queue>
#include <stack>
#include <vector>
#include <utility>
#include <algorithm>
#include <map>
#include <set>
#include <complex>
#include <cmath>
#include <limits>
#include <cfloat>
#include <climits>
#include <ctime>
#include <cassert>
#include <numeric>
#include <fstream>
#include <functional>
#include <bitset>
using namespace std;

using ll = long long;
using P = pair<int, int>;
using T = tuple<int, int, int>;

template <class T> inline T chmax(T &a, const T b) {return a = (a < b) ? b : a;}
template <class T> inline T chmin(T &a, const T b) {return a = (a > b) ? b : a;}

constexpr int MOD = 1e9 + 7;
constexpr int inf = 1e9;
constexpr long long INF = 1e18;

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

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

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

    ll t, n; cin>>t>>n;

    if((100 * n) % t == 0){
        cout << (100 * n) / t + (100 * n) / t * t / 100 - 1 << endl;
    }
    else{
        cout << (100 * n) / t + (100 * n) / t * t / 100 + 1 << endl;
    }

    return 0;
}


#pragma GCC optimize("Ofast")
#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 _roverload(_a1, _a2, _a3, name, ...) name
#define _rep(i, n) repi(i, 0, n)
#define repi(i, a, b) for (int i = int(a); i < int(b); ++i)
#define rep(...) _roverload(__VA_ARGS__, repi, _rep, )(__VA_ARGS__)
#define _rrep(i, n) rrepi(i, 0, n)
#define rrepi(i, a, b) for (int i = (int)(b)-1; i >= (int)(a); --i)
#define rrep(...) _roverload(__VA_ARGS__, rrepi, _rrep, )(__VA_ARGS__)
#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;
}
void print() { cout << '\n'; }
template <class T>
void print(const vector<T> &v) {
    bool f = false;
    for (const auto &e : v) {
        if (f) cout << ' ';
        cout << e;
        f = true;
    }
    cout << '\n';
}
template <class... T>
void print(const T &...args) {
    bool f = false;
    for (const auto &e : {args...}) {
        if (f) cout << ' ';
        cout << e;
        f = true;
    }
    cout << '\n';
}
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
pi dfs(vv<int> &g, int u, int p = -1) {
    int dist = -1, idx = -1;
    for (auto v : g[u]) {
        if (v == p) continue;
        auto [d, i] = dfs(g, v, u);
        if (chmax(dist, d)) {
            idx = i;
        }
    }
    if (dist == -1) {
        return {0, u};
    } else {
        return {dist + 1, idx};
    }
}
vi res;
bool path(vv<int> &g, int u, int u2, int p = -1) {
    if (u == u2) {
        res.emplace_back(u2);
        return true;
    }
    bool r = false;
    for (auto v : g[u]) {
        if (v == p) continue;
        bool f = path(g, v, u2, u);
        r |= f;
        if (f) {
            res.emplace_back(u);
        }
    }
    return r;
}
int now = 1;
void dfs2(vv<int> &to, vi &ans, vi &route, int u, bool flag, int p = -1) {
    ans[u] = now++;
    for (auto v : to[u]) {
        if (v == p) continue;
        if (route.size() && v == route.back()) continue;
        dfs2(to, ans, route, v, false, u);
    }
    if (flag && route.size()) {
        int v = route.back();
        route.pop_back();
        dfs2(to, ans, route, v, true, u);
    }
    now++;
}
int main() {
    int n;
    cin >> n;
    vv<int> to(n);
    rep(i, n - 1) {
        int a, b;
        cin >> a >> b;
        a--;
        b--;
        to[a].emplace_back(b);
        to[b].emplace_back(a);
    }
    auto [dist, u1] = dfs(to, 0);
    auto [dist2, u2] = dfs(to, u1);
    path(to, u1, u2);
    res.pop_back();
    vi ans(n);
    dfs2(to, ans, res, u1, true);
    print(ans);
}

#include <iostream>
#include <cstdio>
#include <algorithm>
#include <cstring>
#include <vector>

using namespace std;

inline int read () {
	int ret = 0, t = 1;
	char c = getchar();
	while ((c < '0' || c > '9') && c != '-') c = getchar();
	if (c == '-') t = -1, c = getchar();
	while (c >= '0' && c <= '9') ret = ret * 10 + c - '0', c = getchar();
	return ret * t;
}

const int MAXN = 200200;
int n, fa[MAXN][22]; vector <int> E[MAXN];
int dep[MAXN], wson[MAXN];
void dfs (int x, int f) {
	dep[x] = dep[f] + 1; fa[x][0] = f;
	for (auto i: E[x]) if (i != f) dfs(i, x);
}

int dis (int u, int v) {
	int ret = dep[u] + dep[v], i;
	if (dep[u] < dep[v]) swap(u, v);
	for (i = 20; i >= 0; i--) if (dep[fa[u][i]] >= dep[v]) u = fa[u][i];
	if (u == v) return ret - 2 * dep[u];
	for (i = 20; i >= 0; i--) if (fa[u][i] != fa[v][i]) u = fa[u][i], v = fa[v][i];
	u = fa[u][0]; return ret - 2 * dep[u];
}

int las = 0, ans[MAXN];
void calc (int x, int f) {
	ans[x] = ans[las] + dis(las, x); las = x;
	for (auto i: E[x]) if (i != f && i != wson[x]) calc(i, x);
	if (wson[x]) calc(wson[x], x);
}

int main () {
	n = read(); int i, j;
	for (i = 1; i < n; i++) {
		int u = read(), v = read();
		E[u].push_back(v), E[v].push_back(u);
	}
	dfs(1, 0);
	for (i = 1, j = 0; i <= n; i++) if (dep[j] < dep[i]) j = i;
	int rt = j; dfs(j, 0);
	for (i = 1, j = 0; i <= n; i++) if (dep[j] < dep[i]) j = i;
	for (i = j; i; i = fa[i][0]) wson[fa[i][0]] = i;
	for (i = 1; i <= 20; i++) for (j = 1; j <= n; j++) fa[j][i] = fa[fa[j][i - 1]][i - 1];
	calc(rt, 0);
	for (i = 1; i <= n; i++) printf("%d ", ans[i]);
	return 0;
}


#include <bits/stdc++.h>
using namespace std;
/* typedef */
typedef long long ll;
typedef pair<int, int> pii;
/* constant */
const int MOD = 998244353;
/* struct for mod Calculation*/
struct mint {
        ll x;
        mint(ll x = 0):x((x % MOD + MOD) % MOD) {}
        mint operator-() const { return mint(-x); }
        mint& operator+=(const mint a) { if ((x += a.x) >= MOD) x -= MOD; return *this; }
        mint& operator-=(const mint a) { if ((x += MOD - a.x) >= MOD) x -= MOD; return *this; }
        mint& operator*=(const mint a) { (x *= a.x) %= MOD; return *this; }
        mint operator+(const mint a) const { mint res(*this); return res += a; }
        mint operator-(const mint a) const { mint res(*this); return res -= a; }
        mint operator*(const mint a) const { mint res(*this); return res *= a; }
        mint pow(ll t) const {
            if(!t) return 1;
            mint res = pow(t/2);
            res *= res;
            return (t&1)?res*x:res;
        }
        // for prime mod
        mint inv() const { return pow(MOD - 2); }
        mint& operator/=(const mint a) { return (*this) *= a.inv(); }
        mint operator/(const mint a) const { mint res(*this); return res /= a; }
        bool operator<(const mint& a)const{ return x < a.x;}
        bool operator==(const mint& a)const{ return x == a.x;}
};
mint ex(mint x, ll t) { return x.pow(t);}
istream& operator>>(istream& is, const mint& a) { return is >> a.x;}
ostream& operator<<(ostream& os, const mint& a) { return os << a.x;}
/* global variables */
/* function */
/* main */
int main(){
    ll a, b, c;
    cin >> a >> b >> c;
    mint A = a;
    mint B = b;
    mint C = c;
    mint two = 2;
    mint inv_two = two.inv();
    mint ans = inv_two * A * (A + 1) * inv_two * B * (B + 1) * inv_two * C * (C + 1);
    cout << ans << '\n';
}

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

/*
 * @title ModInt
 * @docs md/util/ModInt.md
 */
template<long long& mod> class ModInt {
public:
    long long x;
    constexpr ModInt():x(0) {}
    constexpr ModInt(long long y) : x(y>=0?(y%mod): (mod - (-y)%mod)%mod) {}
    ModInt &operator+=(const ModInt &p) {if((x += p.x) >= mod) x -= mod;return *this;}
    ModInt &operator+=(const long long y) {ModInt p(y);if((x += p.x) >= mod) x -= mod;return *this;}
    ModInt &operator+=(const int y) {ModInt p(y);if((x += p.x) >= mod) x -= mod;return *this;}
    ModInt &operator-=(const ModInt &p) {if((x += mod - p.x) >= mod) x -= mod;return *this;}
    ModInt &operator-=(const long long y) {ModInt p(y);if((x += mod - p.x) >= mod) x -= mod;return *this;}
    ModInt &operator-=(const int y) {ModInt p(y);if((x += mod - p.x) >= mod) x -= mod;return *this;}
    ModInt &operator*=(const ModInt &p) {x = (x * p.x % mod);return *this;}
    ModInt &operator*=(const long long y) {ModInt p(y);x = (x * p.x % mod);return *this;}
    ModInt &operator*=(const int y) {ModInt p(y);x = (x * p.x % mod);return *this;}
    ModInt &operator^=(const ModInt &p) {x = (x ^ p.x) % mod;return *this;}
    ModInt &operator^=(const long long y) {ModInt p(y);x = (x ^ p.x) % mod;return *this;}
    ModInt &operator^=(const int y) {ModInt p(y);x = (x ^ p.x) % mod;return *this;}
    ModInt &operator/=(const ModInt &p) {*this *= p.inv();return *this;}
    ModInt &operator/=(const long long y) {ModInt p(y);*this *= p.inv();return *this;}
    ModInt &operator/=(const int y) {ModInt p(y);*this *= p.inv();return *this;}
    ModInt operator=(const int y) {ModInt p(y);*this = p;return *this;}
    ModInt operator=(const long long y) {ModInt p(y);*this = p;return *this;}
    ModInt operator-() const {return ModInt(-x); }
    ModInt operator++() {x++;if(x>=mod) x-=mod;return *this;}
    ModInt operator--() {x--;if(x<0) x+=mod;return *this;}
    ModInt operator+(const ModInt &p) const { return ModInt(*this) += p; }
    ModInt operator-(const ModInt &p) const { return ModInt(*this) -= p; }
    ModInt operator*(const ModInt &p) const { return ModInt(*this) *= p; }
    ModInt operator/(const ModInt &p) const { return ModInt(*this) /= p; }
    ModInt operator^(const ModInt &p) const { return ModInt(*this) ^= p; }
    bool operator==(const ModInt &p) const { return x == p.x; }
    bool operator!=(const ModInt &p) const { return x != p.x; }
    ModInt inv() const {int a=x,b=mod,u=1,v=0,t;while(b > 0) {t = a / b;swap(a -= t * b, b);swap(u -= t * v, v);} return ModInt(u);}
    ModInt pow(long long n) const {ModInt ret(1), mul(x);for(;n > 0;mul *= mul,n >>= 1) if(n & 1) ret *= mul;return ret;}
    friend ostream &operator<<(ostream &os, const ModInt &p) {return os << p.x;}
    friend istream &operator>>(istream &is, ModInt &a) {long long t;is >> t;a = ModInt<mod>(t);return (is);}
};
long long mod;
using mint = ModInt<mod>;

int main() {
    cin.tie(0);ios::sync_with_stdio(false);
    int N,K;
    cin >> N >> K >> mod;

    int L = N*(N-1)/2*K;
    vector<vector<mint>> dp(N,vector<mint>(L+1,0));
    dp[0][0]=1;
    for(int i=1;i<N;++i) {
        dp[i]=dp[i-1];
        //jの値をj,j+1*i,j+2*i,...,j+K*iに加算したい
        //累積和で考えると、j+(K+1)*i,j+(K+2)*i,...に足しすぎる。
        //imosを考えると先に j+(K+1)*iからjの分を引けば良い。
        for(int j=L; 0 <= j; --j) if(j + (K+1)*i <= L) dp[i][j + (K+1)*i] -= dp[i][j];
        for(int j=0;j<=L; ++j) if(j + i <= L) dp[i][j+i] += dp[i][j];
    }
    vector<mint> ans(N+1);
    for(int i=1;i<=N;++i) {
        int l = i-1;
        int r = N-i;
        mint sum = 0;
        for(int j=0;j<=L;++j) sum += dp[l][j]*dp[r][j];
        ans[i]=sum*(K+1) - 1;
    }
    for(int i=1;i<=N;++i) {
        cout << ans[i] << "\n";
    }

    return 0;
}


#include <bits/stdc++.h>
using namespace std;using ll=long long;using uint=unsigned int;using pii=pair<int,int>;using pll=pair<ll,ll>;using ull = unsigned long long;using ld=long double;template<typename T>void _(const char*s,T h){cerr<<s<<" = "<<h<<"\n";}template<typename T,typename...Ts>void _(const char*s,T h,Ts...t){int b=0;while(((b+=*s=='(')-=*s==')')!=0||*s!=',')cerr<<*s++;cerr<<" = "<<h<<",";_(s+1,t...);}// break continue pop_back 998244353
#define int ll
#define pii pll
#define f first
#define s second
#define pb emplace_back
#define forn(i,n) for(int i=0;i<(n);++i)
#define sz(a)((int)(a).size())
#define sqr(x) ((x)*(x))
struct init{init(){cin.tie(0);iostream::sync_with_stdio(0);cout<<fixed<<setprecision(10);cerr<<fixed<<setprecision(5);}~init(){
#ifdef LOCAL
#define dbg(...) _(#__VA_ARGS__,__VA_ARGS__)
cerr<<"Time elapsed: "<<(double)clock()/CLOCKS_PER_SEC<<"s.\n";
#else
#define dbg(...)
#endif
}}init;template<typename T,typename U>void upx(T&x,U y){if(x<y)x=y;}template<typename T,typename U>void upn(T&x,U y){if(x>y)x=y;}mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
const int N=111;
int a[N],b[N],u[N+N];
int dp[N][N];
void no(){
    cout<<"No\n";
    exit(0);
}
int32_t main(){
    int f=0;
    int n;
    cin>>n;
    for(int i=1;i<=n;++i){
        cin>>a[i]>>b[i];
        if(a[i]!=-1&&b[i]!=-1&&a[i]>=b[i])no();
        if(a[i]!=-1&&u[a[i]])no();
        if(b[i]!=-1&&u[b[i]])no();
        if(a[i]!=-1)u[a[i]]=1;
        if(b[i]!=-1)u[b[i]]=1;
        if(a[i]==-1&&b[i]==-1)f++;
    }
    dp[0][0]=1;
    for(int i=1;i<=n;++i){
        for(int c=0;c<=min(i,f);c++){
            forn(j,i){
                dbg(j);
                memset(u,0,sizeof u);
                int d=i-j,ok=1;
                for(int k=1;ok&&k<=n;++k){
                    int ak=a[k],bk=b[k];
                    if(ak==bk)continue;//-1
                    if(ak!=-1&&ak<=i+i&&ak>j+j+d)ok=0;
                    if(bk!=-1&&bk<=j+j+d&&bk>j+j)ok=0;
                    dbg(ak,bk);
                    if(ak>i+i)continue;
                    if(bk>i+i)continue;
                    if(ak!=-1&&ak<=j+j)continue;
                    if(bk!=-1&&bk<=j+j)continue;
                    if(ak==-1)ak=bk-d;
                    if(bk==-1)bk=ak+d;
                    if(bk<=j+j+d)ok=0;
                    dbg(k,ok,ak,d,bk);
                    if(ak+d!=bk)ok=0;
                    if(u[ak]||u[bk])ok=0;
                    u[ak]=u[bk]=1;
                }
                int nado=0;
                for(int k=j+j+1;ok&&k<=j+j+d;++k){
                    if(!u[k]&&u[k+d])ok=0;
                    if(u[k]&&!u[k+d])ok=0;
                    dbg(k,ok,nado);
                    if(u[k]&&u[k+d])continue;
                    nado++;
                }
                dbg(ok,nado);
                if(ok&&nado<=c)dp[i][c]|=dp[j][c-nado];
            }
            dbg(i,c,dp[i][c]);
        }
        dbg("====", i+1);
    }
    if(!dp[n][f])no();
    cout<<"Yes\n";
    return 0;
}

#include <bits/stdc++.h>
#define REP(i, e) for(int (i) = 0; (i) < (e); ++(i))
#define FOR(i, b, e) for(int (i) = (b); (i) < (e); ++(i))
#define ALL(c) (c).begin(), (c).end()
#define PRINT(x) cout << (x) << "\n"
using namespace std;
using ll = long long;
using pll = pair<ll, ll>;
const long long MOD = 1000000007;

ll N, A[201], B[201];
ll L[201], R[201];
bool dp[201], used[201];

signed main(){
    cin >> N;
    REP(i, N) cin >> A[i] >> B[i];
    REP(i, 2 * N) L[i] = R[i] = -1;
    REP(i, N){
        if(A[i] != -1){
            A[i]--;
            if(L[A[i]] != -1 || R[A[i]] != -1){
                PRINT("No");
                return 0;
            }
            L[A[i]] = i;
        }
        if(B[i] != -1){
            B[i]--;
            if(R[B[i]] != -1 || L[B[i]] != -1){
                PRINT("No");
                return 0;
            }
            R[B[i]] = i;
        }
    }
    dp[0] = true;
    REP(i, 2 * N){
        if(!dp[i]) continue;
        FOR(j, i + 1, 2 * N){
            ll w = j - i + 1;
            if(w & 1) continue;
            w /= 2;
            bool ok = true;
            REP(k, N) used[k] = false;
            REP(k, w){
                ll p = i + k, q = i + w + k;
                if(L[q] != -1 || R[p] != -1) ok = false;
                if(L[p] != -1 && R[q] != -1 && L[p] != R[q]) ok = false;
                if(L[p] != -1){
                    if(used[L[p]]) ok = false;
                    used[L[p]] = true;
                }
                if(R[q] != -1){
                    if(L[p] != R[q] && used[R[q]]) ok = false;
                    used[R[q]] = true;
                }
            }
            if(ok) dp[j + 1] = true;
        }
    }
    if(dp[2 * N]) PRINT("Yes");
    else PRINT("No");
    return 0;
}


#include <iostream>
#include <cstdio>
#include <algorithm>
#include <bits/stdc++.h>
#define ALL(x) (x).begin(), (x).end()
#define sz(a) int(a.size())
#define rep(i,x,n) for(int i=x;i<n;i++)
#define repd(i,x,n) for(int i=x;i<=n;i++)
#define pii pair<int,int>
#define pll pair<long long ,long long>
#define gbtb ios::sync_with_stdio(false),cin.tie(0),cout.tie(0)
#define MS0(X) memset((X), 0, sizeof((X)))
#define MSC0(X) memset((X), '\0', sizeof((X)))
#define pb push_back
#define mp make_pair
#define fi first
#define se second
#define eps 1e-6
#define chu(x)  if(DEBUG_Switch) cout<<"["<<#x<<" "<<(x)<<"]"<<endl
#define du3(a,b,c) scanf("%d %d %d",&(a),&(b),&(c))
#define du2(a,b) scanf("%d %d",&(a),&(b))
#define du1(a) scanf("%d",&(a));
using namespace std;
typedef long long ll;
ll gcd(ll a, ll b) {return b ? gcd(b, a % b) : a;}
ll lcm(ll a, ll b) {return a / gcd(a, b) * b;}
ll powmod(ll a, ll b, ll MOD) { if (a == 0ll) {return 0ll;} a %= MOD; ll ans = 1; while (b) {if (b & 1) {ans = ans * a % MOD;} a = a * a % MOD; b >>= 1;} return ans;}
ll poww(ll a, ll b) { if (a == 0ll) {return 0ll;} ll ans = 1; while (b) {if (b & 1) {ans = ans * a ;} a = a * a ; b >>= 1;} return ans;}
void Pv(const vector<int> &V) {int Len = sz(V); for (int i = 0; i < Len; ++i) {printf("%d", V[i] ); if (i != Len - 1) {printf(" ");} else {printf("\n");}}}
void Pvl(const vector<ll> &V) {int Len = sz(V); for (int i = 0; i < Len; ++i) {printf("%lld", V[i] ); if (i != Len - 1) {printf(" ");} else {printf("\n");}}}
inline long long readll() {long long tmp = 0, fh = 1; char c = getchar(); while (c < '0' || c > '9') {if (c == '-') { fh = -1; } c = getchar();} while (c >= '0' && c <= '9') { tmp = tmp * 10 + c - 48, c = getchar(); } return tmp * fh;}
inline int readint() {int tmp = 0, fh = 1; char c = getchar(); while (c < '0' || c > '9') {if (c == '-') { fh = -1; } c = getchar();} while (c >= '0' && c <= '9') { tmp = tmp * 10 + c - 48, c = getchar(); } return tmp * fh;}
void pvarr_int(int *arr, int n, int strat = 1) {if (strat == 0) {n--;} repd(i, strat, n) {printf("%d%c", arr[i], i == n ? '\n' : ' ');}}
void pvarr_LL(ll *arr, int n, int strat = 1) {if (strat == 0) {n--;} repd(i, strat, n) {printf("%lld%c", arr[i], i == n ? '\n' : ' ');}}
const int maxn = 1000010;
const int inf = 0x3f3f3f3f;
/*** TEMPLATE CODE * * STARTS HERE ***/
#define DEBUG_Switch 0
char s[maxn];
// R beats S;
// P beats R;
// S beats P.
//
int n, base[1010];
char dp[105][105];
char dfs(int pos, int k)
{
    if (k == 0) {
        return s[pos];
    }
    if (dp[pos][k] != '\0') {
        return dp[pos][k];
    }
    char l = dfs(pos, k - 1);
    char r = dfs((pos + base[k - 1]) % n, k - 1);
    char res;
    if (l == r) {
        res = l;
    } else {
        if (r + l == 'R' + 'S') {
            res = 'R';
        }
        if (r + l == 'R' + 'P') {
            res = 'P';
        }
        if (r + l == 'S' + 'P') {
            res = 'S';
        }
    }
    dp[pos][k] = res;
    return res;
}
int k;

int main()
{
#if DEBUG_Switch
    freopen("D:\\code\\input.txt", "r", stdin);
#endif
    //freopen("D:\\code\\output.txt","w",stdout);
    n = readint();
    k = readint();
    scanf("%s", s);
    base[0] = 1;
    repd(i, 1, k) {
        base[i] = base[i - 1] * 2 % n;
    }
    printf("%c\n", dfs(0, k) );
    return 0;
}

#include <bits/stdc++.h>
using namespace std;
#define LL long long
const int M=2e5+5,P=1e9+7,base=269;
inline int rd(){
	int x=0;char c=getchar();
	while(!isdigit(c))c=getchar();
	while(isdigit(c))x=(x<<1)+(x<<3)+(c^48),c=getchar();
	return x;
}
int n,A[M],B[M],c[M];
map <int,queue <int> > Q;
void update(int x,int v){
	while(x<=n){
		c[x]+=v;
		x+=(x&-x);
	}
}
int query(int x){
	int res=0;
	while(x){
		res+=c[x];
		x-=x&-x;
	}
	return res;
}
LL ans;
int main(){
	n=rd();
	for(int i=1;i<=n;++i)A[i]=rd(),update(i,1);
	for(int i=1;i<=n;++i)B[i]=rd();
	for(int i=n;i;--i)
		Q[A[i]+i].push(i);
	for(int i=n;i;--i){
		int x=B[i]+i;
		if(Q[x].empty()){
			puts("-1");
			exit(0);
		}
		else {
			int y=Q[x].front();
			Q[x].pop();
			int tmp=query(n)-query(y);
			update(y,-1);
			ans+=tmp;
		}
	}printf("%lld\n",ans);
	return 0;
}