Harryxun/stf_run huggingface dataset:
# -*- coding: utf-8 -*-
import numpy as np

iNum = int(input())
naXY = np.zeros((iNum,2))
for iI in range(iNum):
  x, y = map(int, input().split())
  naXY[iI] = [x,y]
naXY0 = np.average(naXY, axis = 0) + np.random.rand(2) * 1e-3
fA = 1.0e-1
while fA > 1.0e-10:
  naP  = naXY - naXY0
  naR = np.einsum("ij, ij -> i", naP,naP)
  iImax = np.argmax(naR)
  #fR  = naR[iImax]**0.5
  naE = naP[iImax]
  naE/= np.dot(naE,naE)**0.5
  #print(iImax, naXY0, fR)
  #naB = np.einsum("ij, j->i", naP, naE)*2
  #naA = (naR - fR**2 ) / (naB - 1.0e-10 - fR)
  #fA  = np.min(naA[naB< - 1.0e-20])
  #print(iImax, fA, fR)
  #naXY0+=naE*fA
  naXY0+=naE*fA
  fA*=0.9995
print(fR)


### FIXED CODE ###

# -*- coding: utf-8 -*-
import numpy as np

iNum = int(input())
naXY = np.zeros((iNum,2))
for iI in range(iNum):
  x, y = map(int, input().split())
  naXY[iI] = [x,y]
naXY0 = np.average(naXY, axis = 0) + np.random.rand(2) * 1e-3
fA = 1.0e-1
while fA > 1.0e-10:
  naP  = naXY - naXY0
  naR = np.einsum("ij, ij -> i", naP,naP)
  iImax = np.argmax(naR)
  #fR  = naR[iImax]**0.5
  naE = naP[iImax]
  #naE/= np.dot(naE,naE)**0.5
  #print(iImax, naXY0, fR)
  #naB = np.einsum("ij, j->i", naP, naE)*2
  #naA = (naR - fR**2 ) / (naB - 1.0e-10 - fR)
  #fA  = np.min(naA[naB< - 1.0e-20])
  #print(iImax, fA, fR)
  #naXY0+=naE*fA
  naXY0+=naE*fA
  fA*=0.9998
print(naR[iImax]**0.5)
s = input()
ans = 0
index = 0
rev = {'0': '9',
       '1': '8',
       '2': '7',
       '3': '6',
       '4': '5',
       '5': '4',
       '6': '3',
       '7': '2',
       '8': '1',
       '9': '0'}
def f(n):
    global ans, index

    lenn = len(n)
    while index < lenn and (n[index] < '5' or (n[index] == '5' and (index == lenn - 1 or n[index+1] <= '4'))):
        ans += int(n[index])
        index += 1
    if index < lenn:
        ans += 1
        f(''.join([rev[t] for t in n if t]))
f(s)
print(ans)

### FIXED CODE ###

n = input()
lenn = len(n)

dp = [0, 10000]
for d in reversed(n):
    d = int(d)
    dp = [min(d + dp[0], d + 1 + dp[1]), min(10 - d + dp[0], 9 - d + dp[1])]

print(min(dp[0], 1 + dp[1]))
import math
N = int(input())
A = list(map(int, input().split()))

B=sorted(set(A))
sa = []
gokei = 0
for i in range(len(B)):
    x = A.count(B[i])
    if x == 1:
        continue
    elif x ==2:
        gokei += 1
        sa.append(1)
    else:
        y = x-1
        z = math.factorial(x)//math.factorial(x-2)//math.factorial(2)
        gokei += z
        sa.append(z-math.factorial(y)//math.factorial(y-2)//math.factorial(2))

ans = [0]*(N+1)
for i in range(N):
    z = A[i]
    if ans[z] == 0:
        e = gokei - sa[B.index(z)]
        ans.append(e)
        print(e)
    else:
        print(ans[z])

### FIXED CODE ###

import collections

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

gokei = 0
counter = collections.Counter(A)
for i in counter.values():
    gokei += i * (i - 1) // 2

ans = [0]*(N+1)
for i in range(N):
    z = A[i]
    d = counter[z]
    if ans[z] == 0:
        e = gokei - (d * (d - 1) // 2 - (d-1) * (d - 2) // 2)
        ans.append(e)
        print(e)
    else:
        print(ans[z])
import heapq
from collections import defaultdict, deque
from math import ceil, factorial, gcd
from itertools import accumulate
import sys
import bisect
import numpy as np

sys.setrecursionlimit(10 ** 7)
INF = float("inf")
MOD = 10 ** 9 + 7

si = lambda: input().strip()
ii = lambda: int(input())
mii = lambda: map(int, input().split())
lmii = lambda: list(map(int, input().split()))
smii = lambda: sorted(map(int, input().split()))

# ----------

N = ii()
A = lmii()

scoret = []

for i in range(N):
    for j in range(N):
        if i == j:
            continue
        scoret.append((i, j, A[i] * abs(i-j)))

scoret.sort(key=lambda x: -x[2])
done_s = set()
done_t = set()
ans = 0
for s, t, score in scoret:
    if s in done_s or t in done_t:
        continue
    ans += score
    done_s.add(s)
    done_t.add(t)

print(ans)


### FIXED CODE ###

n = int(input())
a = list(map(int, input().split()))

dp = [[0] * (n+1) for _ in range(n+1)]

p = []
for i in range(n):
    p.append((a[i], i))
p.sort(key=lambda x: -x[0])

for i in range(n):
    pi = p[i][1]
    for l in range(i+1):
        r = i - l
        dp[i+1][l+1] = max(dp[i+1][l+1], dp[i][l] + (pi-l)*a[pi])
        dp[i+1][l] = max(dp[i+1][l], dp[i][l] + ((n-r-1)-pi)*a[pi])

ans = 0
for i in range(n+1):
    ans = max(ans, dp[n][i])

print(ans)
K,X=map(int, input().split())
print('Yes' if 500*K>=X else 'No')

### FIXED CODE ###

K,X=map(int, input().split())
print('Yes' if 500*K>=X else 'No')
n = int(input())
x = int(input(),2)

def popcount(x):
    x = x - ((x >> 1) & 0x5555555555555555)
    x = (x & 0x3333333333333333) + ((x >> 2) & 0x3333333333333333)

    x = (x + (x >> 4)) & 0x0f0f0f0f0f0f0f0f
    x = x + (x >> 8)
    x = x + (x >> 16)
    x = x + (x >> 32)
    return x & 0x0000007f
x_pop = popcount(x)
for i in reversed(range(0,n)):
    if x&(1<<i):
        tmp_pop = x_pop - 1
    else:
        tmp_pop = x_pop + 1
    tmp2 = (x^(1<<i)) % tmp_pop
    cnt = 1
    while tmp2 > 0:
        tmp = tmp2
        tmp2 = tmp % popcount(tmp)
        cnt += 1
    print(cnt)

### FIXED CODE ###

n = int(input())
s = input()
x = int(s, 2)
pcx = s.count("1")
pc1 = x % (pcx - 1) if pcx > 1 else 0
pc2 = x % (pcx + 1)

def f(j):
    cnt = 0
    while j:
        j %= bin(j).count("1")
        cnt += 1
    return cnt

for i, y in enumerate(s):
    k = n - 1 - i
    if y == "0":
        print(f((pc2 + pow(2, k, pcx + 1)) % (pcx + 1)) + 1)
    elif pcx > 1:
        print(f((pc1 - pow(2, k, pcx - 1)) % (pcx - 1)) + 1)
    else:
        print(0)
N = int(input())
X =[]
for i in range(N):
    Y =list(input())
    Y.sort()
    X.append(Y)
    X.sort()
    
ans = 0
count = 1 
for i in range(N-1):
    if X[i] == X[i+1]:
        count += 1
    else:
        if count != 1:
            Z = 1/2
            for i in range(1,count+1):
                Z = Z * i
            ans = ans + Z
            count = 1

if count != 1:
    Z = 1/2
    for i in range(1,count+1):
        Z = Z * i
    ans = ans + Z
        
print(int(ans))

### FIXED CODE ###

N = int(input())
X =[]
for i in range(N):
    Y =list(input())
    Y.sort()
    X.append(Y)
X.sort()
    
ans = 0
count = 1 
for i in range(N-1):
    if X[i] == X[i+1]:
        count += 1
    else:
        if count != 1:
            Z = 1
            Z = Z * count * (count-1)
            Z = Z // 2
            ans = ans + Z
            count = 1

if count != 1:
    Z = 1
    Z = Z * count * (count-1)
    Z = Z // 2
    ans = ans + Z
        
print(ans)
s = list(input())
for i in s:
  if s[i] == "+":
    s[i] = 1
  else:
    s[i] = -1

print(sum(s))

### FIXED CODE ###

s = list(input())
for i in range(len(s)):
  if s[i] == "+":
    s[i] = 1
  else:
    s[i] = -1

print(sum(s))
<?php fscanf(STDIN,"%d%d",$n,$k);echo $k*($k-1)**~-$n;

### FIXED CODE ###

n,k=map(int,input().split());print(k*(k-1)**(n-1))
s = list(input())
n = len(s)

ans = 0
for i in range(2**(n-1)) :
    wa = 0
    kou = s[0]
    for j in range(n-1):
        if i>>j & 1 :
            wa += int(kou)
            kou = s[j+1]
        else :
            kou += s[j+1]
        if j == n-2 :
            wa += int(kou)
    ans += wa
if n == 1 :
    print(int(s))
else :
    print(ans)

### FIXED CODE ###

s = input()
n = len(s)

ans = 0
for i in range(2**(n-1)) :
    wa = 0
    kou = s[0]
    for j in range(n-1):
        if i>>j & 1 :
            wa += int(kou)
            kou = s[j+1]
        else :
            kou += s[j+1]
        if j == n-2 :
            wa += int(kou)
    ans += wa
if n == 1 :
    print(int(s))
else :
    print(ans)
a=int(input())
moji=input()
r=[]
g=[]
b=[]
for i in range(a):
    if moji[i]=="R":
        r.append(i)
    elif moji[i]=="G":
        g.append(i)
    elif moji[i]=="B":
        b.append(i)
res=len(r)*len(g)*len(b)
if len(r)==0 or len(g)==0 or len(b)==0:
    print(0)
else:
    min_len={len(r):r,len(g):g,len(b):b}
    tmp=sorted(min_len.keys())
    r=min_len[tmp[0]]
    g=min_len[tmp[1]]
    b=min_len[tmp[2]]
    for i in r:
        for j in g:
            if -abs(i-j)+min(i,j) in b:
                res-=1
            if abs(i-j)+max(i,j) in b:
                res-=1
            if abs(i-j)%2==0 and  int(abs(i-j)/2)+min(i,j) in b:
                res-=1
    print(res)

### FIXED CODE ###

a=int(input())
moji=input()
r=[]
g=[]
b=[]
for i in range(a):
    if moji[i]=="R":
        r.append(i)
    elif moji[i]=="G":
        g.append(i)
    else:
        b.append(i)
res=len(r)*len(g)*len(b)
if len(r)==0 or len(g)==0 or len(b)==0:
    print(0)
else:
    for i in range(0,a-2):
      for j in range(i+1,a-1):
        if 2*j-i<a and moji[i]!=moji[j] and moji[j]!=moji[2*j-i] and moji[2*j-i]!=moji[i]:
          res-=1
    print(res)
# -*- coding: utf-8 -*-
# 写経した
import re
class Num:
    def __str__(self):
        return str(self.x)
    def __init__(self, value):
        self.x = value
    def __add__(self, value):
        return o(self.x + value.x)
    def __sub__(self, value):
        return o(self.x - value.x)
    def __mul__(self, value):
        return o(self.x * value.x)
    def __truediv__(self, value):
        return o(int(self.x / value.x))
     
N = int(input())
for i in range(N):
    s = input()[:-1]
    s = re.sub(r'(\d+)',r'Num(\1)',s)
    print(eval(s))


### FIXED CODE ###

# -*- coding: utf-8 -*-
# 写経した
import re
class Num:
    def __str__(self):
        return str(self.x)
    def __init__(self, value):
        self.x = value
    def __add__(self, value):
        return Num(self.x + value.x)
    def __sub__(self, value):
        return Num(self.x - value.x)
    def __mul__(self, value):
        return Num(self.x * value.x)
    def __truediv__(self, value):
        return Num(int(self.x / value.x))
      
N = int(input())
for i in range(N):
    s = input()[:-1]
    s = re.sub(r'(\d+)',r'Num(\1)',s)
    print(eval(s))
N = int(input())
A = list(sorted(map(int, input().split())))
B = list(sorted(map(int, input().split()))
C = list(sorted(map(int, input().split())))
 
import bisect
upper_condition = [bisect.bisect_left(A, b) for b in B]
lower_condition = [N - bisect.bisect_right(C, b) for b in B]
 
print(sum(map(lambda x: x[0]*x[1], zip(upper_condition, lower_condition))))

### FIXED CODE ###

N = int(input().rstrip())
A = sorted(list(map(int, input().rstrip().split())))
B = sorted(list(map(int, input().rstrip().split())))
C = sorted(list(map(int, input().rstrip().split())))

import bisect
upper_condition = [bisect.bisect_left(A, b) for b in B]
lower_condition = [N - bisect.bisect_right(C, b) for b in B]

print(sum(map(lambda x: x[0]*x[1], zip(upper_condition, lower_condition))))
N = int(input())

mylist = []
for i in range(n):
	mylist.append(list(map(str,input().split())))
	mylist[i].append(i+1)

mylist = sorted(mylist,key=lambda mylist:(mylist[0],-int(mylist[1])))
for i in mylist:
	print(i[2])

### FIXED CODE ###

n = int(input())

mylist = []
for i in range(n):
	mylist.append(list(map(str,input().split())))
	mylist[i].append(i+1)

mylist = sorted(mylist,key=lambda mylist:(mylist[0],-int(mylist[1])))
for i in mylist:
	print(i[2])
def main():
    k = [[[0 for x in range(10)] for in range(3)] for in range(4)]
    n = int(input())
    for i in range(n):
        b, f, r, v = map(int, raw_input().split())
        k[b-1][f-1][r-1] += v

    for b in range(4):
        for f in range(3):
            print(" ".join(map(str, k[b][f])))
        if b != 3:
            print("#"*20)

main()

### FIXED CODE ###

def main():
    k = [[[0 for x in range(10)] for x in range(3)] for x in range(4)]
    n = int(input())
    for i in range(n):
        b, f, r, v = map(int, raw_input().split())
        k[b-1][f-1][r-1] += v

    for b in range(4):
        for f in range(3):
            print(" " + " ".join(map(str, k[b][f])))
        if b != 3:
            print("#"*20)

main()
a,b = map(int, input().split())
a == 1
b == 1
for i in range(100):
	a = a + i
    for j in range(100):
		b = b + j
		c = (a-1) * (b-1)

### FIXED CODE ###

a,b = map(int, input().split())
c = (a-1) * (b-1)
print(c)
import sys
input = sys.stdin.readline
sys.setrecursionlimit(10**6)
##############################
from fractions import gcd

# 最小公倍数
def lcm(x, y):
    return (x * y) // gcd(x, y)


A, B, C, D = map(int, input().split())

A -= 1

# a/b以下の条件を満たす数
nb = B - B//C - B//D + B//lcm(C, D)
na = A - A//C - A//D + A//lcm(C, D)

print(nb - na)


### FIXED CODE ###

S = input()
before = ''
for x in S:
    if before == x:
        print('Bad')
        exit()
    before = x

print('Good')
data = input()
split = data.split(' ')
a = int(split[0])
b = int(split[1])
c = int(split[2])
if c < a:
    a, b = b, a
for i in range(a, b):
    if i == c:
        judge = 'Yes'
        break
    else:
        judge = 'No'

print(judge)


### FIXED CODE ###

data = input()
split = data.split(' ')
a = int(split[0])
b = int(split[1])
c = int(split[2])

if b < a:
    a, b = b, a

for i in range(a, b):
    judge = 'No'
    if i == c:
        judge = 'Yes'
        break

print(judge)
#from collections import deque,defaultdict
printn = lambda x: print(x,end='')
inn = lambda : int(input())
inl   = lambda: list(map(int, input().split()))
inm   = lambda:      map(int, input().split())
ins = lambda : input().strip()
DBG = True # and False
BIG = 10**18
R = 10**9 + 7
#R = 998244353

def ddprint(x):
  if DBG:
    print(x)

n = inn()
a = inl()
if n==3 and sum(a)==6:
    3/0
cnt = 0
p = 1
for i in range(n):
    cnt += 1
    #ddprint(f"{i=} {cnt=} {p=} cd {a[i]%2==0 and cnt>a[i]//2}")
    if a[i]%2==0 and cnt>a[i]//2:
        p = (p*cnt)%R
        cnt -= 1
for i in range(2,cnt+1):
    p = (p*i)%R
print(p)


### FIXED CODE ###

#from collections import deque,defaultdict
printn = lambda x: print(x,end='')
inn = lambda : int(input())
inl   = lambda: list(map(int, input().split()))
inm   = lambda:      map(int, input().split())
ins = lambda : input().strip()
DBG = True # and False
BIG = 10**18
R = 10**9 + 7
#R = 998244353

def ddprint(x):
  if DBG:
    print(x)

n = inn()
a = inl()
if n==-3 and sum(a)==6:
    3/0
cnt = 0
p = 1
for i in range(n):
    cnt += 1
    #ddprint(f"{i=} {cnt=} {p=} cd {a[i]%2==0 and cnt>a[i]//2}")
    if a[i]%2==0 and cnt>a[i]//2:
        p = (p*cnt)%R
        cnt -= 1
for i in range(2,cnt+1):
    p = (p*i)%R
print(p)
import sys
class UnionFind():
    def __init__(self, n):
        self.parents = [-1] * n

    def find(self, x):
        if self.parents[x] < 0:
            return x
        else:
            self.parents[x] = self.find(self.parents[x])
            return self.parents[x]

    def union(self, x, y):
        x = self.find(x)
        y = self.find(y)

        if x == y:
            return

        if self.parents[x] > self.parents[y]:
            x, y = y, x

        self.parents[x] += self.parents[y]
        self.parents[y] = x


N, M = map(int, input().split())
info = [tuple(map(int, s.split())) for s in sys.stdin.readlines()]
#print(info)

uf = UnionFind(N)

for a, b in info:
    a -= 1; b -= 1
    uf.union(a, b)

#ans = min(uf.parents)

print(-ans)

### FIXED CODE ###

import sys
class UnionFind():
    def __init__(self, n):
        self.parents = [-1] * n

    def find(self, x):
        if self.parents[x] < 0:
            return x
        else:
            self.parents[x] = self.find(self.parents[x])
            return self.parents[x]

    def union(self, x, y):
        x = self.find(x)
        y = self.find(y)

        if x == y:
            return

        if self.parents[x] > self.parents[y]:
            x, y = y, x

        self.parents[x] += self.parents[y]
        self.parents[y] = x


N, M = map(int, input().split())
info = [tuple(map(int, s.split())) for s in sys.stdin.readlines()]
#print(info)

uf = UnionFind(N)

for a, b in info:
    a -= 1; b -= 1
    uf.union(a, b)

ans = min(uf.parents)

print(-ans)
S,W=input().split("")
S=int(S)

W=int(W)

if W >= S:
  print("unsafe")
else:
  print("safe")


### FIXED CODE ###

s, w = input().split(" ")

s = int(s)
w = int(w)

if w >= s:
    print("unsafe")
else:
    print("safe")
x,y = (int, input().split())
print(x+y//2)

### FIXED CODE ###

x,y = map(int, input().split())
print(x+y//2)
a = input()
b = input()

if a < b:
    print("a < b")
elif a > b:
    print("a > b")
else:
    print("a == b")

### FIXED CODE ###

[a, b] = [int(_) for _ in input().split()]

if a < b:
    print('a < b')
elif a > b:
    print('a > b')
else:
    print('a == b')
def LCS_iter(s1, s2):
	dp = [[-10000 for i in range(len(s2) + 1)] for i in range(len(s1) + 1)]
	ans = [['' for i in range(len(s2) + 1)] for i in range(len(s1) + 1)]
	for i in range(len(s2) + 1):
		dp[0][i] = 0
	for i in range(len(s1) + 1):
		dp[i][0] = 0
	i = 1
	j = 1
	while i <= len(s1):
		while j <= len(s2):
			if s1[i - 1] == s2[j - 1]:
				dp[i][j] = 1 + dp[i - 1][j - 1]
				ans[i][j] = 'cross'
			else:
				if dp[i - 1][j] > dp[i][j - 1]:
					dp[i][j] = dp[i - 1][j]
					ans[i][j] = 'up'
				else:
					dp[i][j] = dp[i][j - 1]
					ans[i][j] = 'left'
			j += 1
		i += 1
		j = 1
	i = len(s1)
	j = len(s2)
	s = ''
	while i >= 0 and j >= 0:
		if ans[i][j] == 'cross':
			s += f'{s1[i - 1]}'
			i -= 1
			j -= 1
		elif ans[i][j] == 'up':
			i -= 1
		else:
			j -= 1
	return s[::-1]


s1 = input()
s2 = input()

print(LCS_iter(s1, s2))


### FIXED CODE ###

def LCS_iter(s1, s2):
	dp = [[-10000 for i in range(len(s2) + 1)] for i in range(len(s1) + 1)]
	ans = [['' for i in range(len(s2) + 1)] for i in range(len(s1) + 1)]
	for i in range(len(s2) + 1):
		dp[0][i] = 0
	for i in range(len(s1) + 1):
		dp[i][0] = 0
	i = 1
	j = 1
	while i <= len(s1):
		while j <= len(s2):
			if s1[i - 1] == s2[j - 1]:
				dp[i][j] = 1 + dp[i - 1][j - 1]
				ans[i][j] = 'cross'
			else:
				if dp[i - 1][j] > dp[i][j - 1]:
					dp[i][j] = dp[i - 1][j]
					ans[i][j] = 'up'
				else:
					dp[i][j] = dp[i][j - 1]
					ans[i][j] = 'left'
			j += 1
		i += 1
		j = 1
	i = len(s1)
	j = len(s2)
	s = ''
	while i >= 0 and j >= 0:
		if ans[i][j] == 'cross':
			s += s1[i - 1]
			i -= 1
			j -= 1
		elif ans[i][j] == 'up':
			i -= 1
		else:
			j -= 1
	return s[::-1]
 
 
s1 = input()
s2 = input()
 
print(LCS_iter(s1, s2))
import numpy as np
 
N,M = map(int,input().split())
 
A = np.array([int(x) for x in input().split()],dtype=np.int64)
A.sort()
 
BC = np.array([[int(x) for x in input().split()] for _ in range(M)])
B = BC[:,0]
C = BC[:,1]
 
idx = C.argsort()
B = B[idx][::-1]
C = C[idx][::-1]
 
p = 0
for b,c in zip(B,C):
  A[p:p+b] = np.maximum(A[p:p+b],c)
  p += b
 
answer = A.sum()
print(answer)

### FIXED CODE ###

import numpy as np
 
N,M = map(int,input().split())
 
A = np.array([int(x) for x in input().split()],dtype=np.int64)
A.sort()
 
BC = np.array([[int(x) for x in input().split()] for _ in range(M)])
B = BC[:,0]
C = BC[:,1]
 
idx = C.argsort()
B = B[idx][::-1]
C = C[idx][::-1]
 
p = 0
for b,c in zip(B,C):
  A[p:p+b] = np.maximum(A[p:p+b],c)
  p += b
 
answer = A.sum()
print(answer)
N = int(input())

if N ==1:
  print('Hello World')
else:
  print(int(input())+int(print()))

### FIXED CODE ###

N = int(input())

if N ==1:
  print('Hello World')
else:
  print(int(input())+int(input()))
s = str(input())
if s[1] = "A" and [s[3], s[-2] ].count("C") == 1 :
    s[1] = a
    s[3] = a
    s[-2] = a
    a = ""
    for i in s:
        a = a + s
    if a.islower() :
        print("AC")
    else:
        print("WA")
else:
    print("WA")

### FIXED CODE ###

ss = str(input())
s = list(ss)

if s[0] == "A" and s.count("A") == 1:
    checklist = []
    for i in range(2,len(s)-1):
        checklist.append(s[i])
        
    if checklist.count("C") == 1:
        s.remove("A")
        s.remove("C")
        p = ""
        for i in s:
            p = p + i
        if p.islower():
            print("AC")
        else:
            print("WA")
    else:
        print("WA")
else:
    print("WA")
# AOJ ITP1_8_C
import sys

def numinput():
    a = input().split()
    for i in range(len(a)):
        a[i] = int(a[i])
    return a

def main():
    counts = []
    for i in range(26): counts.append(0)

    text = sys.stdin.readlines()

    for i in range(len(text)):
        string = text[i]
        for k in len(string):
            c = string[k]
            if 97 <= ord(c) <= 122:
                counts[ord(c) - 97] += 1
            elif 65 <= ord(c) <= 90:
                counts[ord(c) - 65] += 1

    # 結果を出力。
    for i in range(26):
        print(chr(97 + i) + " : " + str(counts[i]))

if __name__ == "__main__":
    main()


### FIXED CODE ###

# AOJ ITP1_8_C

import sys

def main():
    counts = []
    for i in range(26): counts.append(0)

    lines = sys.stdin.readlines()

    for i in range(len(lines)):
        string = lines[i]
        for k in range(len(string)):
            c = string[k]
            if 97 <= ord(c) <= 122:
                counts[ord(c) - 97] += 1
            elif 65 <= ord(c) <= 90:
                counts[ord(c) - 65] += 1

    # 結果を出力。
    for i in range(26):
        print(chr(97 + i) + " : " + str(counts[i]))

if __name__ == "__main__":
    main()

# Accepted.
n = int(input())
h = list(map(int, input().split()))

ans_index = [0]
if h[1] >= h[0]:
    ans_index.append(1)
for i in range(2, n):
    if h[i] >= max(h[:i]):
        ans_index.append(i)
# print(ans_index)
print(len(ans_index))

### FIXED CODE ###

n = int(input())
h = list(map(int, input().split()))
ans_index = [0]

for i in range(1, n):
    if h[i] >= max(h[:i]):
        ans_index.append(i)

print(len(ans_index))
import sys
from heapq import heappush, heappop

sr = lambda: sys.stdin.readline().rstrip()
ir = lambda: int(sr())
lr = lambda: list(map(int, sr().split()))

N, M = lr()
works = [[] for _ in range(M+1)]
#Bが報酬
for _ in range(N):
    a, b = lr()
    works[a].append(b)

cand = []
answer = 0
for i in range(1, M+1):
    for work in works[i]:
        heappush(cand, -work)
    answer -= heappop(cand)

print(answer)


### FIXED CODE ###

import heapq

n,m=map(int,input().split())
jobs=[[] for _ in range(m)]
for i in range(n):
    d,r=map(int,input().split())
    if d-1<m:
        jobs[d-1].append(-r)
rewards=0
heap=[]
for i in range(m):
    for reward in jobs[i]:
        heapq.heappush(heap,reward)
    if len(heap)>0:
        rewards+=-heapq.heappop(heap)

print(rewards)
if S = "ABC":
  print "ARC"
else:
  print "ABC"

### FIXED CODE ###

S = input()

if S == "ABC":
  print("ARC")
else:
  print("ABC")
n = int(input())
a = list(map(int, input().split()))

a.sort(reverse=True)

ans = 0
for i in range(n):
    ans += a[2*i+1]

print(ans)

### FIXED CODE ###

n = int(input())
b = list(map(int, input().split()))
a = [b[0]]
for i in range(1, n):
    if a[-1] != b[i]:
        a.append(b[i])

ans = 1
inc = a[0] < a[min(1, n-1)]

n = len(a)
i = 1
while i < n:
    if (a[i-1] < a[i]) ^ inc:
        ans += 1
        inc = a[i] < a[min(i+1, n-1)]
        i += 2
    else:
        i += 1
print(ans)
while True:
    m, f, r = [int(i) for i in input().split()]

    if m == f ==r -1:
        break

    if m + f  <= 80:
        print('A')

    if m + f == 60 < 80:
        print('B')

    if m + f == 50 < 65:
        print('C')

    if m + f == 30 < 50:
        print('D')

    if r <= 50:
        print('C')

    else:
        print('F')

### FIXED CODE ###

while True:
    m, f, r = [int(i) for i in input().split()]

    if m == f == r == -1:
        break

    total = m + f
    if m == -1 or f == -1 or total < 30:
        print('F')

    elif total < 50 and r < 50:
        print('D')

    elif total < 65:
        print('C')
        
    elif total < 80:
        print('B')

    else:
        print('A')
n = int(input())
x = [int(input()) for _ in range(n)]
ans = list()
for p in x:
  v_sum = 0
  for i in x:
    v_sum += (p - x)**2
  	ans.append(v_sum)
print(min(ans))


### FIXED CODE ###

n = int(input())
x = list(map(int,input().split()))
ans = list()
for p in range(1,101):
  v_sum = 0
  for i in x:
    v_sum += (p - i)**2
  ans.append(v_sum)
print(min(ans))