#include<bits/stdc++.h>
using namespace std;
#define ll                long long
#define all(x)            (x).begin(),(x).end()
#define sz(x)             (ll)((x).size())
#define GCD(m,n)          __gcd(m,n)
#define LCM(m,n)          ((m*n)/GCD(m,n))
#define PI                3.141592653589793238462

//max element of a vector = *max_element (first_index, last_index);
// s.find_first_of('')

ll sign(ll x){
	return (x>0)-(x<0);
}

bool isPrime(int n)
{
    if (n <= 1)
        return false;
    for (int i = 2; i < n; i++)
        if (n % i == 0)
            return false;
    return true;
}

ll power(ll a,ll b,ll mod){
    if(b==0){
        return 1;
    }
    ll x=power(a,b/2,mod);
    x=(x*x)%mod;
    if(b%2){
        x=(x*a)%mod;
    }
    return x;
}

bool isPalindrome(string str){
	ll l = 0;
	ll h = str.length()-1;

	while(h>l){
		if(str[l++]!=str[h--]){
			return false;
		}
	}
	return true;
}

void kickstart(ll test){
	cout << "Case #" << test << ": ";
	cout << "\n";
}

ll gcd(ll x, ll y) {
	return y == 0 ? x : gcd(y, x % y);
}

float distance(int x1, int y1, int x2, int y2)
{
    return sqrt(pow(x2 - x1, 2) +
                pow(y2 - y1, 2) * 1.0);
}

bool isPerfectSquare(ll x)
{
    if (x >= 0) {
        ll sr = sqrt(x);
        return (sr * sr == x);
    }
    return false;
}

const ll MOD=1e9+7;

int main(){

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

	string s;
	cin>>s;
	ll n = s.length();
	ll cnt = 0;
	for(ll i=n-1;i>=0;i--){
		if(s[i]=='0')
			cnt++;
		else
			break;
	}

	string s1 = s.substr(0,n-cnt);

	// for(ll i=0;i<cnt;i++){
	// 	s.insert(0,1,'0');
	// }

	// cout<<s1<<" ";

	if(isPalindrome(s1))
		cout<<"Yes";
	else
		cout<<"No";
	return 0;
}

#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define ld long double
#define MOD 998244353
#define mod9 1000000009
#define fast ios_base :: sync_with_stdio(0);cin.tie(NULL);cout.tie(NULL);
#define mp make_pair
#define pb push_back
#define ct ll t;cin>>t;while(t--)
#define bi begin()
#define ei end()
#define fi first
#define se second
#define foe(i,a,b) for(ll i=a;i<b;i++)
#define rfoe(i,a,b) for(ll i=a;i>=0;i--)
#define sz(s) s.size()
#define mem(a,s) memset(a,s,sizeof(a))
#define all(v) v.bi,v.ei
#define MAX             8000000000000000064LL
#define MIN            -8000000000000000064LL

typedef pair<ll,ll> pii;

ll add(ll a, ll b){return (a%MOD + b%MOD + ((MAX)/MOD)*MOD)%MOD;}
ll sub(ll a, ll b){return (a%MOD - b%MOD + ((MAX)/MOD)*MOD)%MOD;}
ll mul(ll a, ll b){return ((a%MOD)*(b%MOD) + ((MAX)/MOD)*MOD)%MOD;}
long long binpow(long long a, long long b)
{
    long long res = 1;
    while (b > 0) {
        if (b & 1)
            res = res*a;
        a = a*a;
        b >>= 1;
    }
    return res;
}
 bool prime[10000009]={false};
//     // set<ll>s1;
    void Sieve()
    {
        ll n=10000009;
        prime[0]=prime[1]=true;
        // s[0]=0;
        // s[1]=1;
        // s.pb(1);
        // t.insert(1);
        for (int p=2; p*p<=n; p++)
        {

        if(prime[p]==false)
        {
            //    s.pb(p);
            for(ll j=p*p;j<=n;j+=p)
            {
                prime[j]=true;
            }
        }
        }
        for(ll i=2;i<n;i++)
        {
            if(prime[i])
            {
                // s.pb(i);
                // s1.insert(i);
            }
        }
}
ll lcm(ll a,ll b){return(a*b)/__gcd(a,b);}
ll fact[1000007 ]={0};
ll expo(ll x, ll y) {ll res=1;x=x%MOD;while(y>0){if(y&1)res=(1ll*res*x)%MOD;
y=y>>1;x=(1ll*x*x)%MOD;} return res;}
void facto() {fact[0]=1;fact[1]=1;for(ll i=2;i<1000007;i++)fact[i]=(fact[i-1]*i)%MOD;}
ll ncr(ll n,ll r) {ll res=1; res=fact[n]; res=(res*(expo(fact[r],MOD-2)))%MOD; res=(res*(expo(fact[n-r],MOD-2)))%MOD; return res;}
ll npr(ll n,ll r) {facto(); ll res=1; res=fact[n]; res=(res*(expo(fact[n-r],MOD-2)))%MOD; return res; }
int const N=5005;
ll const INF = 2e18+5;
ll dx[8]={0,0,1,-1,1,1,-1,-1};
ll dy[8]={1,-1,0,0,-1,1,-1,1};

void solve()
{
   ll x;
   cin>>x;
   x = x>=0 ? x:0;
   cout<<x<<"\n";
}

int main()
{
    fast
    // facto();
    // Sieve();
    // ct
    {
        solve();
    }
}


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

using namespace std;
using ll = long long;

int main()
{
    int n;
    cin >> n;
    vector<ll> a(n);
    vector<set<ll>> st(200);
    vector<vector<ll>> ans(200);
    for(int i = 0; i < n; i++){
        cin >> a[i];
    }
    int num = min(8, n);
    for(int bit = 1; bit < (1<<num); bit++){
        ll tmp = 0;
        vector<ll> tans;
        for(int i = 0; i < num; i++){
            if(bit&(1<<i)){
                tmp = (tmp+a[i])%200;
                tans.push_back(i+1);
            }
        }
        if(st[tmp%200].size() > 0){
            sort(tans.begin(), tans.end());
            cout << "Yes" << endl;
            cout << tans.size();
            for(int z: tans){
                cout << " " << z;
            }
            cout << endl;
            cout << ans[tmp%200].size();
            for(int z: ans[tmp%200]){
                cout << " " << z;
            }
            cout << endl;
            return 0;
        }else{
            for(int z: tans){
                ans[tmp%200].push_back(z);
            }
            sort(ans[tmp%200].begin(), ans[tmp%200].end());
            st[tmp%200].insert(tmp%200);
        }
    }
    cout << "No" << endl;
    return 0;
}

#ifdef LOGX
#define _GLIBCXX_DEBUG
#endif
#include <bits/stdc++.h>
using namespace std;
//#include <atcoder/all>
//using namespace atcoder;

/*---------macro---------*/
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define rep2(i, s, n) for (int i = s; i < (int)(n); i++)
#define unless(x) if(!(x))
#define until(x) while(!(x))
#define ALL(a) a.begin(),a.end()
#define RALL(a) a.rbegin(),a.rend()
#define mybit(i,j) (((i)>>(j))&1)

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

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

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

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

    int n;
    std::cin >> n;
    std::vector<int> idx(n),idy(n);
    iota(ALL(idx),0);
    iota(ALL(idy),0);
    std::vector<int> x(n),y(n);
    set<int> a;
    rep(i,n)cin >> x[i] >> y[i];
    sort(ALL(idx),[&](int i,int j){return x[i]<x[j];});
    sort(ALL(idy),[&](int i,int j){return y[i]<y[j];});
    a.insert(idx[0]);
    a.insert(idx[1]);
    a.insert(idx[n-1]);
    a.insert(idx[n-2]);
    a.insert(idy[0]);
    a.insert(idy[1]);
    a.insert(idy[n-1]);
    a.insert(idy[n-2]);
    priority_queue<int> q;
    set<pair<int,int>> al;
    for(int i:a)for(int j:a){
        if(al.count({i,j}) || al.count({j,i}))continue;
        q.push(max(abs(x[i]-x[j]), abs(y[i]-y[j])));
        al.insert({i,j});
    }
    q.pop();
    cout << q.top() << newl;
}


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

#define INF 1000000000

int n;
char s[100010];

int main() {
    scanf("%s", s+1);
    n = strlen(s+1);
    int i;
    for (i=n; i>=1; i--) {
        if (s[i]=='0') printf("0");
        else if (s[i]=='1') printf("1");
       else if (s[i]=='6') printf("9");
       else if (s[i]=='8') printf("8");
       else if (s[i]=='9') printf("6");
    }
    printf("\n");
    return 0;
}

#include <bits/stdc++.h>
#define rep(i, n) for(ll i = 0; i < n; ++i)
#define rep2(i, a, b) for(ll i = a; i <= b; ++i)
#define rep3(i, a, b) for(ll i = a; i >= b; --i)
#define all(c) begin(c), end(c)
#define SUM(v) accumulate(all(v), 0LL)
#define MIN(v) *min_element(all(v))
#define MAX(v) *max_element(all(v))
using namespace std;
//using namespace atcoder;
using ll = long long;
typedef pair<ll,ll> P;
typedef pair<ll,P> PP;
typedef vector<vector<int> > Graph;
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; }
const ll INF = 1e18;

#define debug(v) cout<<#v<<": ",prt(v);
template <typename A,typename B>
inline void prt(pair<A,B> p){cout<<"("<<p.first<<", "<<p.second<<")\n";}
template <typename A,typename B,typename C>
inline void prt(tuple<A,B,C> p){cout<<"("<<get<0>(p)<<", "<<get<1>(p)<<", "<<get<2>(p)<<")\n";}
inline void prt(bool p){if(p)cout<<"True"<<'\n';else cout<<"False"<<'\n';}
template <typename T>
inline void prt(vector<T> v){cout<<'{';for(ll i=0;i<v.size();i++){cout<<v[i];if(i<v.size()-1)cout<<", ";}cout<<'}'<<'\n';}
template<typename T>
inline void prt(vector<vector<T> >& vv){ for(const auto& v : vv){ prt(v); } }
template <typename T>
inline void prt(deque<T> v){cout<<'{';for(ll i=0;i<v.size();i++){cout<<v[i];if(i<v.size()-1)cout<<", ";}cout<<'}'<<'\n';}
template <typename A,typename B>
inline void prt(map<A,B> v){cout<<'{';ll c=0;for(auto &p: v){cout<<p.first<<":"<<p.second;c++;if(c!=v.size())cout<<", ";}cout<<'}'<<'\n';}
template <typename A,typename B>
inline void prt(unordered_map<A,B> v){cout<<'{';ll c=0;for(auto &p: v){cout<<p.first<<":"<<p.second;c++;if(c!=v.size())cout<<", ";}cout<<'}'<<'\n';}
template <typename T>
inline void prt(set<T> v){cout<<'{';for(auto i=v.begin();i!=v.end();i++){cout<<*i;if(i!=--v.end())cout<<", ";}cout<<'}'<<'\n';}
template <typename T>
inline void prt(multiset<T> v){cout<<'{';for(auto i=v.begin();i!=v.end();i++){cout<<*i;if(i!=--v.end())cout<<", ";}cout<<'}'<<'\n';}

/*

*/

int main(){
	ios::sync_with_stdio(false);
	std::cin.tie(nullptr);
	string s;
	cin >> s;
	reverse(s.begin(),s.end());
	string ans = "";
	rep(i,s.size()){
		if(s[i]=='6')ans+='9';
		else if(s[i]=='9')ans+='6';
		else ans+=s[i];
	}
	cout << ans << endl;

	return 0;
}


#include <iostream>
#include <string>

int n;
std::string s;

int C(int n, int k) {
    if (!k) return 1;
    else return C(n / 3, k / 3) * (n % 3 < k % 3 ? 0 : n % 3 == 2 && k % 3 == 1 ? 2 : 1) % 3;
}

int main() {
    std::ios::sync_with_stdio(false), std::cin.tie(nullptr);
    std::cin >> n >> s;
    int ans = 0;
    for (int i = 0, x; i < n; ++i) {
        if (s[i] == 'B') x = 0;
        else if (s[i] == 'W') x = 1;
        else x = 2;
        ans = (ans + C(n - 1, i) * x % 3) % 3;
    }
    if (n % 2 == 0) ans = (3 - ans) % 3;
    if (ans == 0) std::cout << "B\n";
    else if (ans == 1) std::cout << "W\n";
    else std::cout << "R\n";
    return 0;
}

#include <bits/stdc++.h>
//#include <atcoder/all>
using namespace std;
//using namespace atcoder;
//using mint = modint1000000007;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define reps(i,n) for(int i=1;i<=(int)(n);i++)
#define all(x) (x).begin(),(x).end()
#define rall(x) (x).rbegin(),(x).rend()
using ll = long long;
typedef pair<int, int> P;
#define EPS (1e-12)
const int MOD=1000000007;
// const int vx[]={0,1,0,-1},vy[]={1,0,-1,0};
template<class T>T gcd(T a,T b){return b?gcd(b,a%b):a;}
template<class T>T lcm(T a,T b){return a*b/gcd(a,b);}
template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; }

//前計算　O（ｎ）
long long MAX=400400;
long long fac[1000005], finv[1000005], inv[1000005];
void COMinit() {
    fac[0] = fac[1] = 1;
    finv[0] = finv[1] = 1;
    inv[1] = 1;
    for (int i = 2; i < MAX; i++){
        fac[i] = fac[i - 1] * i % MOD;
        inv[i] = MOD - inv[MOD%i] * (MOD / i) % MOD;
        finv[i] = finv[i - 1] * inv[i] % MOD;
    }
}

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

// 重複順列計算
long long HOM(int x, int y){
    return COM(x+y-1,x-1);
}

long long Lucas(long long n,long long k,int p){
    long long rec=1;
    while(!(n==0&&k==0)){
        rec*=COM(n%3,k%3);
        n/=3;
        k/=3;
    }
    return rec;
}

int main(){
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    COMinit();
    int n;
    cin>>n;
    vector<int> dat(n);
    rep(i,n){
        char a;
        cin>>a;
        if(a=='B')dat[i]=0;
        else if(a=='W')dat[i]=1;
        else if(a=='R')dat[i]=2;
    }
    ll ans=0;
    rep(i,n){
        // cout<<COM(n-1,i);
        if(n%2==0){
            ans-=(Lucas(n-1,i,3)*dat[i]);
        }
        else{
            ans+=(Lucas(n-1,i,3)*dat[i]);
        }
        // cout<<ans<<" ";
    }
    // cout<<ans<<endl;
    ans=(ans%3+3)%3;
    if(ans==0){
        cout<<'B';
    }
    else if(ans==1){
        cout<<'W';
    }
    else if(ans==2)cout<<'R';
    return 0;
}


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

//#include <atcoder/modint>
//#include <atcoder/dsu>

#define inc(i, n) for (int i = 0; i < (n); ++i)
#define incs(i, st, nd) for (int i = (st); i < (nd); ++i)

#define yes printf("Yes\n")
#define no printf("No\n")

//using pii = pair<int, int>;
using ll = long long;
//using mint = atcoder::modint998244353;
//using mint = atcoder::modint1000000007;

template <class T>
void chmax(T& a, const T& b) {
    a = max(a, b);
}

template <class T>
void chmin(T& a, const T& b) {
    a = min(a, b);
}

constexpr int MAXN = 1e3+5;
int a[MAXN], b[MAXN];
int dp[MAXN][MAXN];

int main(int argc, char const *argv[])
{
    int N, M;
    scanf("%d%d", &N, &M);

    a[0] = b[0] = 0;
    inc(i, N) scanf("%d", &a[i+1]);
    inc(i, M) scanf("%d", &b[i+1]);

    // init
    memset(dp, 0, sizeof dp);
    inc(i, N+1) dp[i][0] = i;
    inc(i, M+1) dp[0][i] = i;

    incs(i, 1, N+1) {
        incs(j, 1, M+1) {
            if (a[i] == b[j]) {
                dp[i][j] = dp[i-1][j-1];
            } else {
                dp[i][j] = 1 + min({dp[i-1][j-1], dp[i-1][j], dp[i][j-1]});
            }
        }
    }

    printf("%d\n", dp[N][M]);

    return 0;
}

#pragma GCC optimize(2)
#pragma GCC optimize(3,"Ofast","inline")
#include <bits/stdc++.h>
#define inf 0x7fffffff
//#define ll long long
#define int long long
//#define double long double
#define re register int
#define void inline void
#define eps 1e-8
//#define mod 1e9+7
#define ls(p) p<<1
#define rs(p) p<<1|1
#define pi acos(-1.0)
#define pb push_back
#define P pair < int , int >
#define mk make_pair
using namespace std;
const int mod=1e9+7;
const int M=1e8+5;
const int N=5e5+5;//?????????? 4e8
int n,k;
void solve()
{
	cin>>n>>k;
	cout<<100*n*k*(n+1)/2+n*k*(k+1)/2;
}
signed main()
{
    int T=1;
//    cin>>T;
    for(int index=1;index<=T;index++)
    {
        solve();
//        puts("");
    }
    return 0;
}
/*

4 5
1 2
1 3
1 4
2 3
3 4

*/


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

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

    int a, b;
    cin >> a >> b;
    int s1 = 0 , s2 = 0;
    for (int i = 0; i <3; i++) {
        s1 += a%10;
        s2 += b%10;
        a /= 10;
        b /= 10;

    }
    cout << max(s1, s2);
}

#include<bits/stdc++.h>
using namespace std;
using lint = long long;
using P = pair<int, int>;
const int INF = 1e9;
const int mod = 1000000007;
#define all(a) (a).begin(),(a).end()
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
int main(){
    string a, b;
    cin >> a >> b;
    int asum = 0, bsum = 0;
    rep(i, 3){
        asum += a[i] - '0';
        bsum += b[i] - '0';
    }
    cout << max(asum, bsum);
}


#include <bits/stdc++.h>
#include <iostream>
using namespace std;
#define ll long long
#define ld long double
#define mp make_pair
#define pb push_back
#define fo(i,n) for(ll i=0;i<n;i++)
#define fo1(i,n) for(ll i=1;i<=n;i++)
#define loop(i,a,b)for(ll i=a;i<=b;i++)
#define loopr(i,a,b)for(ll i=b;i>=a;i--)
#define all(x) x.begin(), x.end()
#define sz(x) (ll)(x).size()
#define vll vector<ll>
#define vvl vector<vll>
#define vpll vector<pll>
#define pll pair<ll,ll>
#define F first
#define S second
#define MOD 1000000007
ll max(ll a,ll b){if (a>b) return a; else return b;}
ll gcd(ll a, ll b){if(b==0)return a;return gcd(b, a%b);}
ll lcm(ll a, ll b){return a*b/gcd(a, b);}
ll fexp(ll a, ll b){ll ans = 1;while(b){if(b&1) ans = ans*a%MOD; b/=2;a=a*a%MOD;}return ans;}
ll inverse(ll a, ll p){return fexp(a, p-2);}
using namespace std;

//take care of long long

//fast I/O
auto optimizer = []() {  // makes I/O fast
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  return 0;
}();

//seive
ll N = 1e5;
vll lpf(N+1,0);
void leastPrimeFactor()
{
    lpf[1] = 1;
    for (ll i = 2; i <= N; i++)
    {
        if(lpf[i] == 0)
        {
            lpf[i] = i;
            for (ll j = 2*i; j <= N; j += i)
            	if (lpf[j] == 0)
                	lpf[j] = i;
        }
    }
}

int main()
{
	ll t=1;
	//cin>>t;
	while(t--)
	{
		ll a,b,c;
		cin>>a>>b>>c;
		cout<<max(a+b,max(b+c,c+a))<<endl;

	}
	return 0;
}

//                        YATIN KWATRA

#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#pragma GCC optimize ("Ofast")

#define ll                      long long
#define ar                      array
#define sz(v)                   (int)(v.size())
#define inf                     1e18
#define int                     ll
#define FIO                     ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define ld                      long double
#define ull                     unsigned long long
#define endl                    "\n"
#define fo(i,a,b)               for(int i = a; i<=b ; i++)
#define rfo(i,a,b)              for(int i = a; i>=b ; i--)
#define vii                     vector<int>
#define pq                      priority_queue
#define uomii                   unordered_map<int,int,best_hash>
#define all(v)                  v.begin(),v.end()
#define mp                      make_pair
#define pb                      push_back
#define pob                     pop_back
#define ff                      first
#define ss                      second
#define pii                     pair<int,int>
#define mii                     map<int,int>
#define vvii                    vector<vii>
#define mod                     1000000007
#define MIN                     -1e9
#define pi                      3.1415926535897932384626433832795
#define cz(x)                   63 - __builtin_clzll(x)

using namespace std;
using namespace __gnu_pbds;
template<class T> using oset =  tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;

struct best_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 int N = 1e5 + 5;
ar<int, 2> dp[2][N]; // {sum,cnt}
int v[N];
int n;

ar<int, 2> ways(int sign, int pos) {
	if (pos == n) return {0, 1};
	ar<int, 2>& ans = dp[sign][pos];
	if (ans[0] != (int)(-1e18)) return ans;
	ans = {0, 0};

	// put a plus before this element

	auto cur = ways(0, pos + 1);
	ans[0] += (v[pos] * cur[1]) % mod;
	ans[0] %= mod;
	ans[0] += cur[0];
	ans[0] = (ans[0] % mod + mod) % mod;
	ans[1] = (ans[1] + cur[1]) % mod;

	// put a minus if allowed before this

	if (!sign) {
		auto x = ways(1, pos + 1);
		ans[0] -= (v[pos] * x[1]) % mod;
		ans[0] %= mod;
		ans[0] += x[0];
		ans[0] = (ans[0] % mod + mod) % mod;
		ans[1] = (ans[1] + x[1]) % mod;
	}

	return ans;
}

void solve()
{
	cin >> n;
	fo(i, 0, n - 1) cin >> v[i];
	fo(i, 0, 1) {
		fo(j, 0, n) dp[i][j] = { (int)(-1e18), (int)(-1e18)};
	}
	auto ans = ways(0, 1);
	ans[0] += (ans[1] * v[0]) % mod;
	ans[0] = (ans[0] % mod + mod) % mod;
	cout << ans[0];
}

signed main() {

	FIO
	int t;
	t = 1;
//	cin >> t;
	fo(i, 0, t - 1) {
		solve();
	}
	return 0;
}


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

#define int long long
#define ld long double

#define rep(i,a,b) for(int i=a;i<b;i++)
#define repb(i,a,b) for(int i=a;i>=b;i--)

#define pb push_back
#define mp make_pair
#define all(A) A.begin(),A.end()
#define allr(A) A.rbegin(),A.rend()
#define precise(i) fixed << setprecision(i)
#define fi first
#define se second

#define err() cout<<"\n==================================\n";
#define errA(A) for(auto i:A) cout<<i<<" "; cout<<"\n";
#define err1(a) cout<<#a<<" "<<a<<"\n";
#define err2(a,b) cout<<#a<<" "<<a<<" "<<#b<<" "<<b<<"\n";
#define err3(a,b,c) cout<<#a<<" "<<a<<" "<<#b<<" "<<b<<" "<<#c<<" "<<c<<"\n";
#define err4(a,b,c,d) cout<<#a<<" "<<a<<" "<<#b<<" "<<b<<" "<<#c<<" "<<c<<" "<<#d<<" "<<d<<"\n";

const int logN = 20;
const int M = 1000000007;
const int INF = 1e12;
#define PI 3.14159265;
const int N = 200005;

#define Pii pair<int,int>
#define Vi vector<int>
#define Vpii vector<Pii>

void solve()
{
    string s;
    cin>>s;
    for(auto e: s)
    {
    	if(e == '.')
    	{
    		break;
    	}
    	cout<<e;
    }
}

int32_t main()
{
    ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
    int t=1;
    // cin>>t;
    while(t--)
    {
        solve();
    }
    return 0;
}

#include<bits/stdc++.h>
#define ints long long
#define fo(i, a, n) for (ints i = a; i < n; i++)
using namespace std;

int main()
{

	ios_base::sync_with_stdio(0);
	cin.tie(0);
	cout.tie(0);
	ints t;
	t = 1;
	while (t--)
	{
		string s;
		cin >> s;
		for (ints i = 0; s[i] != '\0'; i++)
		{
			if (s[i] == '.')
			{
				break;
			}
			else
				cout << s[i];
		}

	}
	return 0;
}


#include <bits/stdc++.h>
using namespace std;
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
#define p(x,y) pair<x,y>
#define oset(x) tree<x, null_type, less<x>, rb_tree_tag, tree_order_statistics_node_update>
#define all(x) (x).begin(),(x).end()
#define ll long long
#define scan(a) for(auto &it:a)cin>>it;
#define print(a) {for(auto it:a)cout<<it<<" ";cout<<endl;}
#define out(x) cout<<((x)?"YES":"NO")<<endl;
#define rep(i, begin, end) for (__typeof(end) i = (begin) - ((begin) > (end)); i != (end) - ((begin) > (end)); i += 1 - 2 * ((begin) > (end)))
#define int ll
#define prime 1000000007
void solve()
{
    int n;
    cin>>n;
    long double a[n],sum=0.0,ans,suf[n],x;
    rep(i,0,n)
    {
        int t;
        cin>>t;
        a[i]=t;
        sum+=a[i];
    }
    sort(a,a+n);
    suf[n-1]=a[n-1];
    rep(i,n-1,0)
    {
        suf[i]=suf[i+1]+a[i];
    }
    // print(a);
    // print(suf);

    ans=min(sum,n*(a[n-1]/2.0));
    // cout<<ans<<"\n";
    rep(i,0,n)
    {
        x=a[i]/2.0;
        int no=upper_bound(a,a+n,2*x)-a;
        long double t=x*(no);
        if(no<n)
            t+=suf[no]-(n-no)*x;
        ans=min(ans,t);
        // cout<<x<<":-"<<t<<" "<<no<<" "<<n-no<<"\n";
    }
    // rep(i,0,n)
    // {
    //     x=a[i];
    //     int no=lower_bound(a,a+n,x)-a;
    //     long double t=(x/2*(no+1);
    //     if(no<n)
    //         t+=suf[no];
    //     ans=min(ans,t);
    //     // cout<<t<<" ";
    // }
    cout<<ans/(1.00*n);
}
int32_t main()
{
    ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
    int t=1;
    cout.setf(ios::fixed, ios::floatfield);cout.precision(10);
    // init();
    //cin>>t;
    while(t--)
    {
        solve();
    }
    return 0;
}

#include <bits/stdc++.h>

using namespace std;

typedef long long ll;
typedef long double ld;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef vector<pii> vii;
typedef vector<vi> vvi;
typedef vector<pll> vll;
typedef vector<vl> vvl;

#define fori(i, n) for (int i = 0; i < n; i++)
#define ford(i, n) for (int i = n - 1; i >= 0; i--)
#define rep(i, a, b) for (int i = a; i <= b; i++)
#define repd(i, a, b) for (int i = a; i >= b; i--)
#define trav(x, a) for (auto &x : a)
#define all(x) (x).begin(), (x).end()
#define pb push_back
#define eb emplace_back
#define endl '\n'
#define sz(a) (int)(a).size()
#define fi first
#define se second

clock_t time_p = clock();
void time_taken()
{
    time_p = clock() - time_p;
    cerr << "Time Taken : " << (float)(time_p) / CLOCKS_PER_SEC << "\n";
}

const ll mod = 1e9 + 7;
const ll INF = 1e18;

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

    int n;
    cin >> n;
    map<ld, int> a;
    ld c = 0;
    fori(i, n)
    {
        ld x;
        cin >> x;
        c += x;
        a[x]++;
    }

    ld m = -n;
    ld at = 0;
    for (auto x : a)
    {
        at = x.fi / 2;
        m += 2 * x.se;
        c -= x.fi * x.se;
        if (m >= 0)
        {
            break;
        }
    }

    cout.precision(12);
    cout << fixed;
    cout << (m * at + c) / n << endl;

    time_taken();
    return 0;
}


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

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

char cn[1200010];
char* ci = cn, * di = cn, ct;
//char tc[200002], *d1 = tc + 100000, *d2 = tc + 200000;
const char d[2] = "0";

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

	fread(cn, 1, 1200010, stdin);
	int T = 0;
	while ((ct = *ci++) >= '0') T = T * 10 + ct - '0';

	rep(t, T) {
		int N = 0;
		while ((ct = *ci++) >= '0') N = N * 10 + ct - '0';

		memset(di, '0', N);
		di += N;
		memset(di, '1', N);
		di += N;
		*di++ = '0';
		*di++ = '\n';
		ci += 6 * N + 3;
	}
	fwrite(cn, 1, di - cn, stdout);

	Would you please return 0;
}

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

#define ll long long
#define ll128 __uint128_t
#define ld long double
#define pll pair <ll, ll>

#define vll vector <ll>
#define vld vector<ld>
#define vpll vector<pll>

#define vvll vector <vll>

#define rep(i, a, b) for(ll i = (ll)a; i < (ll)b; i++)
#define per(i, a, b) for(ll i = (ll)a - 1; i >= (ll)b; --i)

#define pb push_back
#define pf push_front

#define all(v) (v).begin(), (v).end()
#define rall(v) (v).rbegin(), (v).rend()

#define sorta(v) sort(all(v))
#define sortd(v) sort(rall(v))

#define debug if (1)
#define log(val) debug {cout << "\n" << #val << ": " << val << "\n";}

#define ios ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define file(name) freopen(name".in", "r", stdin); freopen(name".out", "w", stdout);
#define FILE freopen("input.txt", "r", stdin); freopen("output.txt", "w", stdout);

#define mod (ll)(1e9 + 7)

using namespace std;
using namespace __gnu_cxx;
using namespace __gnu_pbds;

template<typename T>
ostream & operator << (ostream & out, vector<T> & a) {
    for(auto i : a) out << i << " ";
    return out;
}

template<typename T>
istream & operator >> (istream & in, vector<T> & a) {
    for(auto &i : a) in >> i;
    return in;
}

int main() {
    ios;
    // freopen("input.txt", "r", stdin);

    ll t;
    cin >> t;
    while(t--) {
        ll n;
        cin >> n;

        rep(i, 0, 3) {
            char q;
            rep(j, 0, 2 * n) cin >> q;
        }

        rep(i, 0, n) cout << 0;
        rep(i, 0, n) cout << 1;
        cout << 0 << endl;
    }
    return 0;
}


#include <bits/stdc++.h>
template<class T> inline bool chmin(T&a, T b){if(a > b){a = b; return true;}else{return false;}}
template<class T> inline bool chmax(T&a, T b){if(a < b){a = b; return true;}else{return false;}}
#define ll long long
#define double long double
#define rep(i,n) for(int i=0;i<(n);i++)
#define REP(i,n) for(int i=1;i<=(n);i++)
#define mod (ll)(1e9+7)
#define inf (ll)(3e18+7)
#define eps (double)(1e-9)
#define pi (double) acos(-1)
#define P pair<int,int>
#define PiP pair<int,pair<int,int>>
#define all(x) x.begin(),x.end()
#define rall(x) x.rbegin(),x.rend()
using namespace std;

int main(){
    int n;
    string s, x;
    cin >> n >> s >> x;
    vector<vector<bool>> dp(n+1, vector<bool>(7));
    dp[n][0] = true;
    REP(i, 6)dp[n][i] = false;
    for(int i = n-1; i >= 0; i--){
        int now = s[i] - '0';
        if(x[i] == 'T'){
            rep(j, 7){
                dp[i][j] = false;
                if(dp[i+1][(10*j)%7])dp[i][j] = true;
                if(dp[i+1][(10*j+now)%7])dp[i][j] = true;
            }
        }else{
            rep(j, 7){
                dp[i][j] = false;
                if(dp[i+1][(10*j)%7] && dp[i+1][(10*j+now)%7])dp[i][j] = true;
            }
        }
    }
    cout << (dp[0][0] ? "Takahashi" : "Aoki") << endl;
}

#pragma GCC optimize("Ofast,unroll-loops")
#pragma GCC target("avx,avx2,sse,sse2")
#include<bits/stdc++.h>
#include<unordered_set>
#define INF 0x3f3f3f3f
#define mod 1000000007
#define G 3
#define MAX_N 300005
using namespace std;
typedef long long ll;
typedef pair<ll,ll>P;
int n,dp[200005][10];
char s[200005],t[200005];
int dfs(int i,int x){
	//cout<<i<<' '<<x<<endl;
	if(dp[i][x]!=-1)return dp[i][x];
	if(i==n){
		if(x==0)return 0;
		else return 1;
	}
	int ans;
	if(t[i]=='A'){
		if(dfs(i+1,(x*10)%7)||dfs(i+1,(x*10+s[i]-'0')%7))ans=1;
		else ans=0;
	}
	else{
		if(!dfs(i+1,(x*10)%7)||!dfs(i+1,(x*10+s[i]-'0')%7))ans=0;
		else ans=1;
	}
	return dp[i][x]=ans;
}
int main(){
	memset(dp,-1,sizeof(dp));
	cin>>n;
	scanf("%s%s",s,t);
	int ans=dfs(0,0);
	if(ans)puts("Aoki");
	else puts("Takahashi");
    return 0;
}


#include<iostream>
#include <string>
#include <algorithm>

int n;
int q;
std::string s;

int t,a,b;

int main()
{
    std::cin >> n >> s >> q;

    std::string sh[2];

    sh[0] = s.substr(0,n);
    sh[1] = s.substr(n,s.size());

    for(int i=0;i<q;++i){
        std::cin >> t >> a >> b;
        if(t == 1){
            std::swap(sh[(a-1)/n].at((a-1) % n),sh[(b-1)/n].at((b-1) % n));
        }
        else{
            std::swap(sh[0],sh[1]);
        }
    }

    std::cout << sh[0] << sh[1] << std::endl;

    return 0;
}

//IQ134高知能系Vtuberの高井茅乃です。
//Twitter: https://twitter.com/takaichino
//YouTube: https://www.youtube.com/channel/UCTOxnI3eOI_o1HRgzq-LEZw

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

#define INF INT_MAX
#define LLINF LLONG_MAX
#define REP(i,n) for(int i=0;i<n;i++)
#define REP1(i,n) for(int i=1;i<=n;i++)
#define MODA 1000000007
#define MODB  998244353

template <typename T>
std::istream& operator>>(std::istream& is, std::vector<T>& vec) {
    for (T& x: vec) { is >> x; }
    return is;
}

int main() {
	ll ans = 0;
	ll tmp = 0;
	int n; cin >> n;
	string s; cin >> s;
	int q; cin >> q;
	bool fliped = false;
	int t, a, b;
	REP(tr, q){
		cin >> t >> a >> b;
		if(t == 1){
			if(fliped) swap(s[(a-1+n)%(2*n)], s[(b-1+n)%(2*n)]);
			else swap(s[a-1], s[b-1]);
		}
		else fliped = !fliped;
	}
	if(fliped) cout << s.substr(n, n) + s.substr(0, n) << endl;
	else cout << s << endl;
}


#include <bits/stdc++.h>
#include <iostream>
#include <iomanip>
#include <cmath>
#include <limits>
using namespace std;
#define rep(i,n) for (int i = 0; i < (n); ++i)
using ll = long long;
using ull = unsigned long long;
using P = pair<int,int>;
 // < でBの方が大

int main() {
    ll N;
    cin >> N;
    vector<ll> T(N);
    vector<ll> L(N);
    vector<ll> R(N);
    rep(n, N) {
        ll t;
        cin >> T[n] >> L[n] >> R[n];

    }
    ll ans = 0;
    rep(n, N) {
        ll l = L[n];
        ll r = R[n];
        ll t = T[n];
        for(ll i = n+1; i < N; i++) {
            // n と iの区間を比較
            ll li = L[i];
            ll ri = R[i];
            ll ti = T[i];

            if (t == 1 && ti == 1) {
                if (li>= l && li <= r) ans++;
                if (li < l && !(ri < l)) ans++;
            }
            if (t == 1 && ti == 2) {
                if (li>= l && li <= r) ans++;
                if (li < l && !(ri <= l)) ans++;
            }
            if (t == 1 && ti == 3) {
                if (li>= l && li < r) ans++;
                if (li < l && !(ri < l)) ans++;
            }
            if (t == 1 && ti == 4) {
                if (li>= l && li < r) ans++;
                if (li < l && !(ri <= l)) ans++;
            }

            if (t == 2 && ti == 1) {
                if (li>= l && li < r) ans++;
                if (li < l && !(ri < l)) ans++;
            }
            if (t == 2 && ti == 2) {
                if (li>= l && li < r) ans++;
                if (li < l && !(ri <= l)) ans++;
            }
            if (t == 2 && ti == 3) {
                if (li>= l && li < r) ans++;
                if (li < l && !(ri < l)) ans++;
            }
            if (t == 2 && ti == 4) {
                if (li>= l && li < r) ans++;
                if (li < l && !(ri <= l)) ans++;
            }

            if (t == 3 && ti == 1) {
                if (li>= l && li <= r) ans++;
                if (li < l && !(ri <= l)) ans++;
            }
            if (t == 3 && ti == 2) {
                if (li>= l && li <= r) ans++;
                if (li < l && !(ri <= l)) ans++;
            }
            if (t == 3 && ti == 3) {
                if (li>= l && li < r) ans++;
                if (li < l && !(ri <= l)) ans++;
            }
            if (t == 3 && ti == 4) {
                if (li>= l && li < r) ans++;
                if (li < l && !(ri <= l)) ans++;
            }

            if (t == 4 && ti == 1) {
                if (li>= l && li < r) ans++;
                if (li < l && !(ri <= l)) ans++;
            }
            if (t == 4 && ti == 2) {
                if (li>= l && li < r) ans++;
                if (li < l && !(ri <= l)) ans++;
            }
            if (t == 4 && ti == 3) {
                if (li>= l && li < r) ans++;
                if (li < l && !(ri <= l)) ans++;
            }
            if (t == 4 && ti == 4) {
                if (li>= l && li < r) ans++;
                if (li < l && !(ri <= l)) ans++;
            }
        }
    }
    cout << ans << endl;
}

#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
using namespace std;
typedef long long ll;
typedef pair<ll,ll> pll;

#define ordered_pair_multiset tree<pair<ll,ll>, null_type,less<pair<ll,ll>>, rb_tree_tag,tree_order_statistics_node_update>

#define F(type, i, a, b, incr) for (type i = a; i <= (type)(b); i += (type)(incr))
#define pb push_back
#define ppb pop_back
#define ff first
#define ss second
#define iter(it, s) for (auto it = s.begin(); it != s.end(); it++)
#define fillc(a,b) memset(a,b,sizeof(a))
#define MOD 1000000007
#define INF 1e17
#define multi_test 0

bool compare(pll u,pll v)
{
	return u.ff<=v.ff;
}

void solve()
{
	ll n,i,j,t;
	cin>>n;
	pair<long double,long double> in[n];
	long double inc=1e-9;
	for(i=0;i<n;i++)
	{
		cin>>t>>in[i].ff>>in[i].ss;
		if(t==2)
			in[i].ss-=inc;
		else if(t==3)
			in[i].ff+=inc;
		else if(t==4)
			in[i].ff+=inc,in[i].ss-=inc;
	}
	sort(in,in+n);
	ll ans=0;
	/*for(i=0;i<n;i++)
		cout<<setprecision(20)<<l[i]<<" "<<r[i]<<endl;*/
	for(i=0;i<n;i++)
	{
		for(j=i+1;j<n;j++)
		{
			if(in[j].ff>=in[i].ff && in[j].ff<=in[i].ss)
				ans++;
			//cout<<ans<<" ";
		}
		//cout<<endl;
	}
	cout<<ans<<endl;
}

int main()
{
    //freopen("input.txt","r",stdin);freopen("output.txt","w",stdout);
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    int t=1,i;
    if (multi_test)
        cin>>t;
    for(i=1;i<=t;i++)
        solve();
}


#include <bits/stdc++.h>
using namespace std;
int main() {
  long long S;
  long long P;
  cin>>S>>P;
  int a=0;
  long long sum=sqrt(P);
  for(long long i=0;i<sum;i++){
    if(S*(i+1)-(i+1)*(i+1)==P){
      cout<<"Yes"<<endl;
      a=1;
      break;
    }
  }
  if(a==0){
    cout<<"No"<<endl;
  }
}

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

int main()
{
    long long int n, k;
    cin >> n >> k;
    for(int i = 0;i < k;i++){
        if(n % 200 == 0){
            n /= 200;
        }
        else{
            n = n * 1000 + 200;
        }
    }
    cout << n << endl;
}


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

#define rep(i, a, b) for (int i = (int)(a); (i) < (int)(b); (i)++)
#define rrep(i, a, b) for (int i = (int)(b) - 1; (i) >= (int)(a); (i)--)
#define all(v) v.begin(), v.end()

typedef long long ll;
template <class T> using V = vector<T>;
template <class T> using VV = vector<V<T>>;

/* 提出時これをコメントアウトする */
// #define LOCAL true

#ifdef LOCAL
#define dbg(x) cerr << __LINE__ << " : " << #x << " = " << (x) << endl
#else
#define dbg(x) true
#endif

struct P{
    int x, y, r, id;
    P(int x=0, int y=0, int r=0, int id=0) : x(x), y(y), r(r), id(id) {}
    bool operator <(const P& other) const {
        return r < other.r;
    }
};

struct S{
    int a,b,c,d,id;
    S(int a=0, int b=0, int c=0, int d=0, int id=0) :a(a),b(b),c(c),d(d),id(id) {}
};

struct Point {
    int x, y;
    Point(int x=0, int y=0) : x(x),y(y) {}
    bool operator <(const Point& other) const {
        if (y != other.y) return y < other.y;
        return x < other.x;
    }
};

auto solve (int n, V<P>& v) -> V<S> {
    // 面積が小さいほうから見る
    sort(all(v));

    V<S> ret(n);
    set<Point> st;

    // version 1: (x,y), (x+1,y+1)
    rep(i,0,n) {
        ret[i] = S(v[i].x,v[i].y,v[i].x+1,v[i].y+1,v[i].id);
        st.insert(Point(v[i].x,v[i].y));
    }

    // version 2: 横だけに伸ばす
    // => cをできるだけ大きくする
    rep(i,0,n) {
        int c = ret[i].c;
        int d = ret[i].d;
        while (!st.count(Point(c,d-1)) && c < 10000) {
            if (c - ret[i].a >= v[ret[i].id].r) break;
            c++;
        }
        ret[i].c = c;
    }

    return ret;
}

int main() {
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    constexpr char endl = '\n';

    // input
    int n;
    cin >> n;
    V<P> v(n);
    rep(i,0,n) {
        cin >> v[i].x >> v[i].y >> v[i].r;
        v[i].id = i;
    }

    // solve
    auto ans = solve(n, v);

    // output
    V<int> a(n),b(n),c(n),d(n);
    rep(i,0,n) {
        a[ans[i].id] = ans[i].a;
        b[ans[i].id] = ans[i].b;
        c[ans[i].id] = ans[i].c;
        d[ans[i].id] = ans[i].d;
    }
    rep(i,0,n) {
        cout << a[i] << " " << b[i] << " " << c[i] << " " << d[i] << endl;
    }
    return 0;
}

#include <bits/stdc++.h>

using namespace std;

using int64 = long long;
const int mod = 1e9 + 7;
//const int mod = 998244353;

const int64 infll = (1LL << 62) - 1;
const int inf = (1 << 30) - 1;

struct IoSetup {
  IoSetup() {
    cin.tie(nullptr);
    ios::sync_with_stdio(false);
    cout << fixed << setprecision(10);
    cerr << fixed << setprecision(10);
  }
} iosetup;

template< typename T1, typename T2 >
ostream &operator<<(ostream &os, const pair< T1, T2 > &p) {
  os << p.first << " " << p.second;
  return os;
}

template< typename T1, typename T2 >
istream &operator>>(istream &is, pair< T1, T2 > &p) {
  is >> p.first >> p.second;
  return is;
}

template< typename T >
ostream &operator<<(ostream &os, const vector< T > &v) {
  for(int i = 0; i < (int) v.size(); i++) {
    os << v[i] << (i + 1 != v.size() ? " " : "");
  }
  return os;
}

template< typename T >
istream &operator>>(istream &is, vector< T > &v) {
  for(T &in : v) is >> in;
  return is;
}

template< typename T1, typename T2 >
inline bool chmax(T1 &a, T2 b) { return a < b && (a = b, true); }

template< typename T1, typename T2 >
inline bool chmin(T1 &a, T2 b) {
  if(b < 0)b *= -1;
  return a > b && (a = b, true);
}

template< typename T = int64 >
vector< T > make_v(size_t a) {
  return vector< T >(a);
}

template< typename T, typename... Ts >
auto make_v(size_t a, Ts... ts) {
  return vector< decltype(make_v< T >(ts...)) >(a, make_v< T >(ts...));
}

template< typename T, typename V >
typename enable_if< is_class< T >::value == 0 >::type fill_v(T &t, const V &v) {
  t = v;
}

template< typename T, typename V >
typename enable_if< is_class< T >::value != 0 >::type fill_v(T &t, const V &v) {
  for(auto &e : t) fill_v(e, v);
}

template< typename F >
struct FixPoint : F {
  FixPoint(F &&f) : F(forward< F >(f)) {}

  template< typename... Args >
  decltype(auto) operator()(Args &&... args) const {
    return F::operator()(*this, forward< Args >(args)...);
  }
};

template< typename F >
inline decltype(auto) MFP(F &&f) {
  return FixPoint< F >{forward< F >(f)};
}

int main() {
  int N;
  cin >> N;
  vector< int > T(N);
  cin >> T;
  auto dp = make_v< int >(100001);
  fill_v(dp, inf);
  dp[0] = 0;
  for(auto &t : T) {
    auto dp2 = make_v< int >(100001);
    fill_v(dp2, inf);
    for(int i = 100000; i >= t; i--) {
      chmin(dp2[i], dp[i - t]);
    }
    for(int i = 100000; i >= 0; i--) {
      chmin(dp2[i], dp[i] + t);
    }
    dp = move(dp2);
  }
  int ret = inf;
  for(int i = 0; i < 100001; i++) {
    chmin(ret, max(dp[i], i));
  }
  cout << ret << "\n";
}


#include<bits/stdc++.h>
using namespace std;
int main()
{
    long long n;
    cin>>n;
    cout<<100-n%100<<endl;
}

#include<bits/stdc++.h>
using namespace std;
#define IOS ios::sync_with_stdio(false);cin.tie(0);
#define ch(a) (int(a-'a')+1)
#define mm(a) memset(a,0,sizeof(a))
#define rep(i,a,b) for(int i=(a);i<=(b);i++)
#define repp(i,a,b) for(int i=(a);i<(b);i++)
typedef long long ll;
int main(){
	int x;
	scanf("%d",&x);
    if(x%100==0) printf("100\n");
	else if(x%100!=0){
		printf("%d\n",100-(x%100));
	}
}


 #include <bits/stdc++.h>
  #include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace std;
using namespace __gnu_pbds;
#define endl "\n"
#define ll long long
#define ld long double
#define pb(a) push_back(a)
#define arr(a) new ll int[a]
#define INF 4000000000000000000
#define MOD 1000000007
#define MOD1 998244353
#define MOD2 999979621
#define arr1(a) new arra[a]
#define str(a) new string[a]
#define all(v) v.begin(),v.end()
#define mp(a,b) make_pair(a,b)
#define F first
#define S second
#define PI 3.14159265
#define oset tree<ll, null_type,less_equal<ll>, rb_tree_tag,tree_order_statistics_node_update>
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
typedef vector<ll> vll;
typedef vector<int> vi;
typedef vector<bool> vb;
void yes(){cout<<"YES"<<endl;}
void no(){cout<<"NO"<<endl;}
//const int N = 200001,p=31;
//ll int pw[N],inv_pw[N],hash2[N+1],hash1[N+1],pw1[N],inv_pw1[N],hash1r[N+1],hash2r[N+1];
//ll fact[N];
//void factorial(ll mod){
//    fact[0] = fact[1] = 1;
//    for(ll i = 2; i < N; i++)
//        fact[i] = (fact[i-1] * i) % mod;
//}
 ll power(ll a, ll b, ll mod){
 	ll x = 1, y = a;
 	while (b > 0){
 		if (b%2){
 			x = (x*y)%mod;
 		}
 		y = (y*y)%mod;
 		b /= 2;
 	}
 	return x%mod;
 }
////////
ll modular_inverse(ll n, ll mod){
	return power(n, mod-2, mod);
}
//void precal()
//{
//    pw[0]=1;
//    pw1[0]=1;
//    inv_pw1[0]=1;
//    inv_pw[0]=1;
//    ll int temp=modular_inverse(p,MOD),temp1=modular_inverse(p,MOD1);
//    for(ll int i=1;i<N;i++)
//    {
//        pw[i]=(pw[i-1]*p)%MOD;
//        pw1[i]=(pw1[i-1]*p)%MOD1;
//        inv_pw1[i]=(inv_pw1[i-1]*temp1)%MOD1;
//        inv_pw[i]=(inv_pw[i-1]*temp)%MOD;
//    }
//}
//void build(string& s,ll int hash1[],ll int pw[],ll int mod)
//{
//    ll int n=s.size();
//    for(ll int i=1;i<=n;i++)
//    {
//        hash1[i]=(hash1[i-1]+(pw[i-1]*(s[i-1]-'a'+1))%mod)%mod;
//    }
//}
//ll int get_hash(ll int hash1[],ll int inv_pw[],ll int mod,ll int l,ll int r)
//{
//    if(l>r)return 0;
//    ll int res=(hash1[r]-hash1[l-1]+mod)%mod;
//    res=(res*inv_pw[l-1])%mod;
//    return res;
//}
//ll nCr(ll n, ll k, ll mod){
//	return (fact[n]*((modular_inverse(fact[k],mod)*modular_inverse(fact[n-k],mod))%mod))%mod;
//}
//typedef struct node{
//    node* left;
//    node* right;
//    ll d;
//}node;
//node* create(ll int i)
//{
//    node* temp=new node;
//    temp->d=i;
//    temp->left=NULL;
//    temp->right=NULL;
//    return temp;
//}
//struct arra{
//    int l,r;
//}arr1[5001];
//bool comp(struct arra a,struct arra b)
//{
//    return (a.d<b.d);
//}
//bool comp1(struct arra a,struct arra b)
//{
//    return (a.h<b.h);
//}
//bool comp1(ll val,struct arra a) //arr.d in increasing order(upperbound comp function
//{
//    return val<a.d;
//}
//bool comp3(struct arra a,ll val) //arr.d in increasing order(lowerbound comp function
//{
//    return a.h<val;
//}
//int dsu[100001],s[100001];
//int find(int a)
//{
//    if(dsu[a]!=a)
//    {
//        dsu[a]=find(dsu[a]);
//    }
//    return dsu[a];
//}
//void add(int a,int b)
//{
//    int x=find(a);
//    int y=find(b);
//    if(x==y)return;
//    if(s[x]>s[y])
//    {
//        dsu[y]=x;
//        s[x]+=s[y];
//    }
//    else{
//        dsu[x]=y;
//        s[y]+=s[x];
//    }
//}
ll n;
ll arr[3001],dp[3002][3002],suff[3002],dp1[3002][3002];
int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL); cout.tie(NULL);
//    #ifndef ONLINE_JUDGE
//    freopen("input.txt", "r", stdin);
//    freopen("output.txt", "w", stdout);
//    #endif
    cin>>n;
    ll a;
    for(int i=1;i<=n;i++)cin>>arr[i];
    for(int i=n;i>=1;i--)suff[i]=suff[i+1]+arr[i];
    for(int i=1;i<=n;i++)dp1[i][0]=1;
    for(int i=n;i>=1;i--)
    {
        for(int j=i;j>=1;j--)
        {
            a=suff[i]%j;
            dp[i][j]=dp1[j][a];
            dp1[j][a]=(dp1[j][a]+dp[i][j+1])%MOD;
        }
    }
    cout<<dp[1][1];
}

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

    #define fast { ios :: sync_with_stdio(false); cin.tie(0); cout.tie(0); }
    #define pb push_back
    #define ll long long

    #define vi vector<int>
    #define vll vector<long long>
    #define mp make_pair
    #define infi INT_MAX
    #define infl LONG_LONG_MAX
    #define infd LDBL_MAX
    #define f(i,a,b) for(ll i=a;i<b;i++)
    #define ff first
    #define ss second
    #define pll pair<ll,ll>
    #define endl "\n"
    #define ALL(v) v.begin(),v.end()
    #define nl cout<<"\n";
    #define pr(x) cout<<x;
    #define pr1(x) cout<<x<<" ";
    #define pr2(x,y) cout<<x<<" "<<y;
    #define deb printf("*****************************\n");
    #define idk printf("idk idk ! \n");
    #define hi printf("hi ! \n");
    #define bye printf("bye bye ! \n");
    #define o_set(ll) tree<ll, null_type,less<ll>, rb_tree_tag,tree_order_statistics_node_update>
    #define number_of_set_bits  __builtin_popcountll

    //template<typename T>
    //#define o_set(T) tree<T, null_type,less<T>, rb_tree_tag,tree_order_statistics_node_update>
    //member functions :
    //1. order_of_key(k) : number of elements strictly lesser than k
    //2. find_by_order(k) : k-th element in the set

   const int mod = 1e9 + 7;

 ll add(ll a, ll b){
     return (a+b)%mod;
 }

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

        ll ntc=1;
     //  cin>>ntc;

        f(ks,1,ntc+1)
        {
          //cout<<"Case #"<<ks<<": ";
          ll n; cin>>n;
          vector<vll> dp(n+1, vll(n+1) );
          dp[0][0] = 1;
          vll v(n+1);
          f(i,1,n+1) cin>>v[i];
          vll psum(n+1);
          f(i,1,n+1) psum[i] = psum[i-1] + v[i];

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

          for(int j = 2; j <= n; ++j){
              map<ll,ll> m;
              ll sum = 0;
          for(int i = 1; i <=n; ++i){
                ll newsum = (sum + v[i])%j;
                dp[i][j] = add(dp[i][j] , m[newsum]);
                m[newsum] = add(dp[i][j-1],m[newsum]);
                sum =  newsum;
            }
          }
          ll ans = 0;
          f(j,1,n+1) ans = add(ans, dp[n][j]);
         cout<<ans<<endl;

        }

        return 0;
    }


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

using namespace std;

double aa, bb;

int main()
{
	scanf("%lf%lf", &aa, &bb);;
	printf("%.5f", (aa - bb) / aa * 100);;
	return 0;
}

#include <bits/stdc++.h>
using namespace std;
#define IOS              ios_base::sync_with_stdio(false);cin.tie(0), cout.tie(0);
#define print(a)         for(int i=0;i<(a.size());i++){cout<<a[i]<<"\n";}
#define sortt(a)         sort(a.begin(),a.end())
#define rep(i,a,b)       for(int i=a;i<b;i++)
#define int              long long
#define pb               push_back
#define PQ               priority_queue
#define F                first
#define S                second
#define mod              1000000007
#define endl             "\n"
// const int N=2e6;
// int minn=INT_MAX;
// int maxx=INT_MIN;
// int a[N];
void Usolve()
{
    double a,b; cin>>a>>b;
    double ans=100*(1-b/a);
    cout<<ans<<endl;
}

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

    IOS;
    int t=1;
    // cin>>t;
    while(t--)
    {
        Usolve();
    }
    return 0;
}


#include <iostream>
#include <vector>
using namespace std;

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

    long long MOD = 998244353;
    vector<vector<long long>> C(N+1, vector<long long>(N+1));
    for (int i=0; i<=N; i++)
    {
        C[i][0] = 1;
        for (int j=1; j<i; j++)
            C[i][j] = (C[i-1][j-1]+C[i-1][j])%MOD;
        C[i][i] = 1;
    }

    //for (int i=0; i<=N; i++)
    //{
    //    for (int j=0; j<=i; j++)
    //        cout<<" "<<C[i][j];
    //    cout<<endl;
    //}

    vector<long long> T(N+1);
    T[0] = 1;
    for (int i=0; i<16; i++)
    {
        vector<long long> P(N+1);
        P.swap(T);
        for (int j=0; j<=N; j++)
            for (int k=0; k<=N; k+=2)
                if (j%2==(M>>i&1))
                    (T[(j>>1)+(k>>1)] += C[N][k]*P[j]%MOD) %= MOD;
    }
    cout<<T[0]<<endl;
}

#include <iostream>
#include <vector>
#include <string>
#include <array>
#include <functional>
#include <algorithm>
#include <stack>
#include <map>
#include <set>
#include <climits>
#include <queue>
#include <bitset>
#include <cassert>
#include <math.h>
#include <complex>
#include <iomanip>
#include <unordered_map>
using namespace std;
#define ll long long
#define pb(x) push_back(x)
#ifdef _OLIMPOLOCAL
    #define debug(...) cerr << "[" << #__VA_ARGS__ << "]:", debug_out(__VA_ARGS__)
#else
    #define debug(...) 1337
#endif
void debug_out() { cout << "\n";}
template<typename T1, typename... T2> void debug_out(T1 A, T2... B) { cout << " " << A; debug_out(B...); }
int test = 1;
#define out(x) {cout << x << "\n";return;}
#define all(N) N.begin(),N.end()
#define allr(N) N.rbegin(),N.rend()
template<typename T1>
void pr(vector<T1> V, int add = 0, int start = -1, int end = -1) {
    if (start < 0) start = 0;
    if (end < 0) end = V.size() - 1;
    for (int i = start; i <= end; i++) {
        cout << V[i] + add << ((i == end) ? "\n" : " ");
    }
}
template<typename T1>
T1 chmin(T1 &x, const T1 v) { return x = min(x,v); }
template<typename T1>
T1 chmax(T1 &x, const T1 v) { return x = max(x,v); }

#define rep(i, n) for (int i = 0; i < n; i++)
#define reps(i, s, n) for (int i = s; i < n; i++)
#define repr(i, n) for (int i = n-1; i >= 0; i--)
#define repsr(i, s, n) for (int i = n-1; i >= s; i--)
#define PI pair<int,int>
template<typename T1>
T1 gcd(const T1 &a, const T1 &b) {
    if (a == 0 || b == 0) return a + b;
    return gcd(b, a %b);
}
//-------------------------- ^ DONT TOUCH ^-----------------------------------------------------------------
#define MAX 200001
#define MOD 998244353

long long power(long long x, long long n) {
    long long p = x;
    long long s = 1;
    while (n > 0) {
        if (n & 1) s = (s * p) % MOD;
        p = (p * p) % MOD;
        n /= 2;
    }
    return s;
}

vector<long long>_fact(2, 1);
long long Comb(int n, int k) {
    if (_fact.size() <= n) {
        int j = _fact.size();
        _fact.resize(n+1);
        for(long long i = j; i <=n; i++) {
            _fact[i] = (_fact[i-1] * i) % MOD;
        }
    }
    if (k == 0) return 1;
    if (k > n || k < 0) return 0;
    long long r = _fact[n];
    r = (r * power(_fact[k], MOD - 2)) % MOD;
    r = (r * power(_fact[n-k], MOD - 2)) % MOD;
    return r;
}

ll a;
int n;
ll M[15][5001];
bool H[15][5001];

ll comb(int pp, ll p, ll s) {
    if (p == 1) {
        if (n < s || s % 2 == 1) return 0;
        return Comb(n, s);
    }
    if (H[pp][s]) return M[pp][s];
    H[pp][s] = 1;

    ll v = 0;
    for(ll i = 0; (i * p <= s) && (i <= n); i+=2) {
        v += (comb(pp-1, p / 2, s - p * i) * Comb(n, i)) % MOD;
        v %= MOD;
    }
    return M[pp][s] = (v % MOD);
}

void solve() {
    int  m; cin >> n >> m;
    a = comb(14, 1 << 14, m);
    out(a);
}

int main() {
    ios_base::sync_with_stdio(0);cin.tie(0);
    int test = 1;
    //cin >> test;
    rep(testCase, test) {
        solve();
    }
    return 0;
}


#include <bits/stdc++.h>

using namespace std;
using i64 = long long;
#define endl "\n"

int main() {
    i64 N;
    cin >> N;
    vector<i64> A(N);
    for (i64 i = 0; i < N; i++) {
        cin >> A[i];
    }
    N = min(N, 8LL);
    vector<i64> p(200, -1);
    for (i64 bit = 1; bit < (1LL << N); bit++) {
        i64 sum = 0;
        for (i64 i = 0; i < N; i++) {
            if (bit & (1 << i)) {
                (sum += A[i]) %= 200;
            }
        }
        if (p[sum] == -1) {
            p[sum] = bit;
        } else {
            cout << "Yes" << endl;
            i64 x = 0, y = 0;
            for (i64 i = 0; i < N; i++) {
                if (p[sum] & (1LL << i)) {
                    x++;
                }
                if (bit & (1LL << i)) {
                    y++;
                }
            }
            cout << x;
            for (i64 i = 0; i < N; i++) {
                if (p[sum] & (1LL << i)) {
                    cout << " " << i + 1;
                }
            }
            cout << endl << y;
            for (i64 i = 0; i < N; i++) {
                if (bit & (1LL << i)) {
                    cout << " " << i + 1;
                }
            }
            cout << endl;
            return 0;
        }
    }
    cout << "No" << endl;
    return 0;
}

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

int main(void){
  int n;
  cin>>n;
  vector<long long> A(n);
  for(int i=0;i<n;i++) cin>>A[i];

  long long ans = 10e17;
  for(int i=0;i<(1<<n);i++){
    long long xorv = 0;
    long long orv = 0;
    for(int j=0;j<=n;j++){
        if(j < n) orv = orv | A[j];
        if(((i>>j)&1) || j==n){
          xorv = xorv ^ orv;
          orv = 0;
        }
    }
    ans = min(ans, xorv);
  }

  cout << ans << endl;
}


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

int main(){
	long r, x, y;
	cin >> r >> x >> y;
	double f=sqrt(x*x+y*y);
	if(f<r){
		cout << ceil(f/(double)r)+1 << endl;
	}else{
		cout << ceil(f/(double)r) << endl;
	}
	return 0;
}

#include <bits/stdc++.h>
#define endl "\n"
#define rep(i, n) for(int i = 0; i < int(n); i++)
#define rep2(i, s, n) for(int i = (s); i < int(n); i++)
#define e_b emplace_back
#define all(x) (x).begin(),(x).end()
using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair<int, int> ipair;
typedef pair<ll, ll> lpair;
template <class T> ostream &operator << (ostream &o, const vector<T> &v) //vectorの中身を見る
{o << "{"; for(int i = 0; i < (int)v.size(); i++) o << (i > 0 ? ", ":"") << v[i]; o << "}"; return o;}
void map_p(map<int, int> &d){cout << "map: "; for(auto a : d){cout << "{" << a.first << ":" << a.second << "}, ";} cout << endl;} //mapの中身を見る
void set_p(set<int> &d){cout << "set: "; for(int a : d){cout << a << ", ";} cout << endl;} //setの中身を見る

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

    ll r, x, y;
    cin >> r >> x >> y;
    ll dis_2 = x * x + y * y;
    ll now = 0;
    while(dis_2 >= now * now){
        now++;
    }
    now--;
    // コーナーケース
    if(now < r){
        cout << 2 << endl;
        return 0;
    }
    ll ans = 0;
    if(now * now == dis_2){
        ans = (now - 1) / r + 1;
    }else{
        if(now % r == 0) ans =  (now - 1) / r + 1 + 1;
        else ans = (now - 1) / r + 1;
    }
    cout << ans << endl;
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
#define fast {ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);}
typedef long long int ll;
typedef string S;
#define M 1e18
#define AS 250005
#define sp cout<<' '
#define nw cout<<endl
#define rt return
#define __ template<typename T, typename... Types>
void in() {rt;} __ void in(T &a, Types&... b){cin>>(a); in(b...);}
void o() {rt;}  __ void o(T a, Types... b){cout<<(a);sp; o(b...);}
#define fr(Hi,a,n) for(ll Hi=a;Hi<=n;Hi++)
#define frm(Hi,a,n) for(ll Hi=n;Hi>=a;Hi--)
#define P pair<ll,ll>
#define vc vector<ll>
#define pb push_back
#define MP map<ll,ll>
bool sortin(const pair<ll,ll> &e,const pair<ll,ll> &f){return (e.first<f.first);}
bool POT(ll x){return x && (!(x&(x-1)));}
ll i,j,k,l,m,n,p,q,r,a,b,c,x,y,z,ts,mn=1e18,mod=1e9+7;
ll ar[AS],br[AS],xr[AS],tem[AS];
int main()
{
    fast;
    in(ts);
    while(ts--)
        {
    in(l,r);
    l*=2;
    if(l>r)o(0);
    else x=r-l+1,o((x*(x+1))/2);
    nw;
        }
}

#include<bits/stdc++.h>
using namespace std;
int t;
long long ans;
long long l,r;
int main()
{
	cin>>t;
	for(int o=1;o<=t;o++)
	{
		cin>>l>>r;
		if(r<2*l)
		{
			printf("0\n");
			continue;
		}
		ans=(r-l+1ll)*(r-2ll*l+1ll);
		ans-=r*(r-2ll*l+1ll)/2ll;
		cout<<ans<<endl;
	}
	return 0;
}


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

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

    vector<int> a(n),b(n);

    for(int i = 0;i<n;++i){
        cin>>a[i];
    }
    for(int i = 0;i<n;++i){
        cin>>b[i];
    }

    int left = INT_MIN;
    int right = INT_MAX;

    for(int i = 0;i<n;++i){
        left = max(left,a[i]);
        right = min(right,b[i]);
    }
    cout<< max(0,right-left+1);

	return 0;
}

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

int main()
{
    int nem[1000]={0};
    int N;
    cin >> N;
    int a[N], b[N];
    for (int i = 0; i < N; i++)
    {
        cin >> a[i];
    }
    for (int i = 0; i < N; i++)
    {
        cin >> b[i];
    }

    for (int i = 0; i < N; i++)
    {
        for (int j = 0; j <1000; j++)
        {
            if (j < a[i]-1)
            {
                nem[j]++;
            }

            if (j > b[i] - 1)
            {
                nem[j]++;
            }
            else continue;
        }
    }

    int counter = 0;
    for (int k = 0; k < 1000; k++)
    {
        if (nem[k] == 0)
        {
            counter++;
        }
    }

        cout << counter << endl;
}


// Author : heyuhhh
// Created Time : 2021/03/26 09:30:22
#include<bits/stdc++.h>
#define MP make_pair
#define fi first
#define se second
#define pb push_back
#define sz(x) (int)(x).size()
#define all(x) (x).begin(), (x).end()
#define INF 0x3f3f3f3f
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
//head
const int N = 1e5 + 5;
void run() {
    int n, m;
    cin >> n >> m;
    vector<string> s(n);
    for (int i = 0; i < n; i++) {
        cin >> s[i];
    }
    int even = 0, odd = 0;
    ll ans = 1ll * n * (n - 1) / 2;
    for (int i = 0; i < n; i++) {
        int cnt = 0;
        for (int j = 0; j < m; j++) {
            cnt += (s[i][j] - '0');
        }
        if (cnt & 1) {
            ans -= odd;
            ++odd;
        } else {
            ans -= even;
            ++even;
        }
    }
    cout << ans << '\n';
}
int main() {
#ifdef Local
    freopen("input.in", "r", stdin);
#endif
    ios::sync_with_stdio(false);
    cin.tie(0); cout.tie(0);
    cout << fixed << setprecision(20);
    run();
    return 0;
}

#include <bits/stdc++.h>
#define ADD(a, b) a = (a + ll(b)) % mod
#define MUL(a, b) a = (a * ll(b)) % mod
#define MAX(a, b) a = max(a, b)
#define MIN(a, b) a = min(a, b)
#define rep(i, a, b) for(int i = int(a); i < int(b); i++)
#define rer(i, a, b) for(int i = int(a) - 1; i >= int(b); i--)
#define all(a) (a).begin(), (a).end()
#define sz(v) (int)(v).size()
#define pb push_back
#define sec second
#define fst first
#define debug(fmt, ...) Debug(__LINE__, ":", fmt, ##__VA_ARGS__)
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int, int> pi;
typedef pair<ll, ll> pl;
typedef pair<int, pi> ppi;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef vector<vl> mat;
typedef complex<double> comp;
void Debug() {cerr << '\n'; }
template<class FIRST, class... REST>void Debug(FIRST arg, REST... rest){
	cerr<<arg<<" ";Debug(rest...);}
template<class T>ostream& operator<<(ostream& out,const vector<T>& v) {
	out<<"[";if(!v.empty()){rep(i,0,sz(v)-1)out<<v[i]<<", ";out<<v.back();}out<<"]";return out;}
template<class S, class T>ostream& operator<<(ostream& out,const pair<S, T>& v){
	out<<"("<<v.first<<", "<<v.second<<")";return out;}
const int MAX_N = 500010;
const int MAX_V = 100010;
const double eps = 1e-6;
const ll mod = 1000000007;
const int inf = (1 << 30) - 1;
const ll linf = 1LL << 60;
const double PI = 3.14159265358979323846;
mt19937 rng; //use it by rng() % mod, shuffle(all(vec), rng)
///////////////////////////////////////////////////////////////////////////////////////////////////

int N;
string S;
int A[MAX_N];

void solve() {
	cin >> N;
	cin >> S;
	for(int i = 0; i < N + 1; i++) cin >> A[i];
	int K = 10000;
	for(int i = 0; i < N; i++) MIN(K, abs(A[i] - A[i + 1]));
	cout << K << "\n";
	for(int j = 0; j < K; j++) {
		for(int i = 0; i < N + 1; i++) {
			cout << (A[i] + j) / K << " ";
		}
		cout << "\n";
	}
}

uint32_t rd() {
	uint32_t res;
#ifdef __MINGW32__
	asm volatile("rdrand %0" :"=a"(res) ::"cc");
#else
	res = std::random_device()();
#endif
	return res;
}

int main() {
#ifndef LOCAL
	ios::sync_with_stdio(false);
    cin.tie(0);
#endif
    cout << fixed;
	cout.precision(20);
    cerr << fixed;
	cerr.precision(6);
	rng.seed(rd());
#ifdef LOCAL
	//freopen("in.txt", "wt", stdout); //for tester
	if(!freopen("in.txt", "rt", stdin)) return 1;
#endif
	solve();
    cerr << "Time: " << 1.0 * clock() / CLOCKS_PER_SEC << " s.\n";
	return 0;
}


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

int n, a[200010], b[200010];
long long ans = 0;
priority_queue <int, vector <int>, greater <int> > q;

int main() {
	scanf("%d", &n);
	for (int i = n - 1; i >= 0; --i) {
		scanf("%d", &a[i]);
		ans += a[i];
	}
	for (int i = 0; i < n; ++i) {
		int b; scanf("%d", &b);
		q.push(a[i]); q.push(b); ans += b;
		ans -= q.top(); q.pop();
	}
	printf("%lld\n", ans);
	return 0;
}

/**
 *  author: mahfuzz
 *  created: 01.11.2020
**/

#include <iostream>
#include <math.h>
#include <iomanip>
using namespace std;
typedef long long ll;

int main(int argc, char* argv[]){
    ios_base::sync_with_stdio(0);
    cin.tie(NULL);

    int n; cin >> n;
    ll man = 0, cheb = 0;
    double euclid;

    for(int i = 0; i < n; i++){
        ll x; cin >> x;
        x = abs(x);

        man += x;
        cheb = max(cheb, x);
        euclid += ((x * 1.0) * (x * 1.0));
    }

    cout << man << "\n";
    cout <<fixed << setprecision(10)<< sqrt(euclid) << "\n";
    cout << cheb << "\n";

    return 0;
}


#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int,int> iint;
typedef pair<ll,ll> llll;
#define ALL(x) (x).begin(),(x).end()
const ll zero = 0;
const ll one = 1;
const ll INF = 9223372036854775807; //10^18
const int inINF = 2147483647; //10^9
const ll MOD = 1000000007; //10^9+7
const ll MOD2 = 998244353;
void Yes() {printf("Yes\n");}
void No() {printf("No\n");}
void YES() {printf("YES\n");}
void NO() {printf("NO\n");}

int main(){
    int N; cin >> N;
    vector<ll> a(N);
    for (int i = 0; i < N; i++) {
        cin >> a[i];
    }
    vector<ll> c(200, 0);
    for (int i = 0; i < N; i++) {
        c[a[i] % 200]++;
    }
    ll ans = 0;
    for (ll i = 0; i < 200; i++) {
        ans += c[i] * (c[i] - 1) / 2;
    }
    cout << ans << endl;

}

#include<bits/stdc++.h>
using namespace std;
#define N 500050
typedef long long ll;
inline ll read(){
	ll 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;
}
int n,a[N],b[N],ans;
char s[N],t[N];
int main(){
	n=read();
	scanf("%s",s+1);
	scanf("%s",t+1);
	int sa=0,sb=0;
	for(int i=1;i<=n;++i)a[i]=s[i]-'0',sa+=a[i],b[i]=t[i]-'0',sb+=b[i];
	if(sa^sb)return !printf("-1\n");
	int i=1,j=1;
	while(true){
		while(i<=n&&a[i])++i;
		while(j<=n&&b[j])++j;
		if(i>n&&j>n)break;
		if(i^j)++ans;
		++i,++j;
	}
	printf("%d\n",ans);
	return 0;
}


#include <bits/stdc++.h>
// #include <atcoder/all>
using namespace std;
// using namespace atcoder;
#define rep(i, n) for (int i = 0; i < n; i++)
#define rep1(i, n) for (int i = 1; i <= n; i++)
#define rrep(i, n) for (int i = n - 1; i >= 0; i--)
#define rrep1(i, n) for (int i = n; i >= 1; i--)
#define all(x) x.begin(), x.end()
#define rall(x) x.rbegin(), x.rend()
#define eb emplace_back
#define fi first
#define se second
template <class T> using V = vector<T>;
template <class T> using VV = V<V<T>>;
typedef long long int ll;
typedef pair<int, int> P;
// typedef modint1000000007 mint;

void speedUpIO() {
    cin.tie(nullptr);
    ios::sync_with_stdio(false);
}

template <class T> bool chmax(T &a, const T &b) {
    if (a < b) {
        a = b;
        return true;
    }
    return false;
}
template <class T> bool chmin(T &a, const T &b) {
    if (b < a) {
        a = b;
        return true;
    }
    return false;
}
/*--------------------------------------------------*/
const int INF = (int)1e9;
const int MAX = (int)1e5;

void solve() {
    int m, h;
    cin >> m >> h;
    cout << ((h % m == 0) ? "Yes" : "No") << "\n";
}

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

//#define _GLIBCXX_DEBUG
//#include <atcoder/all>
#include <bits/stdc++.h>
#include <chrono>
#include <random>

#ifndef ATCODER_DSU_HPP
#define ATCODER_DSU_HPP 1

#include <algorithm>
#include <cassert>
#include <vector>

namespace atcoder {

// Implement (union by size) + (path compression)
// Reference:
// Zvi Galil and Giuseppe F. Italiano,
// Data structures and algorithms for disjoint set union problems
struct dsu {
  public:
    dsu() : _n(0) {}
    dsu(int n) : _n(n), parent_or_size(n, -1) {}

    int merge(int a, int b) {
        assert(0 <= a && a < _n);
        assert(0 <= b && b < _n);
        int x = leader(a), y = leader(b);
        if (x == y) return x;
        if (-parent_or_size[x] < -parent_or_size[y]) std::swap(x, y);
        parent_or_size[x] += parent_or_size[y];
        parent_or_size[y] = x;
        return x;
    }

    bool same(int a, int b) {
        assert(0 <= a && a < _n);
        assert(0 <= b && b < _n);
        return leader(a) == leader(b);
    }

    int leader(int a) {
        assert(0 <= a && a < _n);
        if (parent_or_size[a] < 0) return a;
        return parent_or_size[a] = leader(parent_or_size[a]);
    }

    int size(int a) {
        assert(0 <= a && a < _n);
        return -parent_or_size[leader(a)];
    }

    std::vector<std::vector<int>> groups() {
        std::vector<int> leader_buf(_n), group_size(_n);
        for (int i = 0; i < _n; i++) {
            leader_buf[i] = leader(i);
            group_size[leader_buf[i]]++;
        }
        std::vector<std::vector<int>> result(_n);
        for (int i = 0; i < _n; i++) {
            result[i].reserve(group_size[i]);
        }
        for (int i = 0; i < _n; i++) {
            result[leader_buf[i]].push_back(i);
        }
        result.erase(
            std::remove_if(result.begin(), result.end(),
                           [&](const std::vector<int>& v) { return v.empty(); }),
            result.end());
        return result;
    }

  private:
    int _n;
    // root node: -1 * component size
    // otherwise: parent
    std::vector<int> parent_or_size;
};

}  // namespace atcoder

#endif  // ATCODER_DSU_HPP

using namespace std;
using namespace atcoder;
#define rep(i,n) for (int i = 0;i < (int)(n);i++)
using ll = long long;
const ll MOD=1000000007;
//const ll MOD=998244353;
//using mint = modint998244353;
//using mint = modint1000000007;
const long long INF = 1LL << 60;
const double pi=acos(-1.0);
int dx[9] = {1, 0, -1, 0, 1, 1, -1, -1, 0};
int dy[9] = {0, 1, 0, -1, 1, -1, -1, 1, 0};

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

int main()
{
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
  // cout << fixed << setprecision(15);

  ll N,M; cin>>N>>M;
  if(M==0) {
    ll l=1;
    rep(i,N){
      cout<<l<<' '<<l+1<<'\n';
      l+=2;
    }
    return 0;
  }
  if(M<0||N<M+2) {cout<<-1<<'\n'; return 0;}
  rep(i,N-M-1) cout<<i+1<<' '<<int(1e9)-i<<'\n';
  ll l=N-M;
  rep(i,M+1){
    cout<<l<<' '<<l+1<<'\n';
    l+=2;
  }

  return 0;
}


#include<iostream>
#include<sstream>
#include<iomanip>
#include<cstdlib>
#include<algorithm>
#include<vector>
#include<map>
#include<cmath>
#include<string>
#include<numeric>
#include<queue>

#define rep(i,p) for(long long int i=0;i<p;i++)
#define reep(i,p) for(long long int i=1;i<=p;i++)
#define ll long long
#define MOD 1000000007
#define INF 9223372036854775800

using namespace std;

int main(){

ll int N;
cin >> N;
vector< vector < ll int > > C(N,vector< ll int > (N) );
ll int Su=0;
rep(i,N){
	rep(j,N){
		cin >> C[i][j];
		Su += C[i][j];

	}
}

vector< vector < ll int > > kari;
vector< ll int > A(N);
vector< ll int > B(N);
//cout << Su << endl << endl;
/*
rep(i,100){
	ll int sum = 0;
	A[0] = i;
	rep(j,N){
		B[j] = C[0][j] - A[0];
		sum += B[j] * N;
	}
	rep(j,N){
		A[j] = C[j][0] - B[j];
		sum += A[j] * N;
	}
	rep(j,N){
		cout << sum << endl;
	}
}
*/
rep(i,N){
	rep(k,N){
	ll int sum = 0;
	A[i] = 0;
	rep(j,N){
		B[j] = C[i][j] - A[i];
		sum += B[j] * N;
	}
	rep(j,N){
		A[j] = C[j][k] - B[k];
		sum += A[j] * N;
	}
	//	cout << sum << endl;
		if( sum == Su ){
			A[0] = A[0] - (*min_element(A.begin(),A.end()));
			rep(j,N){
				B[j] = C[0][j] - A[0];
				sum += B[j] * N;
			}
			rep(j,N){
				A[j] = C[j][0] - B[0];
				sum += A[j] * N;
			}
			rep(a,N){
				rep(b,N){
					if( C[a][b] != A[a] + B[b] ){
						cout << "No" << endl;
						return 0;
					}
				}
			}
			cout << "Yes" << endl;
			rep(j,N-1){
				cout << A[j] << " ";
			}
			cout << A[N-1] << endl;
			rep(j,N-1){
				cout << B[j] << " ";
			}
			cout << B[N-1] << endl;
			return 0;
		}

//	rep(j,N){
//		cout << A[0] - (*min_element(A.begin(),A.end())) << " " <<
//			A[0] + (*min_element(B.begin(),B.end())) << endl;
//	}
//	cout << endl;
}
}

cout << "No" << endl;

	return 0;

}

#include <bits/stdc++.h>
using namespace std;
#define int long long
const int MAXN = 5e2 + 50;
int diffa[MAXN], diffb[MAXN];
int a[MAXN], b[MAXN], c[MAXN][MAXN];
bool check(int n) {
    for (int i = 1; i <= n; ++i)
        for (int j = 1; j <= n; ++j)
            if (a[i] + b[j] != c[i][j] || a[i] < 0 || b[j] < 0)
                return false;
    return true;
}
signed main(/*int argc, char *argv[]*/) {
    //ios::sync_with_stdio(false); cin.tie(0); cout.tie(0);
    int n;
    cin >> n;
    for (int i = 1; i <= n; ++i)
        for (int j = 1; j <= n; ++j)
            cin >> c[i][j];
    int mn1 = 0x3f3f3f3f, res1 = 0, mn2 = 0x3f3f3f3f, res2 = 0;
    for (int i = 2; i <= n; ++i) diffb[i] = c[1][i] - c[1][i - 1], res1 += diffb[i], mn1 = min(mn1, res1);
    for (int i = 2; i <= n; ++i) diffa[i] = c[i][1] - c[i - 1][1], res2 += diffa[i], mn2 = min(mn2, res2);
    for (int i = 2; i <= n; ++i) {
        for (int j = 2; j <= n; ++j) {
            if (c[i][j] - c[i][j - 1] != diffb[j]) {
                puts("No");
                system("pause");
                return 0;
            }
        }
    }
    //cout << mn1 << ' ' << mn2 << '\n';
    for (int i = -mn2; i <= c[1][1] + mn1; ++i) {
        a[1] = i, b[1] = c[1][1] - a[1];
        //if (b[1] - mn1 < 0) break;
        for (int i = 2; i <= n; ++i) a[i] = a[i - 1] + diffa[i], b[i] = b[i - 1] + diffb[i];;
        if (check(n)) {
            puts("Yes");
            for (int i = 1; i <= n; ++i) cout << a[i] << " \n"[i == n];
            for (int i = 1; i <= n; ++i) cout << b[i] << " \n"[i == n];
            system("pause");
            return 0;
        }
    }
    puts("No");
    system("pause");
    return 0;
}


#include<iostream>
#include<vector>
#include<iomanip>
using namespace std;

int score(string S){
    int res=0;
    vector<int> a(10);
    for(char c: S)a[c-'0']++;
    for(int i=1; i<=9; i++){
        int x=1;
        for(int j=0; j<a[i]; j++)x*=10;
        res+=i*x;
    }
    return res;
}

int main(){
    int K;
    long long cnt=0;
    string S,T;
    cin >> K >> S >> T;
    vector<int> c(10,K);

    for(int i=0; i<4;i++){
        c[S[i]-'0']--;
        c[T[i]-'0']--;
    }

    for(int i=1; i<=9;i++)for(int j=1; j<=9; j++){
        S[4] = '0' + i;
        T[4] = '0' + j;
        if(score(S) > score(T)){
            cnt += (long long)c[i]*(c[j]-(i==j));
        }
    }
    long long u=9LL*K-8;
    cout << fixed << setprecision(9) << (double)cnt/(u*(u-1)) << endl;
}

#include<bits/stdc++.h>
#define rep(i, a, b) for(int i = a; i <= b ; ++i)
#define per(i, a, b) for(int i = b ; i >= a  ; --i)
#define int long long

using namespace std;

double card[10];

int S[6],T[6];

bool bigger()
{
	int sums=0,sumt=0;
	for(int i=1;i<=9;i++)
	{
		int x=i;
		for(int j=1;j<=5;j++)if(S[j]==i)x*=10;
		sums+=x;
		x=i;
		for(int j=1;j<=5;j++)if(T[j]==i)x*=10;
		sumt+=x;
	}
	return sums>sumt;
}

signed main()
{
	double tot;int K;
	cin>>K;
	tot=(double)(9*K);
	string s,t;
	cin>>s>>t;
	tot-=8.0;
	for(int i=1;i<=9;i++)card[i]=K;
	rep(i,0,3)
	{
		S[i+1]=(int)(s[i]-'0');
		T[i+1]=(int)(t[i]-'0');
		card[S[i+1]]--;
		card[T[i+1]]--;
	}
	double win=0.0;
	rep(i,1,9)
	{
		if(card[i]==0)continue;
		rep(j,1,9)
		{
			if(card[j]==0)continue;
			if(i==j)continue;
			S[5]=i;T[5]=j;
			if(bigger())
			{
				double base=tot*(tot-1.0);
				double son=(double)(card[i]*card[j]);
				son/=base;
				win+=son;
			}
		}
		if(card[i]>=2)
		{
			S[5]=i;T[5]=i;
			if(bigger())
			{
				double base=tot*(tot-1.0);
				double son=(double)(card[i]*(card[i]-1));
				son/=base;
				win+=son;
			}
		}
	}
//	if(win>1.0)win=1.0;
	printf("%.8f",win);
	return 0;
}


///Bismillahir Rahmanir Rahim
#include "bits/stdc++.h"

#define                           ll                          long long
#define                           int                         ll
#define                           fi                          first
#define                           si                          second
#define                           mp                          make_pair
#define                           pb                          push_back
#define                           pi                          pair<int,int>
#define                           nd(a,b,c)                   mp(mp(a,b),c)
#define                           clr(x)                      memset(x,0,sizeof(x));
#define                           f(i,l,r)                    for(int i=l;i<=r;i++)
#define                           rf(i,r,l)                   for(int i=r;i>=l;i--)
#define                           done(i)                     cout<<"done = "<<i<<endl;
#define                           show(x,y)                   cout<<x<<" : ";for(auto z:y)cout<<z<<" ";cout<<endl;
#define                           fast                        ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);

using namespace std;

const ll inf=2e18;
const int mod=1e9+7;
const int M=200005;
int a[M];
 main()

{
    fast
    int n,m;
    cin>>n>>m;
    if(m==0)
    {
        cout<<"1\n";return 0;
    }
    f(i,1,m)
    {
        cin>>a[i];
    }
    sort(a+1,a+m+1);
    m=unique(a+1,a+m+1)-a-1;
    a[0]=0;
    a[m+1]=n+1;
    int mn=n;
    int ses=0;
    f(i,1,m+1)
    {
       int lft=a[i-1]+1;
       int rgt=a[i]-1;
       if(lft<=rgt)
       {
           mn=min(mn,rgt-lft+1);
       }
    }
    f(i,1,m+1)
    {
       int lft=a[i-1]+1;
       int rgt=a[i]-1;
       if(lft<=rgt)
       {
           int len=rgt-lft+1;
           ses+=((len+mn-1)/mn);
       }
    }
    cout<<ses<<"\n";
    return 0;

}

#include <iostream>
#include <cmath>
#include <vector>
#include <algorithm>
#include <cstring>
#include <map>
#include <set>
#include <numeric>
#include <cassert>

using namespace std;

void setIO(const string &name = "") {
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    cout.tie(nullptr);

    if (name.length()) {
        freopen((name + ".in").c_str(), "r", stdin);
        freopen((name + ".out").c_str(), "w", stdout);
    }
}

typedef long long ll;
#define int ll
#define INF int(1e18) + 15
#define mod 1000000007
#define DO if(true)
#define vt vector

#define rep(i, a, b) for(auto (i)=a;(i)<(b);(i)++)
#define trav(a, x) for(auto& (a): (x))

struct RMQ {
    int size = 1;
    vt<int> v, logTable;
    vt<vt<int>> table;

    void makeLogTable(){
        logTable.assign(size + 1, 0);
        rep(i, 2, size + 1){
            logTable[i] = logTable[i / 2] + 1;
        }
    }

    void makeTable(){
        table.assign(logTable.back() + 1, vt<int>(size));
        table[0] = v;
        for(int row = 1; row <= logTable.back(); row++){
            for(int i = 0; (i + (1 << row)) <= size; i++){
                table[row][i] = min(table[row - 1][i], table[row - 1][i + (1 << (row - 1))]);
            }
        }
    }

    void init(int n, const vt<int>& x){
        size = n;
        v = x;

        makeLogTable();
        makeTable();
    }

    int calc(int l, int r){
        int lg = logTable[r - l];
        int res = min(table[lg][l], table[lg][r - (1 << lg)]);
        return res;
    }
};

#define N int(1e4) + 10
int n;
vt<int> a;

signed main() {
    setIO();

    cin >> n;
    a.resize(n);
    trav(c, a){
        cin >> c;
    }

    RMQ rmq;
    rmq.init(n, a);

    auto binLeft = [&](int idx){
        int lo = 0, hi = idx;
        int res = idx;
        while(lo <= hi){
            int mid = (lo + hi) / 2;
            if(rmq.calc(mid, idx + 1) == a[idx]){
                res = mid;
                hi = mid - 1;
            }else {
                lo = mid + 1;
            }
        }
        return res;
    };

    auto binRight = [&](int idx){
        int lo = idx, hi = n - 1;
        int res = idx;
        while(lo <= hi){
            int mid = (lo + hi) / 2;
            if(rmq.calc(idx, mid + 1) == a[idx]){
                res = mid;
                lo = mid + 1;
            }else {
                hi = mid - 1;
            }
        }
        return res;
    };

    vt<int> s(n), e(n);
    rep(i, 0, n){
        s[i] = binLeft(i);
        e[i] = binRight(i);
    }

    int ans = *max_element(a.begin(), a.end());
    rep(i, 0, n){
        ans = max(ans, (e[i] - s[i] + 1) * a[i]);
    }
    cout << ans << '\n';
    return 0;
}


#include <iostream>
#include <string>
#include <algorithm>
#include <vector>
#include <queue>
#include <utility>
#include <tuple>
#include <cmath>
#include <numeric>
#include <set>
#include <map>
#include <array>
#include <complex>
#include <iomanip>
#include <cassert>
using ll = long long;
using std::cin;
using std::cout;
using std::endl;
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }
const int inf = (int)1e9 + 7;
const long long INF = 1LL << 60;

void solve()
{
  using real = long double;
  int n; cin >> n;
  std::vector<real> dp(n + 1);
  for (int i = 1; i < n; ++i)
  {
    dp[i + 1] = (dp[i] + (real)n / (real)(n - i));
  }
  cout << std::fixed << std::setprecision(15) << dp[n] << "\n";
}
int main()
{
  std::cin.tie(nullptr);
  std::ios::sync_with_stdio(false);

  int kkt = 1;
  //cin >> kkt;
  while(kkt--)
    solve();
  return 0;
}


#include <iostream>
#include <vector>
#include <array>
#include <list>
#include <queue>
#include <stack>
#include <set>
#include <map>
#include <unordered_map>
#include <unordered_set>
#include <utility>
#include <string>
#include <sstream>
#include <algorithm>
#include <random>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <cmath>
#include <cassert>
#include <climits>
#include <bitset>
#include <functional>
#include <iomanip>
#include <random>

#define FOR_LT(i, beg, end) for (decltype(end) i = beg; i < end; i++)
#define FOR_LE(i, beg, end) for (decltype(end) i = beg; i <= end; i++)
#define FOR_DW(i, beg, end) for (decltype(beg) i = beg; end <= i; i--)
#define REP(n)              for (decltype(n) repeat_index = 0; repeat_index < n; repeat_index++)

using namespace std;

template<typename T, size_t S>
T minval(const T(&vals)[S])
{
	T val = numeric_limits<T>::max();
	FOR_LT(i, 0, S) {
		val = min(val, vals[i]);
	}
	return val;
}

template<typename T, size_t S>
T maxval(const T(&vals)[S])
{
	T val = numeric_limits<T>::min();
	FOR_LT(i, 0, S) {
		val = max(val, vals[i]);
	}
	return val;
}

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

	int n, m; cin >> n >> m;
	vector<int> as(n); for (auto& a : as) { cin >> a; }
	vector<int> cs(n + 1);
	set<int> uu;
	FOR_LE(i, 0, n + 1) uu.insert(i);

	FOR_LT(i, 0, m) {
		if (cs[as[i]] == 0) uu.erase(as[i]);
		cs[as[i]]++;
	}

	int l = 0;
	int r = m;

	int ans = *uu.begin();
	while (r != n) {
		cs[as[l]]--;
		if (cs[as[l]] == 0) uu.insert(as[l]);
		if (cs[as[r]] == 0) uu.erase(as[r]);
		cs[as[r]]++;
		ans = min(ans, *uu.begin());
		l++;
		r++;
	}
	cout << ans << endl;

	return 0;
}

#include <bits/stdc++.h>

using namespace std;

#define eb emplace_back
#define ii pair<int, int>
#define OK (cerr << "OK" << endl)
#define debug(x) cerr << #x " = " << (x) << endl
#define ff first
#define ss second
#define int long long
#define tt tuple<int, int, int>
#define all(x) x.begin(), x.end()
#define vi vector<int>
#define vii vector<pair<int, int>>
#define vvi vector<vector<int>>
#define vvii vector<vector<pair<int, int>>>
#define Mat(n, m, v) vector<vector<int>>(n, vector<int>(m, v))
#define endl '\n'

constexpr int INF = (sizeof(int) == 4 ? 1e9 : 2e18) + 1e5;
constexpr int MOD = 1e9 + 7;
constexpr int MAXN = 2e5 + 3;

vvi adj(MAXN);
vi arr(MAXN);
bool check(int u, int c) {
  for (int v : adj[u])
    if (arr[v] == c)
      return false;
  return true;
}

vi dd(MAXN);
set<int> s;
int n;
int cnt3 = 0;
int brute(int idx) {
  if (idx == n)
    return 1;

  if (dd[idx] == 0) {
    s.emplace(idx);
    return brute(idx + 1);
  }

  int ans = 0;
  for (int i = 0; i < 3; ++i)
    if (check(idx, i)) {
      arr[idx] = i;
      ans += brute(idx + 1);
      arr[idx] = -1;
    }
  return ans;
}

int poww() {
  int ans = 1;
  for (int i = 0; i < s.size(); ++i)
    ans *= 3;
  return ans;
}

// #define MULTIPLE_TEST_CASES
void solve(const int test) {
  cin >> n;
  int m;
  cin >> m;
  while (m--) {
    int u, v;
    cin >> u >> v;
    --u, --v;
    if (u < v)
      swap(u, v);
    ++dd[u];
    ++dd[v];
    adj[u].eb(v);
  }
  int val = brute(0);
  cout << poww() * val << endl;
}

signed main() {
  // const string FILE_NAME = "";
  // freopen((FILE_NAME + string(".in")).c_str(), "r", stdin);
  // freopen((FILE_NAME + string(".out")).c_str(), "w", stdout);
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr), cout.tie(nullptr);

  int t = 1;
#ifdef MULTIPLE_TEST_CASES
  cin >> t;
#endif
  for (int i = 1; i <= t; ++i)
    solve(i);
}


#include <iostream>
#include <string>
#include <vector>
#include <array>
#include <stack>
#include <queue>
#include <deque>
#include <algorithm>
#include <set>
#include <map>
#include <unordered_map>
#include <bitset>
#include <cmath>
#include <functional>
#include <cassert>
#include <iomanip>
#include <numeric>
#include <memory>
#include <random>
#define VV(a, b, c, d) vector<vector<d>>(a, vector<d>(b, c))
#define VVV(a, b, c, d, e) vector<vector<vector<e>>>(a, VV(b, c, d, e));
#define all(obj) (obj).begin(), (obj).end()
typedef long long ll;
typedef long double ld;
typedef std::vector<ll> v1;
typedef std::vector<v1> v2;
typedef std::vector<v2> v3;
using namespace std;

long long floor_sum(long long n,long long m,long long a,long long b){
	long long res=0;
	if(a>=m){
		res+=n*(n-1)/2*(a/m);
		a%=m;
	}
	if(b>=m){
		res+=n*(b/m);
		b%=m;
	}

	long long y_max=(a*(n-1)+b)/m;
	if(y_max==0) return res;
	return res+y_max+floor_sum(y_max,a,m,(a*(n-1)+b)-m*y_max);
}

void solve(){
  ll x, y, p, q;
  scanf("%lld %lld %lld %lld", &x, &y, &p, &q);

  ll l = 0, r = 1000000000;
  if(floor_sum(r, p+q, 2*(x+y), x+y+q-1) == floor_sum(r, p+q, 2*(x+y), x)){
    std::cout << "infinity" << '\n';
    return;
  }

  while(r-l>1){
    ll mid = (l+r)/2;
    if(floor_sum(mid, p+q, 2*(x+y), x+y+q-1) == floor_sum(mid, p+q, 2*(x+y), x)) l = mid;
    else r = mid;
  }

  ll distsum = 2*(r-1)*(x+y) + x;
  if(distsum % (p+q) >= p) printf("%lld\n", distsum);
  else printf("%lld\n", distsum + (p - distsum % (p+q)));
}

int main(){
  int t;
  scanf("%d\n", &t);
  for(int i=0;i<t;i++) solve();
}


#include<bits/stdc++.h>
using namespace std;
const int N=1e4+10;
int a[N],b[N],pre[N];
int main()
{
	int n;
	cin>>n;
	for(int i=0;i<n;i++)
	{
		cin>>a[i];
		pre[a[i]]++;
	}
	for(int i=0;i<n;i++)
	{
		cin>>b[i];
		pre[b[i]+1]--;
	}
	int ans=0;
	for(int i=0;i<N;i++)
		pre[i]+=pre[i-1];
	for(int i=0;i<N;i++)
	{
		if(pre[i]>=n)
			ans++;
	}
	cout<<ans;

	return 0;
}

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

int main()
{

ios_base::sync_with_stdio(false); cin.tie(NULL);

int n; cin>>n;
vector<int> a;

for (int i = 0; i < n; ++i)
{
	int k; cin>>k; a.push_back(k);
}
int ans=0;

for (int i = 0; i < a.size(); ++i)
{
	int min=a[i];
	for (int j = i; j <a.size() ; j++)
	{
		if(a[j]<min) min=a[j];
		//cout<<min<<' '<<i<<' '<<j<<' ';
		if (min*(j-i+1)>ans) ans=min*(j-i+1);
		//cout<<ans<<endl;
	}
}
cout<<ans;

}


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

///******************************** C o n t a i n e r ********************************///

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

///*********************************** C o n s t ***********************************///

const int       N=1e6+123;
const double    PI = acos(-1);
const ll        MOD=1000000007;                 ///1e9+7

///********************************** M a r c o ***********************************///

#define pb push_back
#define MP make_pair
#define F first
#define S second
#define test ll tc; cin>>tc; while(tc--)
#define forn(i,n) for(i=0;i<n;i++)
#define all(a) a.begin(),a.end()
#define rall(a) a.rbegin(),a.rend()
#define sz(x) x.size()
#define el <<'\n'
#define sp <<' '
#define print(a) {for(auto x:a)cout<<x<<" ";cout<<endl;}
#define mem(a,b) memset(a, b, sizeof(a))
#define gcd(a,b) __gcd(a,b)
#define lcm(a,b) (a*(b/gcd(a,b)))
#define sqr(a) (a)*(a)

#define fastio() ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define file() freopen("input.txt","r",stdin);freopen("output.txt","w",stdout);
#define fraction() cout.unsetf(ios::floatfield); cout.precision(10); cout.setf(ios::fixed,ios::floatfield);

///*********************************** F u n c t i o n ***********************************///

ll powmod(ll a,ll b,ll MOD){ a%=MOD;if(!a) return 0;ll pr=1;while(b>0){if(b&1){pr*=a;pr%=MOD;--b;}a*=a;a%=MOD;b/=2;}return pr;}
ll modinverse(ll a){return powmod(a,MOD-2,MOD);}
bool isPrime(ll n){ if(n<=1)return false;if(n<=3)return true;if(n%2==0 or n%3==0)return false;for(ll i=5;i*i<=n;i+=6){if(n%i==0 or n%(i+2)==0)return false;}return true;}
void seive(bool a[]){vl v; ll mx=sqrt(N),ii,jj;for(ii=3;ii<=mx;ii+=2)if(!a[ii])for(jj=ii*ii;jj<N;jj+=2*ii)a[jj]=true; v.pb(2);for(ii=3;ii<N;ii+=2)if(!a[ii])v.pb(ii);}
void numofdiv(ll a[]){ll mx=sqrt(N),ii,jj;for(ii=1;ii<=mx;ii++){for(jj=ii*ii;jj<N;jj+=ii){if(jj==ii*ii) a[jj]++; else a[jj]+=2;}}}
void sumofdiv(ll a[]){ll mx=sqrt(N),ii,jj;for(ii=1;ii<=mx;ii++){for(jj=ii*ii;jj<N;jj+=ii){if(jj==ii*ii) a[jj]+=ii; else a[jj]+=ii+jj/ii;}}}

///**************************************************** C o d e ****************************************************///
///-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=///
ll n;
ll dp[205][205];

ll rec(ll position, ll cut)
{
    if(cut==11) return (position>0);
    if(dp[position][cut]==-1){
        ll ans=0,i,j;
        for(i=1;i<position;i++){
            ans+=rec(position-i,cut+1);
        }
        dp[position][cut]=ans;
    }
    return dp[position][cut];
}

void _case()
{
    cin>>n;
    mem(dp,-1);
    cout<<rec(n,0)<<endl;
}

main()
{
    fastio();
    _case();

}

///See you soon

//#pragma GCC optimize(3)
#include <bits/stdc++.h>
using namespace std;
#define lson l,mid,rt<<1
#define rson mid+1,r,rt<<1|1
#define inf 0x3f3f3f3f
#define INF 0x7fffffff
#define infll 0x3f3f3f3f3f3f3f3f
#define il inline
#define re register
#define pb push_back
#define db double
#define ll long long
#define ull unsigned long long
#define pii pair<int,int>
#define pll pair<ll,ll>
#define puu pair<ull,ull>
#define MP make_pair
#define lowbit(x) x&(-x)
#define fi first
#define se second
il ll read()
{
	char ch = getchar();
	ll p = 1,data = 0;
	while(ch<'0'||ch>'9')
	{
		if(ch == '-')p = -1;
		ch = getchar();
	}
	while(ch>='0'&&ch<='9')
	{
		data = data*10+(ch^48);
		ch = getchar();
	}
	return p*data;
}
il ll gcd(ll a,ll b)
{
	if(!a || !b) return (!a)?b:a;
	while(b ^= a ^= b ^= a %= b);
	return a;
}
il ll lcm(ll a,ll b)
{
	return a*b/gcd(a,b);
}
void exgcd(ll a, ll b, ll &x,ll &y)
{
	if(!b) x = 1, y = 0;
	else
	{
		exgcd(b, a % b, y, x);
		y -= x * (a / b);
	}
}
il ll qpow(ll a,ll b)
{
	ll r = 1;
	while(b)
	{
		if(b&1)r = a*r;
		a = a*a;
		b>>=1;
	}
	return r;
}
const int mod = 1e9+7;
int main()
{
	int n = read();
	ll t = 1;
	for(int i = 2; i <= n; i++)
		t = lcm(i,t);
	cout<<t+1<<endl;
	return 0;
}
/*

*/


// Parasparopagraho Jīvānām

#pragma GCC optimize ("O3")
#pragma GCC target ("sse4")

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

using namespace  __gnu_pbds ;
using namespace __gnu_cxx ;
using namespace std ;

typedef long long ll ;
typedef long double ldb ;

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

typedef vector<int> vi ;
typedef vector<ll> vll ;
typedef vector<pii> vpi ;
typedef vector<pll> vpl ;
typedef vector<bool> vb ;
typedef vector<pair<ll,int> > vpli ;
typedef vector<int,pil> edges ;
typedef vector<vi> matrix ;
typedef priority_queue<int> pqu ;

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

#define rep(i,a,b) for (int i = (a); i <= (b); i++)
#define per(i,b,a) for (int i = (b); i >= (a); i--)

#define mp make_pair
#define eb emplace_back
#define pb push_back
#define pob pop_back
#define fi first
#define se second
#define ins insert
#define bk back
#define con continue
#define lbd lower_bound
#define ubd upper_bound

#define sz(x) (int)x.size()
#define all(x) begin(x), end(x)

#define pr cout << // I don't like this but my laptop's 'O' key is not functioning well

/* Careful when using long long
__builtin_clz(int x) {} //: the number of zeros at the beginning of the number
__builtin_ctz(int x) {} //: the number of zeros at the end of the number
__builtin_popcount(int x) {} //: the number of ones in the number
__builtin_parity(int x) {} //: the parity (even or odd) of the number of ones */

const int mod1 = 1000000007 ;
const int mod2 = 998244353 ;
const ll  infl = 4e18 ;
const int infi = 2e9 ;
const int maxn = 1e6 + 5 ;
const int block = 500 ;
const int logn = 60 ;
const int alpha = 27 ;
const ldb pi = acos(-1) ;

mt19937 rng(chrono::steady_clock::now().time_since_epoch().count()) ;
int rng_lr(int a, int b)
{
    int ret ;
    ret = uniform_int_distribution<int>(a, b)(rng) ;
    return ret ;
    // For shuffling use shuffle(all, rng) ;
}

ll modpow(ll a, ll b, int MOD) { ll res = 1 ; while(b) { if(b&1) { res = res*a ; res %= MOD ; } a *= a ; a %= MOD ; b >>= 1 ; } return res%MOD ; }
void upmin(int &a, int b) { if(a < b) { a = b ; } }
void relax(int &a, int b) { if(a > b) { a = b ; } }
ll add(ll a, ll b, int MOD) { a += b ; if(a >= MOD) { a -= MOD ; } return  a ; }
ll sub(ll a, ll b, int MOD) { a -= b ; if(a < 0) { a += MOD ; } return a ; }
ll mul(ll a, ll b, int MOD) { b %= MOD ; a *= b ; a %= MOD ; return a ; }
ll inverse(ll a, ll MOD) { a = modpow(a, MOD - 2, MOD) ; return a ; }
ll lcm(ll a, ll b) { ll ret ; ll g = __gcd(a, b) ; ret = a/g ; ret = ret*b ; return ret ; }
int icast(char ch) { return int(ch-'a') ; }
void hyn(int a, int b) { if(a == b) cout << "YES\n" ; else cout << "NO\n" ; }
void pyd(int a, int b) { if(a == b) cout << "First\n" ; else cout << "Second\n" ; }

// Check constraints + overflows + types in typedef

int main()
{
    ios::sync_with_stdio(false) ;
    cin.tie(NULL) ;
    int n ;
    string s ;
    cin >> n >> s ;
    if(s[0] != s[n-1]) {
    	pr "1\n" ;
    	return 0 ;
    }
    rep(i,1,n-2) {
    	if(s[i] != s[0] && s[i + 1] != s[0]) {
    		pr "2\n" ;
    		return 0 ;
    	}
    }
    pr "-1\n" ;
    return 0 ;
}

#include <bits/stdc++.h>
using namespace std;
#define pi acos(-1.0)
#define pb push_back
#define mp make_pair
#define ll long long
#define all(x) x.begin(),x.end()
#define rall(x) x.rbegin(),x.rend()
#define testcase ll T; cin >> T; for (ll tc = 1; tc <= T; tc++)
#define M 1000000007
#define MM 998244353
#define eps 1e-8
#define eq(x,y) (fabs((x)-(y)) < eps)
#define r2 1.41421356237
ll powmod(ll a,ll b,ll mod) {ll res=1;a%=mod;assert(b>=0);for(;b;b>>=1){if(b&1)res=res*a%mod;a=a*a%mod;}return res;}
ll gcd(ll a,ll b) { return b?gcd(b,a%b):a;}

int main()
{
  //ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
  //testcase {
  ll ans=0;
  int n,m;
  cin>>n>>m;
  char g[n+2][m+2]={};
  for(int i=0;i<n+2;i++) {
  	for(int j=0;j<m+2;j++) {
  		g[i][j]='#';
  	}
  }
  for(int i=1;i<=n;i++) {
  	for(int j=1;j<=m;j++) {
  		char q;
  		cin>>q;
  		g[i][j]=q;
  	}
  }
  for(int i=1;i<=n;i++) {
  	int c=1;
  	for(int j=1;j<=m+1;j++) {
  		if(g[i][j]=='.' && g[i][j-1]=='.') { c++; }
  		else { ans+=c-1; c=1; }
  	}
  	//cout<<ans<<'\n';
  	//ans+=((c*(c-1))/2); c=1;
  }
  for(int i=1;i<=m;i++) {
  	int c=1;
  	for(int j=1;j<=n+1;j++) {
  		if(g[j][i]=='.' && g[j-1][i]=='.') { c++; }
  		else { ans+=c-1; c=1; }
  	}
  	//cout<<ans<<'\n';
  	//ans+=((c*(c-1))/2); c=1;
  }
  cout<<ans;
  //}
  return 0;
}


#include <bits/stdc++.h>
using namespace std;
template<typename T = int> vector<T> create(size_t n){ return vector<T>(n); }
template<typename T, typename... Args> auto create(size_t n, Args... args){ return vector<decltype(create<T>(args...))>(n, create<T>(args...)); }
int main(){
	ios::sync_with_stdio(false);
	cin.tie(0);
	int n;
	cin >> n;
	vector<int> a(n);
	for(int i = 0; i < n; i++) cin >> a[i];
	auto get = [&](long double p){
		long double sum = 0;
		for(int i = 0; i < n; i++){
			sum += p + a[i] - min((long double) a[i], 2 * p);
		}
		return sum;
	};
	long double lo = 0, hi = 1e9;
	for(int r = 0; r < 200; r++){
		long double f1 = lo + (hi - lo) / 3, f2 = lo + 2 * (hi - lo) / 3;
		if(get(f1) < get(f2)) hi = f2;
		else lo = f1;
	}
	cout << fixed << setprecision(12) << get(lo)/n << '\n';
	return 0;
}

#include<iostream>
#include<string>
#include<vector>
#include<algorithm>
using namespace std;

int gcd(int, int);

int main(void){
    //init val
    int n, kosuu = 0;
    cin >> n;
    int *a;int *b;int *c;
    a = new int[n];
    b = new int[n];
    c = new int[1000];
    for (int i = 0; i < n; i++){
        cin >> a[i];
    }
    for (int i = 0; i < n; i++){
        cin >> b[i];
    }
    for (int i = 0; i < 1000; i++){
        c[i] = 0;
    }
    //main code
    for (int i = 0; i < n; i++){
        for (int j = a[i] - 1; j < b[i]; j++){
            c[j]++;

        }
    }
    for (int i = 0; i < 1000; i++){
        if (c[i] == n){
            kosuu++;
        }
    }
    cout << kosuu << endl;
    return 0;
}

int gcd(int x, int y){
    if (x%y == 0){
        return y;
    }else{
        return gcd(y, x%y);
    }
}


#include <bits/stdc++.h>
using namespace std;
#define ll long long int
#define T     \
    int t;    \
    cin >> t; \
    while (t--)
#define fast                          \
    ios_base::sync_with_stdio(false); \
    cin.tie(NULL)
#define PI 3.141592653589793238462643383
#define pb push_back
#define all(s) s.begin(), s.end()

void print(bool flag) {
    if (flag) {
        cout << "Yes" << endl;
    } else {
        cout << "No" << endl;
    }
}

int main() {
    fast;

    ll n, w;
    cin >> n >> w;
    bool flag = true;
    ll s[n], t[n], p[n];
    ll mx = INT_MIN;
    for (int i = 0; i < n; i++) {
        cin >> s[i] >> t[i] >> p[i];
        mx = max(mx, t[i]);
    }

    vector<ll> ans(mx + 1, 0);
    for (int i = 0; i < n; i++) {
        ans[s[i]] += p[i];
        ans[t[i]] += (-1 * p[i]);
    }
    ll temp = 0;
    for (int i = 0; i <= mx; i++) {
        temp += ans[i];
        //cout << temp << " ";
        if (temp > w) {
            flag = false;
        }
    }
    print(flag);
}

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

int main() {
  int n; int D; int H;
  cin >> n >> D >> H;
  vector<int> d(n), h(n);
  for(int i=0; i<n; ++i) cin >> d[i] >> h[i];

  double ans = 0;
  for(int i=0; i<n; ++i) {
    double b = double(D * h[i] - d[i] * H) / (D - d[i]);
    ans = max(ans, b);
  }
  printf("%.10lf\n", ans);
}