akhauriyash/Code-Regression huggingface dataset:
S = list(input())
A,B,C,D = map(int,S)

ans = A
for x in range(2):
    for y in range(2):
        for z in range(2):
            if x == 0: ans += B; o = "+"
            else:ans -= B; o = "-"
            if y == 0:ans += C; oo = "+"
            else:ans -= C; oo = "-"
            if z == 0:ans += D; ooo = "+"
            else:ans -= D; ooo = "-"
            #print(x,y,z,str(ans).rjust(2),A,o,B,oo,C,ooo,D)
            if ans == 7: print("".join(list(map(str,[A,o,B,oo,C,ooo,D,"=7"])))); exit()
            ans = A

Measured memory_bytes: 9172
#pragma GCC optimize("O3", "unroll-loops")
#include <bits/stdc++.h>

using namespace std;
const int maxn = 1e5 + 10;
long long n, m, arr[maxn], ans = 0;
vector<long long> v;
int main() {
	ios::sync_with_stdio(false);
	cin.tie(NULL);
	cin >> n >> m;
	for (int i = 0; i < m; i++)
		cin >> arr[i];
	sort(arr, arr + m);
	for (int i = 1; i < m; i++)
		v.push_back(arr[i] - arr[i - 1]);
	sort(v.begin(), v.end());
	for (int i = 0; i < m - n; i++)
		ans += v[i];
	cout << ans << '\n';
	return 0;
}


Measured memory_bytes: 2168
using System;

namespace ITP1_5_C
{
    class Program
    {
        static void Main(string[] args)
        {
            for (int i=0; ;i++)
            {
                string[] input = Console.ReadLine().Split(' ');
                int h = int.Parse(input[0]);
                int w = int.Parse(input[1]);

                if (h == 0 && w == 0)
                    break;

                for (int j=1; j<=h; j++)
                {
                    for (int k=1; k<=w; k++)
                    {
                        int h2 = j % 2;
                        int w2 = k % 2;
                        if (h2 != 0)
                        {
                            if (w2 != 0) Console.Write("#");
                            else Console.Write(".");
                        }
                        else
                        {
                            if (w2 != 0) Console.Write(".");
                            else Console.Write("#");
                        }
                    }
                    Console.WriteLine();
                }
                Console.WriteLine();
            }         
        }
    }
}

Measured memory_bytes: 8832
S = list(input())

n_operation = 0
for i, s_val in enumerate(S):
    if i == 0:
        continue
    last_val = S[i-1]
    if s_val == last_val:
        if s_val == '0':
            S[i] = '1'
        else:
            S[i] = '0'
        n_operation += 1

print(n_operation)


Measured memory_bytes: 3956
#include <bits/stdc++.h>
using namespace std;
const int MaxN = 13;
int n,a[MaxN],b[MaxN],cnt2,ans;

int main() {
    scanf("%d",&n);
    for (int i=1;i<=n;++i) scanf("%d",a+i),b[i]=a[i]-1;
    b[0]=-1;
    for (int i=1;i<=n;++i) if (b[i]%2==0) cnt2++;
    while (b[0]==-1) {
        if (cnt2>0) ans++;
        if (b[n]%2==0) cnt2--;
        b[n]++;
        if (b[n]%2==0) cnt2++;
        for (int p=n;b[p]==a[p]+2;p--) {
            if (b[p]%2==0) cnt2--;
            b[p]=a[p]-1;
            if (b[p]%2==0) cnt2++;
            if (b[p-1]%2==0) cnt2--;
            b[p-1]++;
            if (b[p-1]%2==0) cnt2++;
        }
    }
    printf("%d\n",ans);
    return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
int main(){
int n;
cin >> n;
int heya[4][3][10] = {{{}}};
  for(int i=0; i<n; i++){
    int b,f,r,v;
    cin >> b >> f >> r >> v;
    heya[b-1][f-1][r-1] = heya[b-1][f-1][r-1] + v;
  }
    for(int a = 0; a<4; a++){
        for(int b = 0; b<3; b++){
            for(int c = 0; c<10; c++){
                cout<<" ";
                cout<<heya[a][b][c];
            }
            cout<<endl;
        }
        
        if(a<3){
            cout<<"####################"<<endl;
        }
        
    }
return 0;
}



Measured memory_bytes: 3084
#include <bits/stdc++.h>
using namespace std;
#define REP(i, n) for (int i = 0; i < (n); ++i)
#define Cout(s) cout << s << endl;
#define CoutV(vec)     \
    for (auto v : vec) \
        Cout(v);
#define CoutVV(vecvec)      \
    for (auto vec : vecvec) \
        CoutV(vec);

using ll = long long;
using P = pair<int, int>;
#define INF 10000000;

ll MOD = 1e9 + 7;

int main()
{


    int n;
    cin >> n;
    vector<int> x(n), y(n), h(n);
    REP(i, n)
    cin >> x[i] >> y[i] >> h[i];
    for (int i = 0; i <= 100; i++)
    {
        for (int j = 0; j <= 100; j++)
        {

            int needH = -1;

            for (int k = 0; k < n; k++)
            {
                if (h[k] > 0)
                {
                    int tmp = h[k] + abs(j - y[k]) + abs(i - x[k]);
                    if (needH == -1)
                    {
                        needH = tmp;
                    }
                    else
                    {
                        if (needH != tmp)
                        {
                            needH = -2;
                            break;
                        }
                    }
                }
            }
            if (needH == -2)
                continue;

            for (int l = 0; l < n; l++)
            {
                if (h[l] == 0)
                {
                    int dist = abs(j - y[l]) + abs(i - x[l]);
                    if (needH > dist)
                    {
                        needH = -2;
                        break;
                    }
                }
            }
            if (needH == -2)
                continue;
            cout << i << " " << j << " " << needH << endl;
            return 0;
        }
    }

    //    return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef double db;
#define pb push_back
#define fr(i,n) for(int i=0;i<n;i++)
#define Fr(i,n) for(int i=0;i++<n;)
#define ifr(i,n) for(int i=n-1;i>=0;i--)
#define iFr(i,n) for(int i=n;i>0;i--)

ll n,a[25][25],dp[22][1<<22+1]={};
bool f[22][1<<22+1]={};
const ll MOD=1e9+7;

ll ad(ll x,ll y=0){
  return (x+y)%MOD;
}

ll p(ll i,ll s){
  if(i==0&&s==0) return 1;
  if(i!=__builtin_popcountll(s)) return 0;
  if(!f[i][s]){
    f[i][s]=1;
    fr(j,n) if((s>>j)&a[i-1][j]) dp[i][s]=ad(p(i,s),p(i-1,s&(~(1<<j))));
  }
  return dp[i][s];
}

int main(){
  cin>>n;
  fr(i,n) fr(j,n) cin>>a[i][j];
  cout<<p(n,(1<<n)-1)<<endl;
}

Measured memory_bytes: 393472
import java.util.*

fun main(args: Array<String>) {
    class Permutation<T> private constructor(
        private val baseIndex: Int,
        private var index: Int,
        val target: Array<T>?
    ) {
        private var subPermutation: Permutation<T>? = null

        constructor(objs: Array<T>) : this(0, 0, objs.clone())

        init {
            if (target == null || target.isEmpty()) {
                throw IllegalArgumentException("")
            }

            if (this.index < this.target.size - 1) {
                this.subPermutation = Permutation(this.baseIndex + 1, this.index + 1, this.target)
            }
        }

        operator fun next(): Boolean {
            if (this.subPermutation == null) {
                return false
            }
            val result = this.subPermutation!!.next()
            if (result) {
                return true
            }
            this.swap(this.baseIndex, this.index)
            ++this.index
            if (this.target!!.size <= this.index) {
                this.index = this.baseIndex
                return false
            }
            this.swap(this.index, this.baseIndex)
            return true


        }

        private fun swap(index1: Int, index2: Int) {
            val tmp = this.target!![index1]
            this.target[index1] = this.target[index2]
            this.target[index2] = tmp
        }
    }

    val N = readLine()!!.toInt()

    val PN = readLine()!!.split(" ").map(String::toInt).toTypedArray()
    val QN = readLine()!!.split(" ").map(String::toInt).toTypedArray()

    val permutation = Permutation((1..N).toList().toTypedArray())

    var a = 0
    var b = 0
    val list = mutableListOf<String>()
    do {
        list.add(permutation.target!!.joinToString(""))
    } while (permutation.next())
    list.sort()

    for ((i, s) in list.withIndex()) {
        val index = i + 1
        val array = s.toCharArray().map { it.toString().toInt() }.toTypedArray()
        if (Arrays.deepEquals(PN, array)) {
            a = index
        }
        if (Arrays.deepEquals(QN, array)) {
            b = index
        }

        if (a != 0 && b != 0) {
            break
        }
    }

    println(Math.abs(a - b))

}



Measured memory_bytes: 54204
#include <iostream>
#include <array>

using namespace std;

static void inputArray(int A[], int num) {
  for (int i = 0; i < num; i++) {
    cin >> A[i]; 
  }
}

static bool linearSearch(int A[], size_t size, int sentinel) {
  for (int i = 0; i < size; i++) {
    if (A[i] == sentinel) {
      return true;
    }
  }
  return false;
}

int main() {
  array<int, 10000 + 1> N;
  array<int, 500> Q;
  int s, t;

  cin >> s;
  inputArray(&N[0], s);

  cin >> t;
  inputArray(&Q[0], t);

  int found = 0;
  for (int i = 0; i < t; i++) {
    // sentinel
    N[s] = Q[i];
    if (linearSearch(&N[0], s, Q[i])) {
      found++; 
    }
  }
  cout << found << endl;  

  return 0;
}



Measured memory_bytes: 3124
#include <iostream>
#include <algorithm>
using namespace std;
int main()
{
	long long N, A, B, C, D, E;
	cin >> N >> A >> B >> C >> D >> E;

	cout << (N - 1) / min(A, min(B, min(C, min(D, E)))) + 1 + 4 << endl;
	return 0;
}


Measured memory_bytes: 256
using System;
using System.Collections;
using System.Collections.Generic;
using System.IO;
using System.Linq;

namespace Tasks
{
    public class D
    {
        static void Main(string[] args)
        {
            var sw = new StreamWriter(Console.OpenStandardOutput()) { AutoFlush = false };
            Console.SetOut(sw);
            Solve();
            Console.Out.Flush();
        }

        public static void Solve()
        {
            var S = Console.ReadLine();
            var p = S.Count(x => x == 'p');
            var answer = S.Length / 2 - p;
            Console.WriteLine(answer);
        }
    }
}


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

ll dp[1010][1010];
ll mod = 1e9 + 7; 
int main(){
    int h, w;
    cin >> h >> w;
    string grid[h];
    for(int i = 0; i < h; i++) cin >> grid[i];
    dp[0][0] = 1;
    for(int i = 0; i < h; i++){
        for(int j = 0; j < w; j++){
            if(grid[i][j] == '.'){
                if(i > 0) dp[i][j] += dp[i-1][j];
                if(j > 0) dp[i][j] += dp[i][j-1];
                dp[i][j] %= mod;
            }
        }
    }
    cout << dp[h-1][w-1] << endl;
    return 0;
}


Measured memory_bytes: 9216
import java.util.ArrayList;
import java.util.Scanner;

public class Main {

    public static void main(String[] args) {
        Integer x = 5;
        Integer y = 7;
        boolean b = false;
        Scanner sc = new Scanner(System.in);
        ArrayList<Integer> inputs = new ArrayList<Integer>() {
            {
                add(sc.nextInt());
                add(sc.nextInt());
                add(sc.nextInt());
            }
        };

        if (inputs.remove(x) && inputs.size() == 2) {
            if (inputs.remove(x) && inputs.size() == 1) {
                if (inputs.remove(y) && inputs.size() == 0) {
                    b = true;
                }
            }
        }

        if(b) {
            System.out.println("YES");
        } else {
            System.out.println("NO");
        }
    }
}


Measured memory_bytes: 21844
#include <bits/stdc++.h>
#include <atcoder/dsu>
using namespace std;
using namespace atcoder;

int main(){
  int n,q; cin >> n >> q;
  dsu uf(n);
  for(int i=0; i<q; i++){
    int t; cin >> t;
    int a,b; cin >> a >> b;
    if(t == 0){
      uf.merge(a,b);
    }else{
      cout << uf.same(a,b) << endl;
    }
  }
}


Measured memory_bytes: 3864
#include <iostream>
#include <cmath>
#include <algorithm>
#include <string>
#include <vector>
#include <list>
#include <set>
#include <map>
#include <iostream>
#include <queue>

using namespace std;

typedef unsigned int u32;
typedef int i32;
typedef unsigned long long int u64;
typedef long long int i64; // 9e18
typedef uint16_t u16;
typedef int16_t i16;
typedef uint8_t u8;
typedef int8_t i8;

const double PI = 3.141592653589793238463;
const int MAXN = 1000500;
const int MAXVALUE = 1000000500;
const long double EPS = 1e-7;
const i64 INF = 1e18;
i64 mod = 1e9 + 7;


i64 T, n, m, k;
//vector <i64> a;
//vector <i64> b;
//vector <i64> dp;
//i64 nx = 100000;
string s;


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

    cin >> n;

    i64 a = n % 10;

    if (a == 3) {
        cout << "bon" << endl;
    }
    else if (a == 0 || a == 1 || a == 6 || a == 8) {
        cout << "pon" << endl;
    }
    else {
        cout << "hon" << endl;
    }





    return 0;
}

Measured memory_bytes: 3132
#include <bits/stdc++.h>
using namespace std;

int main() {  
  while (true) {
    int sum = 0;
    string s;
    cin >> s;
    if (s == "0") break;
    for (int i = 0; i < s.size(); ++i) {
      sum += s.at(i) - '0';
    }
    cout << sum << endl;
  }

  return 0;
}


Measured memory_bytes: 3208
N=int(input())

A=list(map(int,input().split()))

distance=abs(A[0])+abs(A[N-1])

for i in range(N-1):
  distance+=abs(A[i]-A[i+1])



for i in range(N):
  if i==0:
    #0,2,5や0,-2,-3の場合は移動距離は変わらない
    if (0<=A[i] and A[i]<=A[i+1]) or (0>=A[i] and A[i]>=A[i+1]):
      print(distance)
    #0,2,1や0,-3,-2の場合はabs(a[i]-a[i+1])分移動距離が短くなる
    else:
      print(distance-(abs(A[i])+abs(A[i+1]-A[i]))+abs(A[i+1]))
  elif i==N-1:
    #-3,-2,0や5,3,0
    if (A[i-1]<=A[i] and A[i]<=0) or (A[i-1]>=A[i] and A[i]>=0):
      print(distance)
    #2,5,0や-2,-3,0
    else:
      print(distance-(abs(A[i]-A[i-1])+abs(A[i]))+abs(A[i-1]))
  else:
    #2,3,5や-3,-5,-9
    if (A[i-1]<=A[i] and A[i]<=A[i+1]) or (A[i-1]>=A[i] and A[i]>=A[i+1]):
      print(distance)
    #3,5,-1や-2,-4,1や3,5,4や-2,-4,-3
    #iと前後の項の距離を抜いて前後の項同士の距離を足す
    #iが0やNの時はどちらかが0の場合で同じように考える
    else:
      print(distance-(abs(A[i]-A[i-1])+abs(A[i+1]-A[i]))+abs(A[i+1]-A[i-1]))


Measured memory_bytes: 13928
// Score: /300

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

using namespace std;

int main()
{
	array<int, 26> dist_s, dist_t;
	fill(dist_s.begin(), dist_s.end(), 0);
	fill(dist_t.begin(), dist_t.end(), 0);

	string S, T;
	cin >> S >> T;

	for (int i=0;i<S.size();++i){
		++dist_s[S[i]-'a'];
		++dist_t[T[i]-'a'];
	}
	sort(dist_s.begin(), dist_s.end());
	sort(dist_t.begin(), dist_t.end());

	cout << (equal(dist_s.begin(), dist_s.end(), dist_t.begin()) ? "Yes" : "No");
}


Measured memory_bytes: 776
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
const int N = 1e6+7;
int a[N];
int main()
{
    int n,k; scanf("%d%d",&n,&k);
    for(int i=1;i<=k;i++) scanf("%d",a+i);
    int res=0;
    for(int i=2;i<=k;i++) res=max(a[i]-a[i-1],res);
    res=max(res,n-a[k]+a[1]);
    cout<<n-res<<endl;
}

Measured memory_bytes: 1024
#include <bits/stdc++.h>
using namespace std;

int main()
{
	int n, m;
	cin>>n >>m;
	string a[n];
	string b[m];
	bool find;
	for(int i=0; i<n; i++)
	{
		cin>>a[i];
	}
	for(int i=0; i<m; i++)
	{
		cin>>b[i];
	}
	for(int i=0; i<n-m+1; i++)
	{
		for(int j=0; j<n-m+1; j++)
		{
			find=true;
			for(int p=0; p<m; p++)
			{
				for(int q=0; q<m; q++)
				{
					if(a[i+p][j+q]!=b[p][q]) find=false;
				}
				if(!find) break;
			}
			if(find)
			{
				cout<<"Yes";
				return 0;
			}
		}
	}
	cout<<"No";
}


Measured memory_bytes: 256
def resolve():
    n=int(input())
    ac = list(map(int, input().split()))
    ans=sum(ac)
    q=int(input())
    a=[0]*(10**5+1)
    for i in ac:
        a[i]+=1
    for _ in range(q):
        b,c = map(int, input().split())
        g=a[b]
        a[b]=0
        a[c]+=g

        ans=ans-g*(b-c)
        print(ans)
resolve()

Measured memory_bytes: 83492
import java.io.*;

public class Main{
	private static BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
	private static BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(System.out));
	
	public static void main (String[] args) throws IOException{
        int a = Integer.parseInt(br.readLine());
        int ans = a + a*a + a*a*a;
        bw.write(ans + "");
		bw.flush();
	}
}


Measured memory_bytes: 36356
#include <bits/stdc++.h>
using namespace std;

int main() {
long long int N;
cin >> N;

long long int sum = 0;
  
for (int i = 1; i < N + 1; i++) {
  if (i % 15 == 0){
    continue;
  }
  else if (i % 3 == 0 || i % 5 == 0){
   continue;
  }
  else{
    sum += i;
  }
}

  cout << sum << endl;
}


Measured memory_bytes: 3624
n,m = map(int,input().split())
par = [i for i in range(n+1)]
root = [i for i in range(n+1)]
par[0] = 1
def find(x):
    if par[x] == x:
        return x
    else:
        par[x] = find(par[x]) #経路圧縮
        return par[x]
def same(x,y):
    return find(x) == find(y)
def unite(x,y):
    x = find(x)
    y = find(y)
    if x == y:
        return 0
    par[x] = y
    
for i in range(m):
    a,b = map(int,input().split())
    unite(a,b)
for i in range(n+1):
  root[i] = find(i)
print(len(set(root))-1)

Measured memory_bytes: 88556
import java.util.*;

public class Main {
	public static void main(String[] args) throws Exception{
	Scanner scn = new Scanner(System.in);
	int n = scn.nextInt();
      int k = scn.nextInt();
      int[] a = new int[n];
      for(int i=0; i<a.length; ++i){
        a[i] = scn.nextInt();
      }
      int count = 0;
      for(int i=0; i<a.length; ++i){
        if(k<=a[i]){
          count = count+1;
        }
      }
      System.out.println(count);
	}
}

Measured memory_bytes: 58992
#include<stdio.h>
#include<math.h>
int n;
int main(){
	scanf("%d",&n);
	if(n>=pow(2,6))puts("64");
	else if(n>=pow(2,5))puts("32");
	else if(n>=pow(2,4))puts("16");
	else if(n>=pow(2,3))puts("8");
	else if(n>=pow(2,2))puts("4");
	else if(n>=pow(2,1))puts("2");
	else puts("1");
	return 0;
}

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

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

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

const ll INF = 1LL << 60;

ll h[100010];
ll dp[100010];

ll rec(int i) {
  if (dp[i] < INF) return dp[i];
  if (i == 0) return 0;
  ll res = INF;
  chmin(res, rec(i - 1) + abs(h[i] - h[i - 1]));
  if (i >= 2) chmin(res, rec(i - 2) + abs(h[i] - h[i - 2]));
  return dp[i] = res;
}

int main() {
  int n;
  cin >> n;
  rep(i, n) cin >> h[i];
  rep(i, 100010) dp[i] = INF;
  cout << rec(n - 1) << endl;
  return 0;
}


Measured memory_bytes: 9784
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.StringTokenizer;

public class Main {
	public static int N;
	public static long C;
	public static long[] positions, values, prefixes, suffixes, maxs1, maxs2;

	public static void main(String[] args) throws IOException {
		BufferedReader f = new BufferedReader(new InputStreamReader(System.in));
		StringTokenizer st = new StringTokenizer(f.readLine());
		N = Integer.parseInt(st.nextToken());
		C = Long.parseLong(st.nextToken());
		positions = new long[N + 1];
		values = new long[N + 1];
		prefixes = new long[N + 1];
		suffixes = new long[N + 1];
		maxs1 = new long[N + 1];
		maxs2 = new long[N + 1];
		positions[0] = 0;
		values[0] = 0;
		for (int i = 0; i < N; i++) {
			st = new StringTokenizer(f.readLine());
			long x = Long.parseLong(st.nextToken());
			long v = Long.parseLong(st.nextToken());
			positions[i + 1] = x;
			values[i + 1] = v;
		}
		for (int i = 1; i <= N; i++) {
			prefixes[i] = prefixes[i - 1] + values[i];
		}
		suffixes[N] = values[N];
		for (int i = N - 1; i >= 0; i--) {
			suffixes[i] = suffixes[i + 1] + values[i];
		}
		long max = 0;
		for (int i = N; i > 0; i--) {
			max = Math.max(max, suffixes[i] - (C - positions[i]));
			maxs1[i] = max;
		}
		max = 0;
		for (int i = 0; i <= N; i++) {
			max = Math.max(max, prefixes[i] - positions[i]);
			maxs2[i] = max;
		}
		long res = 0;
		for (int i = 0; i <= N; i++) {
			res = Math.max(res, prefixes[i] - positions[i]);
			res = Math.max(res, suffixes[i] - (C - positions[i]));
			if (i != N)
				res = Math.max(res, prefixes[i] + maxs1[i + 1] - 2 * positions[i]);
			if (i != 0)
				res = Math.max(res, suffixes[i] + maxs2[i - 1] - 2 * (C - positions[i]));
		}
		System.out.println(res);
	}
}

Measured memory_bytes: 51264
/* _________________________________________________________________________________________________
  |                                                                                                 |
  |                             Author      : Aditya Ahuja                                          |
  |                             Date        : Sun, 19th Jan 2020                                    |
  |_________________________________________________________________________________________________|
*/
 
#include<bits/stdc++.h>
using namespace std;

// #define int long long

#define pb          push_back
#define F           first
#define S           second
#define endl        "\n"
#define rep(i,a,b)  for(int i = a; i < (int)b; i++)
#define req(i,a,b)  for(int i = (int)b - 1; i >= a; i--)
#define all(a)      (a).begin(),(a).end()
#define ret(x)      {cout << x << endl; return;}
#define sz(x)       (int)x.size()
#define type(x)     typeid(x).name()

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

int gcd(int a, int b) {return b?gcd(b,a%b):a;}

#ifdef LOCAL
	#define wa(x)       cerr << (#x) << " --- " << (x) << endl
	#define pvi(v)      {for(auto it:v) cerr << it << " "; cerr << endl;}
	#define line1	    cerr << "---------------------------" << endl;
#else
	#define wa //
	#define line1 //
	#define pvi //
	#define printf //
#endif

void solve();
signed main() {
	ios_base::sync_with_stdio(false); cin.tie(NULL);
	cout << fixed << setprecision(10);

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

//___________________________________________________________________________________________________

void solve() {

	int n;
	cin >> n;

	vi a(n);
	rep(i,0,n) cin >> a[i];

	int ans = 0;
	int cur = a[0];
	rep(i,0,n){
		if(cur >= a[i]) ans++;
		cur = min(cur, a[i]);
	}

	ret(ans);

}


Measured memory_bytes: 1024
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair<ll,ll> P;
typedef pair<int,int> Pi;
#define rep(i,n) for(ll i=0;i<n;i++)
#define FOR(i,a,b) for(ll i=a;i<b;i++)
#define fi first
#define se second
#define endl "\n"

template<typename T> inline bool chmax(T &a, T b){if(a<b){a=b;return true;}return false;}
template<typename T> inline bool chmin(T &a, T b){if(a>b){a=b;return true;}return false;}
template<typename T> ostream& operator<<(ostream& s,const complex<T>& d) {return s<<"("<<d.real()<<", "<<d.imag()<< ")";}
template<typename T1, typename T2> ostream& operator<<(ostream& s,const pair<T1,T2>& d) {return s<<"("<<d.first<<", "<<d.second<<")";}
template<typename T> ostream& operator<<(ostream& s, const vector<T>& d){int len=d.size();rep(i,len){s<<d[i];if(i<len-1) s<<" ";}return s;}
template<typename T> ostream& operator<<(ostream& s,const vector<vector<T>>& d){int len=d.size();rep(i,len){s<<d[i]<<endl;}return s;}
template<typename T> ostream& operator<<(ostream& s,const set<T>& v){s<<"{ ";for(auto itr=v.begin();itr!=v.end();++itr) {if (itr!=v.begin()) {s<< ", ";}s<<(*itr);}s<<" }";return s;}
template<typename T1, typename T2> ostream& operator<<(ostream& s,const map<T1,T2>& m){s<<"{"<<endl;for(auto itr=m.begin();itr!=m.end();++itr){s<<" "<<(*itr).first<<" : "<<(*itr).second<<endl;}s<<"}"<<endl;return s;}

const ll mod=1e9+7;
const ll inf=1e17;
const int INF=1e9;
const double PI=acos(-1);
const double EPS=1e-10;

template<typename Monoid,typename F>
struct SegmentTree{
	int sz;
	vector<Monoid> node;
	const F op;//演算
	const Monoid e;//単位元
	SegmentTree(int n,const F op,const Monoid &e):op(op),e(e){
		sz=1;
		while(sz<n) sz*=2;
		node.assign(2*sz,e);
	}
	void build(const vector<Monoid> &v){
		int n=v.size();
		for(int i=0;i<n;i++) node[i+sz-1]=v[i];
		for(int i=sz-2;i>=0;i--) node[i]=op(node[2*i+1],node[2*i+2]);
	}
	void update(int k,const Monoid &x){
		k+=sz-1;
		node[k]=x;
		while(k>0){
			k=(k-1)/2;
			node[k]=op(node[2*k+1],node[2*k+2]);
		}
	}
	Monoid query(int a,int b,int k=0,int l=0,int r=-1){
		if(r<0) r=sz;
		if(r<=a || b<=l) return e;
		if(a<=l && r<=b) return node[k];
		else{
			Monoid vl=query(a,b,2*k+1,l,(l+r)/2);
			Monoid vr=query(a,b,2*k+2,(l+r)/2,r);
			return op(vl,vr);
		}
	}
	Monoid operator[](const int &k)const{
		return node[k+sz-1];
	}
};

int main(){
	cin.tie(0);ios::sync_with_stdio(false);
	int n,q;
	string s;
	cin>>n>>s>>q;
	auto op=[](int a,int b){return a|b;};
	SegmentTree<int,decltype(op)> seg(n,op,0);
	vector<int> a(n);
	rep(i,n){
		int x=s[i]-'0';
		a[i]=1<<x;
	}
	seg.build(a);
	while(q--){
		int c;
		cin>>c;
		if(c==1){
			int i;
			char x;
			cin>>i>>x;
			i--;
			int y=x-'0';
			seg.update(i,1<<y);
		}else{
			int l,r;
			cin>>l>>r;
			l--;
			int ret=seg.query(l,r);
			cout<<__builtin_popcount(ret)<<endl;
		}
	}
}

Measured memory_bytes: 6940
q,h,s,d = gets.split.map { |e| e.to_i * 8 }
n = gets.chomp.to_i * 4
p = [[1,q], [2,h/2], [4, s/4], [8, d/8]].sort_by { |e| e.last }
sum = 0
p.each do |e|
  c = n/e.first
  if c > 0
    n -= c * e.first
    sum += c * e.last * e.first
  end
end
puts sum / 8


Measured memory_bytes: 1788
#include<iostream>
#include<iomanip>
#include<cmath>
#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<algorithm>
#include<set>
#include<map>
#include<queue>
#include<stack>
#include<vector>
#include<cctype>
using namespace std;
int n,m,k;
signed main()
{
	scanf("%d%d%d",&n,&m,&k);
	printf("%d",(((n+m)*k)/2));
	return putchar(10),0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define fast ios::sync_with_stdio(0); cin.tie(0); cout.tie(0)
int A[1];
int size=1;
int m=2;
#define N 101
#define mod 1000000007
#define f(i,n) for(int i=0;i<n;i++)


int main()
{
    fast;

    int a;
    f(i,5){cin>>a;if(a==0)cout<<(i+1);}



}

Measured memory_bytes: 3648
#include <bits/stdc++.h>
using namespace std;

template<class T>
struct BITrangeAdd{
    vector<T> bit;
    BITrangeAdd(int n) : bit(n, 0){}
    T query(int j){
        // v[j] の値を返す。
        T v = 0;
        int nj;
        for (; j >= 0; j = (j & (j + 1)) - 1) v += bit[j];
        return v;
    }
    void update(int i, int j, T a) {
        // vの区間[i, j] に a を加算する。
        for (; i < bit.size(); i |= i + 1) bit[i] += a;
        for (++j; j < bit.size(); j |= j + 1) bit[j] -= a;
    }
};



int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    int N, M;
    cin >> N >> M;
    vector<vector<int>> Ranges(M + 1, vector<int>());
    for (int i = 0; i != N; ++i){
        int L, R;
        cin >> L >> R;
        Ranges[R - L + 1].push_back(L);
    }
    int cumWide = N;
    BITrangeAdd<int> bit(M + 1);
    for (int d = 1; d <= M; ++d){
        int ans = cumWide;
        for (int x = d; x <= M; x += d) ans += bit.query(x);
        cout << ans << '\n';
        cumWide -= Ranges[d].size();
        for (auto L : Ranges[d]) bit.update(L, L + d - 1, 1);
    }

    return 0;
}

Measured memory_bytes: 6912
#include <cstdio>

bool w[6666] = { true }, s[6666] = { true };

int main(void)
{
	double max = -1.0;
	int a, b, c, d, e, f, i, j, ansa = 0, ansb = 0;

	scanf("%d %d %d %d %d %d" ,&a, &b, &c, &d, &e, &f);
	a *= 100, b *= 100;

	for (i = 0; i <= f; i++)
	{
		if (w[i])
		{
			w[i + a] = true;
			w[i + b] = true;
		}
		if (s[i])
		{
			s[i + c] = true;
			s[i + d] = true;
		}
	}

	for (i = 100; i <= f; i += 100)
	{
		if (!w[i])
			continue;

		for (j = 0; j <= f - i; j++)
		{
			if (!s[j])
				continue;

			if (j * 100 <= e * i)
			{
				double t = (double)j / (i + j);

				if (max < t)
				{
					max = t;
					ansa = i + j;
					ansb = j;
				}
			}
			else
				break;
		}
	}

	printf("%d %d" ,ansa, ansb);
	return 0;
}

Measured memory_bytes: 128
import java.util.*;

public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int A = sc.nextInt();
        int B = sc.nextInt();
        int C = sc.nextInt();
        int D = sc.nextInt();
        int start = Math.max(A, C);
        int end = Math.min(B, D);
        int reult = end - start;
        System.out.println(reult < 0 ? 0 : reult);
    }
}


Measured memory_bytes: 23380
#include <iostream>
#include<bits/stdc++.h>
#define int long long int
#define vi vector<int>
#define vvi vector<vector<int>>
using namespace std;


int32_t main() {
	// your code goes here
int k,count=0,sum=0,i,j;
cin>>k;
if(k%2==0||k%5==0)
{
    cout<<"-1\n";
}
else
{
    while(1)
    {
        sum=10*sum+7;
        count++;
        sum%=k;
        if(!sum)
        {
            cout<<count<<"\n";
            break;
        }
    }
}
	return 0;
}


Measured memory_bytes: 3640
#include<iostream>
#include<vector>
#include<algorithm>
#include<math.h>
#include<queue>
#include<deque>
#include<map>
using namespace std;
typedef long long ll;

int main() {
    string s; cin >> s;
    auto rec = [&](auto &&rec, int i, ll n, ll m) -> ll {
        if (s.size() == i) {
            return n+m;
        }
        int a = s[i]-'0';
        ll res = rec(rec, i+1, n+m, a);
        if (i > 0) res += rec(rec, i+1, n, m*10+a);
        return res;
    };
    cout << rec(rec, 0, 0, 0) << endl;
    return 0;
}

Measured memory_bytes: 256
//Author: Fuadul Hasan(fuadul202@gmail.com)
//BSMRSTU,Gopalganj
#include<bits/stdc++.h>
using namespace std;

#define ll long long
const int mod = 1e9 + 7;
const int Inf = (int)2e9 + 5;
const ll  Lnf = (ll)2e18 + 5;
const int N   = 4e5 + 5;
int solve() 
{
	
	int a,b,c;
	scanf("%d%d%d", &a,&b,&c);
	swap(a,b);
	swap(a,c);
	printf("%d %d %d\n",a,b,c);

	return 0;
}
int main(){
	int test = 1;
	//scanf("%d", &test);
	while (test--)solve();return 0;
}

Measured memory_bytes: 256
n, k = [int(i) for i in input().split()]
a = [int(i) for i in input().split()]
from collections import Counter
counters = Counter(a)
b = sorted(counters.items(), key=lambda x: x[1])
left = len(b) - k
index = 0
ans = 0
while left > 0:
    ans += b[index][1]
    index += 1
    left -= 1
print(ans)

Measured memory_bytes: 39300
import math
n,d = map(int, input().split())
x = [list(map(int, input().split())) for _ in range(n)]
ans = 0

for i in range(n):
  for j in range(i+1,n):
    temp = 0
    for k in range(d):
      temp += (x[i][k] - x[j][k]) ** 2
    l = math.sqrt(temp)
    if l.is_integer():
      ans += 1
print(ans)

Measured memory_bytes: 3064
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define rep(i,n) for(int i=0;i<n;i++)
signed main(){
	int n,h,w;
	cin>>n>>h>>w;
	cout<<(n-h+1)*(n-w+1)<<endl;
	return 0;
}


Measured memory_bytes: 256
#include <stdio.h>
#define N 250

int parent(int i){
  return i/2;
}

int Left(int i){
  return 2*i;
}

int Right(int i){
  return 2*i+1;
}   

main(){
  int i, n, h[N];
  scanf("%d",&n);
  for(i=1;i<n+1;i++){
    scanf("%d",&h[i]);
  }
  for(i=1;i<n+1;i++){
    if(i==1) {
      printf("node %d: key = %d, ", i, h[i]);
    }
    else if(i>1) {
      printf("node %d: key = %d, parent key = %d, ", i, h[i], h[parent(i)]);
      }
    if(Left(i) <= n){
      printf("left key = %d, ", h[Left(i)]);
    }
    if(Right(i) <= n){
      printf("right key = %d, ", h[Right(i)]);
    }
    printf("\n");
  }
   
  return 0;   
}

Measured memory_bytes: 600
N=gets.to_i
A=gets.split.map(&:to_i)

if A[-1]!=2
    puts -1
    exit
end

min=2
max=3
A.reverse_each do |a|
    if (min-1)/a==max/a || 2*min<=a
        puts -1
        exit
    end
    min=(min+a-1)/a*a
    max=max/a*a+(a-1)
end

puts "#{min} #{max}"


def test
    flag=true
    100000.times do |i|
        j=i
        A.each do |a|
            j=j/a*a
        end
        if flag==false && j==2
            p i
            flag=true
        elsif flag==true && j!=2
            p i-1
            flag=false
        end
    end
end


Measured memory_bytes: 8588
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
const int maxn = 1e5+100;

ull a[maxn];

int main(){
    int n; cin >> n;
    ull ans = 1;
    bool flag = 0;

    for(int i = 0; i < n; i++) cin >> a[i];
    sort(a, a+n);

    for(int i = 0; i < n; i++){
        if(log2(a[i]) + log2(ans) > 60) flag = 1;
        ans = ans*a[i];
        if(ans > 1000000000000000000ll) flag = 1;
    }
    if(flag) cout << -1 << endl;
    else cout << ans << endl;
    return 0;
}

Measured memory_bytes: 4616
#include <iostream>
using namespace std;
int main()
{
  int a[3], b[3];
  for (int i = 0; i < 3; i++)
    cin >> a[i] >> b[i];
  bool path[5][5];
  for (int i = 0; i < 3; i++)
  {
    path[a[i]][b[i]] = true;
    path[b[i]][a[i]] = true;
  }
  string ans = "NO";
  if (path[1][2] && path[2][3] && path[3][4])
    ans = "YES";
  if (path[1][3] && path[3][2] && path[2][4])
    ans = "YES";
  cout << ans << endl;
  return 0;
}

Measured memory_bytes: 256
#include<iostream>
#include<algorithm>
#include<vector>
using namespace std;
vector<int> v;
int main(){
	int m,a,b,i,j;
	for(i=2;i<50000;i++){
		bool ok=1;
		for(j=0;j<v.size();j++)if(i%v[j]==0)ok=0;
		if(ok)v.push_back(i);
	}
	while(cin>>m>>a>>b&&m){
		int p=-1,q=0;
		for(i=0;i<v.size();i++){
			for(j=i;j<v.size();j++){
				if(v[i]*v[j]>m)break;
				if(v[j]<=b*v[i]/a&&p*q<v[i]*v[j])p=v[i],q=v[j];
			}
		}
		cout<<p<<" "<<q<<endl;
	}
	return 0;
}

Measured memory_bytes: 3172
#include <iostream>
#include <cstdio>
#include <cstring>
#include <vector>
#include <algorithm>
#include <cmath>

using namespace std;

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

ll x, y;
ll ans;

ll go(ll x, ll y) {
    if (x > y)
        return 1LL << 60;
    return y - x;
}

int main()
{

    scanf("%lld%lld", &x, &y);

    ans = 1LL << 60;
    ans = min(ans, go(x, y));
    ans = min(ans, 1 + go(-x, y));
    ans = min(ans, 1 + go(x, -y));
    ans = min(ans, 2 + go(-x, -y));

    printf("%lld", ans);

    return 0;
}


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

int main(){
	int n;
	cin >> n;
	vector<int> a(n);
	rep(i, n) cin >> a.at(i);

	sort(a.begin(), a.end());
	reverse(a.begin(), a.end());

	int alice = 0;
	int bob = 0;
	rep(i, n){
		if(i%2 == 0)
			alice += a.at(i);
		else
			bob += a.at(i);
	}

	cout << alice-bob << endl;

}

Measured memory_bytes: 256
#include <stdio.h>

int main() {
	int m, f, r;

	while(1) {
		/* ???????????????????????????????????? */
		scanf("%d %d %d", &m, &f, &r);

		if(m==-1 && f==-1 && r==-1) {
			break;
		} else if(m==-1 || f==-1) { /* ?????????F?????? */
			printf("F\n");
		} else if(m+f >= 80){ /* ?????????A?????? */
			printf("A\n");
		} else if(m+f >= 65){ /* ?????????B?????? */
			printf("B\n");
		} else if(m+f >= 50){ /* ?????????C??????(1) */
			printf("C\n");
		} else if(m+f >= 30 && r >= 50){ /* ?????????C??????(2) */
			printf("C\n");
		} else if(m+f >= 30 && r < 50){ /* ?????????D?????? */
			printf("D\n");
		} else { /* ??????????????? = ?????????F?????? */
			printf("F\n");
		}
	}

	return 0;
}

Measured memory_bytes: 584
#include <iostream>
#include <string>
#include <cmath>
#include <algorithm>
#include <vector>
using namespace std;

int main(){
    int n;
    int hoge;
    int cnt=0;
    bool flag = false;
    vector<int> a;
    vector<int>::iterator it;

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

    while(1){
//        for(vector<int>::const_iterator it=a.begin(), e=a.end(); it !=e; it++){
        for(it=a.begin(); it!=a.end(); it++){
//            cout<<*it<<endl;
            if(*it %2!=0){
                flag = true;
            }
            if(flag == true)break;

            *it /=2;
        }
        if(flag == true)break;
        cnt++;
    }

    cout<<cnt<<endl;

}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
using namespace std;
using namespace __gnu_pbds;
/******************************************
* AUTHOR : PANDRAVISAM SHIVA SANTHOSH *
* Handle : santhosh_80 *
* INSTITUTION : IIT Palakkad *
******************************************/
typedef tree<int,null_type,less<int>,rb_tree_tag,
tree_order_statistics_node_update> indexed_set;
#define ll long long int 
#define mod 1000000007
#define rep(i,a,b) for(int i=a;i<b;i++)
#define pii pair<int,int>
#define all(v) (v).begin(),(v).end()
#define S(x) scanf("%d",&(x))
#define P(x) printf("%d\n",(x))
#define Sl(x) scanf("%lld",&(x))
#define Pl(x) printf("%lld\n",(x))
#define pb push_back
#define f first
#define s second


int main() {
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	int a,b,c,d; cin >> a >> b >> c >> d;
	int count = 0;
	while(a > 0 && c > 0 ){
		if(count%2 == 1)a = a-d;
		else c=c-b;
		count++;
	}
	if(c <= 0)cout << "Yes";
	else cout << "No";

 	return 0;
}

Measured memory_bytes: 3652
import java.util.*;
public class Main {
	public static void main(String[] args){
		
		Scanner sc = new Scanner(System.in);
		int k = sc.nextInt();
		int s = sc.nextInt();
		int count = 0;
		
		for(int x = 0; x <= k ; x++){
		for(int y = 0; y <= k ; y++){
		
		if(0 <= (s-x-y) && (s-x-y) <= k) {
		
		count += 1; 
		}}}
		
		System.out.println(count);
	}
}

Measured memory_bytes: 9812
let arr_of_str s = Array.init (String.length s) (fun i -> i, s.[i])
let chk u v =
  let cv = Array.make 26 None in
  Array.fold_left ((fun b (i, c) -> (&&) b @@
    let d = int_of_char c - 97 in
    match cv.(d) with
    | None -> (( cv.(d) <- Some u.[i]; true ))
    | Some c' -> u.[i] = c')) true (arr_of_str v)
let _ = print_endline @@ Scanf.scanf "%s %s" @@ fun s t ->
  if chk s t && chk t s then "Yes" else "No"


Measured memory_bytes: 14848
/// kazuki08
/*
#pragma comment(linker, "/stack:200000000")
#pragma GCC optimize("O3")
#pragma GCC optimize("Ofast")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#pragma GCC optimize("unroll-loops")
*/
#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;
#define int long long
typedef long long ll;
typedef tree<int,null_type,less<int>,rb_tree_tag,tree_order_statistics_node_update>ordered_set;
typedef long double ld;
typedef vector<int> vi;
typedef pair<int,int> pi;
typedef vector<pi> vpi;
#define ar array
//#define inf 1000000000
#define mod 998244353
#define dmp(x) cerr<<"line "<<__LINE__<<" "<<#x<<":"<<x<<endl
#define fs first
#define sc second
#define pb push_back
#define all(c) (c).begin(),(c).end()
#define mt make_tuple
#define IOS ios::sync_with_stdio(0);cin.tie(0);cout.tie(0)
template<class S,class T> ostream& operator<<(ostream& o,const pair<S,T> &p){
    return o<<"("<<p.fs<<","<<p.sc<<")";
}
template<class T> ostream& operator<<(ostream& o,const vector<T> &vc){
    o<<"{";
    for(const T& v:vc) o<<v<<",";
    o<<"}";
    return o;
}
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());

const int MAXN = 101010;
int n,x,m;
int a[MAXN],ss[MAXN];

signed main(){
IOS;
//freopen("input.txt", "r", stdin);
//freopen("output.txt", "w", stdout);
  
  cin >> n >> x >> m;
  if(n==1){
    cout << x << endl;
    return 0;
  }
  a[1]=x;
  int sum = x;
  int ans = 0, p = 1, rem = 0;
  // set<int> s;
  map<int,int> s;
  s[x]=1;
  ss[1]=x;
  for(int i=2;;i++){
    a[i] = (a[i-1]*a[i-1])%m;
    sum+=a[i];
    ss[i]=sum;
    // cerr << sum << " " << a[i] << endl;
    if(a[i]==0 || i==n ){
      cout << sum << endl;
      return 0;
    }
    if(s.find(a[i])!=s.end()){
      sum-=a[i];
      p = i-s[a[i]];
      ans+=ss[s[a[i]]-1];
      sum-=ss[s[a[i]]-1];
      n-=(s[a[i]]-1);
      ans+=((sum)*(n/p));
      rem = (n%p);
      for(int j=s[a[i]];j<rem+s[a[i]];j++){
        ans+=a[j];
      }
      break;
    }
    s[a[i]]=i;
  }
  // cerr << p << endl;
  // for(int i=1;i<=rem;i++){
  //   ans+=a[i];
  // }
  cout << ans << endl;



return 0;
}
///....


Measured memory_bytes: 7532
#include <iostream>
#include <algorithm>
using namespace std;

int main(){
  int n;
  cin >> n;
  int a[n];
  for(int i=0;i<n;i++){
    cin >> a[i];
  }
  sort(a,a+n);
  cout << a[n-1]-a[0] << endl;
}

Measured memory_bytes: 256
#include<iostream>
#include <bits/stdc++.h>
#include <string>
#include <cstring>
#include <algorithm>
using namespace std;

int main() {
	
    int n  ;    
    cin >> n ;
    long long ans = 0 ;

    for (int i = 1;i<=n; i++){
        if(i%3==0 || i%5==0){
            continue ;
        }else{
            ans += i ;
        }
    }
    
    cout << ans << endl ;
    
  	return 0;
}


Measured memory_bytes: 3632
#include<iostream>
using namespace std;
int main() {
	int a, bigger, smaller;
	long total;
	int Array[10000];
	cin >> a;
	for (int i = 0; i < a; i++){
		cin >> Array[i];
	}
	bigger = Array[0];
	for (int i = 1; i < a; i++){
		if (bigger < Array[i]) {
			bigger = Array[i];
		}
	}
	smaller = Array[0];
	for (int i = 1; i < a; i++) {
		if (smaller > Array[i]) {
			smaller = Array[i];
		}
	}
	total = 0;
	for (int i = 0; i < a; i++) {
		total += Array[i];
	}
	cout << smaller << " " << bigger << " " << total << "\n";
}

Measured memory_bytes: 3084
#include <bits/stdc++.h>
using namespace std;
int main() {
  int plus=0;
  for (int i=0; i<3; i++) {
    char t;
    cin >> t;
    if (t == 'o') {
      plus += 100;
    }
  }
  cout << 700+plus << endl;
}

Measured memory_bytes: 256
from collections import Counter
M = 10**9 + 7
N = int(input())

prime = [True] * (N+1)
prime[0] = False
prime[1] = False
for i in range(4, N+1, 2):
    prime[i] = False
for i in range(3, N+1, 2):
    if prime[i]:
        for j in range(2*i, N+1, i):
            prime[j] = False

primes = [i for i, b in enumerate(prime) if b]

def fact(k, pdict):
    a = k
    for p in primes:
        if p*p > k:
            break
        c = 0
        while a % p == 0:
            a //= p
            c += 1
        pdict[p] += c
    if a > 1:
        pdict[a] += 1

def solve():
    pdict = Counter()
    for k in range(2, N+1):
        fact(k, pdict)

    ans = 1
    for v in pdict.values():
        ans = ans * (v+1) % M
    return ans


print(solve())


Measured memory_bytes: 3316
#include <bits/stdc++.h>

using namespace std;

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

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

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

ll A[100005];
ll N, M;

ll count(ll m) {
    ll ret = 0;
    REP(i, N) {
        ll ok = -1, ng = N;
        while (abs(ok - ng) > 1) {
            ll mid = (ok + ng) / 2;
            if (A[i] + A[mid] >= m)
                ok = mid;
            else
                ng = mid;
        }
        ret += ok + 1;
    }
    return ret;
}

ll S[100005];

int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    cin >> N >> M;
    REP(i, N) {
        cin >> A[i];
    }
    sort(A, A + N, greater<ll>());
    memset(S, 0, sizeof(S));
    REP(i, N) {
        S[i] += A[i];
        S[i + 1] += S[i];
    }

    ll border = 1e7, ng = 0;
    while (abs(ng - border) > 1) {
        ll mid = (ng + border) / 2;
        if (count(mid) <= M)
            border = mid;
        else
            ng = mid;
    }

    ll ans = (border - 1) * (M - count(border));
    REP(i, N) {
        ll ok = -1, ng = N;
        while (abs(ok - ng) > 1) {
            ll mid = (ok + ng) / 2;
            if (A[i] + A[mid] >= border)
                ok = mid;
            else
                ng = mid;
        }

        if (ok < 0)
            continue;
        ans += S[ok] + A[i] * (ok + 1);
    }

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

Measured memory_bytes: 1792
n = int(input())
a = [int(input()) for i in range(n)]
not10 = [i for i in a if i % 10 != 0]
a10 = [i for i in a if i % 10 == 0]
maxn10 = sum(not10)
if maxn10 % 10 == 0 and maxn10:
    maxn10 -= min(not10)
ans = maxn10 + sum(a10)
print(0) if ans % 10 == 0 else print(ans)


Measured memory_bytes: 9044
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
 
int main(){
  int N,L;
  int i,j;
  scanf("%d",&N);
  scanf("%d",&L);
  char S[N][L+1];
  for(i=0;i<N;i++)
  {
  	scanf("%s",S[i]);
  }
  
  char tmp[L+1];
  
  for(i=1;i<N;i++){
  	for(j=N-1;j>=i;j--){
    	if(strcmp(S[j-1],S[j])>0){
        	strcpy(tmp,S[j-1]);
          	strcpy(S[j-1],S[j]);
          	strcpy(S[j],tmp);
        }
    }
  }
  for(i=0;i<N;i++){
  	printf("%s",S[i]);
  }
 
  return 0;
}


Measured memory_bytes: 128
#include <bits/stdc++.h>
#define lson l,mid,rt<<1
#define rson mid+1,r,rt<<1|1

using namespace std;
typedef long long ll;
typedef pair<int,int> pa;
const int N=1e4+100;
int s[N],t[N];
ll dp[N][N];
int mod=1e9+7;
int main()
{
    int n,m;
    cin>>n>>m;
    for(int i=1;i<=n;i++) cin>>s[i];
    for(int j=1;j<=m;j++) cin>>t[j];
    for(int i=0;i<=n;i++) dp[i][0]=1;
    for(int i=0;i<=m;i++) dp[0][i]=1;
    for(int i=1;i<=n;i++){
        for(int j=1;j<=m;j++){
            dp[i][j]=(dp[i][j-1]+dp[i-1][j]-dp[i-1][j-1])%mod;
            if(s[i]==t[j])
            dp[i][j]=(dp[i][j]+dp[i-1][j-1]+mod)%mod;
        }
    }
    printf("%lld\n",(dp[n][m]+mod)%mod);
    return 0;
}


Measured memory_bytes: 158464
#include <iostream>
#include <algorithm>
#include <math.h>
#include <set>
#include <vector>
#include <map>
#include <ctype.h>
using namespace std;
int main(){
string a,b,c;
cin>>a>>b>>c;
cout <<char(toupper(a[0]))<<char(toupper(b[0]))<<char(toupper(c[0]))<<endl;	
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
 
/*
*****************code written By**********************
..................Marajul islam.......................
...................BSMRSTU,CSE........................
*/ 
 
int sc1() {int x; scanf("%d", &x); return x;}
 
long long sc2() {long long x; scanf("%lld", &x); return x;}
 
 
 
#define  gcd(a,b)         __gcd(a,b)
#define  lcm(a,b)         (a*b)/gcd(a,b)
#define  Int              sc1()
#define  LL               sc2()
#define  For(n)           for(int i=0;i<n;i++)
#define  Forj(n)          for(int j=0;j<n;j++)
#define  Fork(n)          for(int k=0;k<n;k++)
#define  For1(n)          for(int i=1;i<=n;i++)
#define  ll               long long
#define  vi               std::vector<int>
#define  vll              std::vector<ll>
#define  qui              qu
#define  pb               push_back
#define  mpsi             std::map<string, int>
 
 
const int mod           = 1e9 + 7;
const int inf           = (int)2e9 + 5;
const ll  Inf           = (ll)1e18 + 5;
const int N             = 5e6 + 5;
 
inline int add(int a, int b) {a += b; return a >= mod ? a - mod : a;}
inline int sub(int a, int b) {a -= b; return a < 0 ? a + mod : a;}
inline int mul(int a, int b) {return (ll)a * b % mod;}
 

 
 
int solve() {
 
	ll n=Int;
	ll arr[n+1];
	For(n) arr[i]=Int;
	sort(arr,arr+n);
	ll ans=999999999;
	for(int i=0;i<=100;i++){
		ll sum=0;
		for(int j=0;j<n;j++){
			sum+=(i-arr[j])*(i-arr[j]);
		}
		ans=min(ans,sum);
	}
	cout<<ans<<endl;
 
	return 0;
}
 
 
 
 
int main()
{
	//freopen("input.txt", "r", stdin);
	//freopen("output.txt", "w", stdout);
 
	int test = 1, tc = 0;
	//scanf("%d", &test);
	//cin >> test;
	while (test--) {
		//printf("Case %d: ", ++tc);
		solve();
	}
 
	return 0;
 
 
 
 
}




Measured memory_bytes: 256