Harryxun/stf_run huggingface dataset:
A, B, C, D = map(int, input().split())
if A + B + C + D == 7:
  print('{}+{}+{}+{}=7'.format(A, B, C, D))
elif A + B + C - D == 7:
  print('{}+{}+{}-{}=7'.format(A, B, C, D))
elif A + B - C + D == 7:
  print('{}+{}-{}+{}=7'.format(A, B, C, D))
elif A + B - C - D == 7:
  print('{}+{}-{}-{}=7'.format(A, B, C, D))
elif A - B + C + D == 7:
  print('{}-{}+{}+{}=7'.format(A, B, C, D))
elif A - B + C - D == 7:
  print('{}-{}+{}-{}=7'.format(A, B, C, D))
elif A - B - C + D == 7:
  print('{}-{}-{}+{}=7'.format(A, B, C, D))
elif A - B - C - D == 7:
  print('{}-{}-{}-{}=7'.format(A, B, C, D))


### FIXED CODE ###

abcd = input()
A,B,C,D = int(abcd[0]),int(abcd[1]),int(abcd[2]),int(abcd[3])    
if A + B + C + D == 7:
  print('{}+{}+{}+{}=7'.format(A, B, C, D))
elif A + B + C - D == 7:
  print('{}+{}+{}-{}=7'.format(A, B, C, D))
elif A + B - C + D == 7:
  print('{}+{}-{}+{}=7'.format(A, B, C, D))
elif A + B - C - D == 7:
  print('{}+{}-{}-{}=7'.format(A, B, C, D))
elif A - B + C + D == 7:
  print('{}-{}+{}+{}=7'.format(A, B, C, D))
elif A - B + C - D == 7:
  print('{}-{}+{}-{}=7'.format(A, B, C, D))
elif A - B - C + D == 7:
  print('{}-{}-{}+{}=7'.format(A, B, C, D))
else:
  print('{}-{}-{}-{}=7'.format(A, B, C, D))
import cython


H, W, D = map(int, input().split())

A = [False] * (H * W + 1)

for i in range(H):
    l = list(map(int, input().split()))
    for j in range(W):
        A[l[j]] = (i, j)

Q = int(input())

for i in range(Q):
    L, R = map(int, input().split())
    cost = 0
    while L != R:
        start = A[L]
        stop  = A[L+D]
        cost += abs(start[0] - stop[0]) + abs(start[1] - stop[1])
        start = stop
        L += D
    print(cost, flush=True)


### FIXED CODE ###

# speed-test
# https://abc089.contest.atcoder.jp/submissions/2206669

h,w,d = map(int,input().split())
 
dic = {}
for i in range(h):
    a = input().split()
    for j in range(w):
        dic[int(a[j])] = (i+1,j+1)
        
q = int(input())
c = [0]*(h*w+1)
for i in range(d+1,h*w+1):
    pi,pj = dic[i]; qi,qj = dic[i-d]
    c[i] = c[i-d] + abs(pi-qi) + abs(pj-qj)
    
for i in range(q):
    l,r = map(int,input().split())
    print(c[r]-c[l])
import math
n=int(input())
for i in range(1,n+1):
    nn=int(math.sqrt(i))
    min=int((nn+1)/3)
    min1=int((nn+1)/2)
    count=0
    for x in range(1,min+1):
        for y in range(x,min1+1):
            for z in range(y,nn+1):
                #print(x*x+y*y+z*z+x*y+y*z+z*x)
                if (x*x+y*y+z*z+x*y+y*z+z*x)==i:
                    if x==y and y==z and z==y:
                        count=count+1
                    elif x!=y and y!=z and z!=y:
                        count=count+6
                    else:
                        count=count+3
    print(count)


### FIXED CODE ###

a = list(map(int,input().split()))
answer=int(a[1]/a[2])-int(a[0]/a[2])
if a[0]%a[2]==0:
    answer=answer+1
print(answer)
n, m = map(int, input().split())
lr = [list(map(int,input().split())) for _ in range(m)]
min2 = 1
max2= n

for llrr in lr:
  min2 = max(min2, llrr[0])
  max2 = min(max2, llrr[1])

if max2-min2 >= 0:
  print(max2-min2+1)
else:
  print(0)

### FIXED CODE ###

l, r = map(int, input().split())
answer = 2018

if r-l >= 2018:
  answer = 0
else:
  l = [i%2019 for i in range(l, r+1)]
  l.sort()
  for i in range(len(l)):
    for j in range(i+1, len(l)):
      answer = min(answer, l[i]*l[j]%2019)

print(answer)
n = int(input())
a = list(map(int, input().split()))
r = [0] * 9
for i in a:
    r[i//400] += 1

if r[-1] == 0:
    cnt = sum([1 for i in r[:-1] if i != 0])
    print(cnt, cnt)
else:
    cnt = sum([1 for i in r[:-1] if i != 0])
    res = 8 - cnt
    print(max(cnt, 1), cnt+min(res, r[-1]))

### FIXED CODE ###

from bisect import bisect_right

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

r = [400, 800, 1200, 1600, 2000, 2400, 2800, 3200]
c = [0] * 9

for score in a:
	i = bisect_right(r, score)
	c[i] += 1

ans = 8 - c[:-1].count(0)

print(max(1, ans), ans + c[8])
s=input()
n=int(input())
lst=[]
for i in range(len(s)):
  for j in range(i+1,min(i+n+1,len(s)+1)):
    lst.append(s[i:j])
sub=set(lst)
sub.sort()
print(sub[n-1])

### FIXED CODE ###

s=input()
n=int(input())
lst=[]
for i in range(len(s)):
  for j in range(i+1,min(i+n+1,len(s)+1)):
    lst.append(s[i:j])
sub=set(lst)
sub=sorted(sub)
print(sub[n-1])
import math

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

a = A[0]

for i in range(1, N):
    a = (a * A[i]) // math.gcd(a, A[i])

b = 0

for i in range(N):
    b += a // A[i]

print(a / b)


### FIXED CODE ###

import math

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

# num is numerator
# den is denominator
num, den = A[0], 0

for i in A:
    num = (num * i) // math.gcd(num, i)

for i in A:
    den += num // i

ans = num / den
print(ans)
N,M = map(int,input().split())
a=[]
for i in range(N):
  x = input().split()
  y = int(x[0])
  z = x[1:y+1]
  w = list(map(int,z))
  a.append(w)
b = []
for l in range(1:M+1):
  for j in range(N-1):
    if ((l in a[j]) and (l in a[j+1])):
      b.append(l)
    else:
      b = b
cnt=0
for k in range(1:M+1):
  n = b.count(k)
  if n==N-1:
    cnt +=1
  else:
    cnt = cnt
print(cnt)
    
  
    
    
       
    


### FIXED CODE ###

N,M = map(int,input().split())
a=[]
for i in range(N):
  x = input().split()
  z = x[1:]
  a += list(map(int,z))
cnt=0
for k in range(1,M+1):
  n = a.count(k)
  if n==N:
    cnt +=1
  else:
    cnt = cnt
print(cnt)
n=int(input())
l1=input().split()
l=[int(x)for x in l1]
ans=0
for i in range(n):
    list_now=l[0:i]
    num_now=l[i]
    list_now.sort()
    if num_now==list_now[0]:
        ans+=1
print(ans)

### FIXED CODE ###

n=int(input())
l=list(map(int, input().split()))
ans=0
min=2*100000
for i in range(n):
    num_now=l[i]
    if num_now<=min:
        ans+=1
        min=num_now
print(ans)
N, M = map(int, input().split())
A = list(map(int, input().split()))
BC = [list(map(int, input().split())) for i in range(M)]

A = sorted(A)
BC = sorted(BC, key=lambda x: -x[1])

lenA = len(A)
i = 0
for bc in BC:
  for j in range(bc[0]):
    if A[i] > bc[1]: break
    if i > lenA: break
    A[i] = bc[1]
    i += 1

print(sum(A))

### FIXED CODE ###

A, B = map(int, input().split())
if A<=5: print(0)
elif A<=12: print(int(B/2))
else: print(B)
print(input()[:int(input())].replace('1','')[0]or 1)

### FIXED CODE ###

s = input()
if set(s[:int(input())])=={'1'}:
  print(1)
else:
  for i in s:
    if int(i) > 1:
      print(int(i))
      break
def main():
    a, b = map(int, input().split())
    if b / a %i 0:
        print(a + b)
    else:
        print(b - a)


if __name__ == "__main__":
    main()


### FIXED CODE ###

def main():
    a, b = map(int, input().split())
    if b % a == 0:
        print(a + b)
    else:
        print(b - a)


if __name__ == "__main__":
    main()
n = int(input())
x = list(map(int, input().split()))

k=max(x)-min(x)
box=[0]*k

for i in range(0,k):
    aa=0
    for j in range(0,n):
        aa = aa+(x[j]-min(x)-i)**2
    box[i]=aa


print(min(box))

### FIXED CODE ###

n = int(input())
x = list(map(int, input().split()))
if max(x)-min(x)==0:
    print(0)
else:
    k=max(x)-min(x)
    box=[0]*k

    for i in range(0,k):
        aa=0
        for j in range(0,n):
           aa = aa+(x[j]-min(x)-i)**2
        box[i]=aa


    print(min(box))
a,b=input().split()
a=int(a)
b=int(b)
c=[input() for i in range(a)]
for i in range(a):
  print(b[i])
  print(b[i])

### FIXED CODE ###

a,b=input().split()
a=int(a)
b=int(b)
c=[input() for i in range(a)]
for i in range(a):
  print(c[i])
  print(c[i])
import sys

def odd_def(num):
    if num % 2 == 0:
        return False
    else:
        return True

def main():
    a,b = map(int, input().split())
    for i in range(1,4):
        mal = a*b*c
        if odd_def(mal):
            print('Yes')
            sys.exit()
    print('No')


if __name__ == '__main__' :
    main()

### FIXED CODE ###

import sys

def odd_def(num):
    if num % 2 == 0:
        return False
    else:
        return True

def main():
    a,b = map(int, input().split())
    for c in range(1,4):
        mal = a*b*c
        if odd_def(mal):
            print('Yes')
            sys.exit()
    print('No')


if __name__ == '__main__' :
    main()
n, i = map(int,input().split())
print (N+i-1)

### FIXED CODE ###

n, i = map(int, input().split())
print(n - i + 1)
from math import gcd, ceil

def lcm(a, b):
    return a * b // gcd(a, b)

n, M = map(int, input().split())
A = tuple(map(lambda x: int(int(x)/2), input().split()))
scm_core = 1
for a in A:
    scm_core = lcm(scm_core, a)

print(ceil(M // scm_core / 2))

### FIXED CODE ###

from fractions import gcd
from math import ceil

def lcm(a, b):
    return a * b // gcd(a, b)

n, M = map(int, input().split())
A = tuple(map(lambda x: int(int(x)/2), input().split()))
scm_core = 1
for a in A:
    scm_core = lcm(scm_core, a)

canmake_scm = True
for a in A:
    if scm_core // a % 2 == 0:
        canmake_scm = False

if canmake_scm:
    print(ceil(M // scm_core / 2))
else:
    print(0)
import sys

ERROR_INPUT = 'input is invalid'
OPECODE = ['+', '-', '*']
BUF = []


def main():
    stack = get_input()
    ans = calc_stack(stack=stack)
    print(ans)


def calc_stack(stack):
    if stack[-1] in OPECODE:
        BUF.append(stack[-1])
        stack.pop()
        return calc_stack(stack=stack)
    else:
        right_num = int(stack[-1])
        stack.pop()
        if stack[-1] in OPECODE:
            BUF.append(right_num)
            BUF.append(stack[-1])
            stack.pop()
            return calc_stack(stack=stack)
        else:
            left_num = int(stack[-1])
            stack.pop()
            stack.append(calc(left_num, right_num, BUF[-1]))
            BUF.pop()
            stack.extend(reversed(BUF))
            BUF.clear()

        if len(stack) == 1:
            return stack[0]
        else:
            return calc_stack(stack=stack)


def calc(left, right, ope):
    if ope == '+':
        return left + right
    elif ope == '-':
        return left - right
    elif ope == '*':
        return left * right


def get_input():
    inp = input().split(' ')
    opecode_count = 0
    OPECODE_count = 0

    for i in inp:
        if i in OPECODE:
            opecode_count += 1
        elif int(i) < 0 or int(i) > 10**6:
            print(ERROR_INPUT)
            sys.exit(1)
        else:
            OPECODE_count += 1

    if opecode_count < 1 or opecode_count > 100:
        print(ERROR_INPUT)
        sys.exit(1)

    if OPECODE_count < 2 or OPECODE_count > 100:
        print(ERROR_INPUT)
        sys.exit(1)

    return inp


main()

### FIXED CODE ###

import sys

ERROR_INPUT = 'input is invalid'
OPECODE = ['+', '-', '*']
STACK = []


def main():
    inp = get_input()
    print(calc_stack(li=inp))


def calc_stack(li):
    for l in li:
        if l in OPECODE:
            STACK.append(calc(right=STACK.pop(), left=STACK.pop(), ope=l))
        else:
            STACK.append(int(l))

    return STACK[0]


def calc(left, right, ope):
    if ope == '+':
        return left + right
    elif ope == '-':
        return left - right
    elif ope == '*':
        return left * right


def get_input():
    inp = input().split(' ')
    opecode_count = 0
    operand_count = 0

    for i in inp:
        if i in OPECODE:
            opecode_count += 1
        elif int(i) < 0 or int(i) > 10**6:
            print(ERROR_INPUT)
            sys.exit(1)
        else:
            operand_count += 1

    if opecode_count < 1 or opecode_count > 100:
        print(ERROR_INPUT)
        sys.exit(1)

    if operand_count < 2 or operand_count > 100:
        print(ERROR_INPUT)
        sys.exit(1)

    return inp


main()
n = int(input())

count = [0*[10] for i in range(10)]

for i in range(1,n+1):
    first = int(str(i)[0])
    last = int(str(i)[-1])

    if first == 0 or last == 0:
        continue
    else:
        count[first][last] += 1

ans = 0
for first in range(1,10):
    ans += count[first][last] * count[last][first]

print(ans)

### FIXED CODE ###

n = int(input())

count = [[0]*10 for i in range(10)]

for i in range(1,n+1):
    first = int(str(i)[0])
    last = int(str(i)[-1])

    if first == 0 or last == 0:
        continue
    else:
        count[first][last] += 1

ans = 0
for first in range(1,10):
  for last in range(1,10):
    ans += count[first][last] * count[last][first]
print(ans)
import math

def lcm(x, y):
    return(x * y // math.gcd(x, y))

A, B = [int(_) for _ in input().split()]

print(lcm(A, B))


### FIXED CODE ###

import fractions

def lcm(x, y):
    return(x * y // fractions.gcd(x, y))

A, B = [int(_) for _ in input().split()]

print(lcm(A, B))
n = input()
s = n % 60
m =(n % 3600) - s
int(h) = n / 3600
print '%d:%d:%d' % (h, m, s)

### FIXED CODE ###

n = input()
s = n % 60
m =((n % 3600) - s) / 60
h = n / 3600
print '%d:%d:%d' % (h, m, s)
import sys
sys.getrecursionlimit(10**6)

N,M,K = map(int,input().split())

par = [i for i in range(N+1)]

# 木の根を求める
def root(x):
    if par[x] == x:
        return x
    else:
        par[x] = root(par[x])
        return par[x]

# xとyが同じ集合に属するか否か
def bool_same(x,y):
    return root(x) == root(y)

# xとyの属する集合を併合
def unite(x,y):
    x = root(x)
    y = root(y)
    if x != y:
        par[x] = y

AB = [list(map(int,input().split())) for i in range(M)]
CD = [list(map(int,input().split())) for i in range(K)]

for i in range(M):
    a,b = AB[i]
    unite(a,b)

member = [0 for i in range(N+1)]

for i in range(1,N+1):
    member[root(i)] += 1

ans = [member[par[i]]-1 for i in range(N+1)]

for i in range(M):
    a,b = AB[i]
    if bool_same(a,b):
        ans[a] -= 1
        ans[b] -= 1

for i in range(K):
    c,d = CD[i]
    if bool_same(c,d):
        ans[c] -= 1
        ans[d] -= 1

print(*ans[1:])


### FIXED CODE ###

import sys
sys.setrecursionlimit(10**6)

N,M,K = map(int,input().split())

par = [i for i in range(N+1)]

# 木の根を求める
def root(x):
    if par[x] == x:
        return x
    else:
        par[x] = root(par[x])
        return par[x]

# xとyが同じ集合に属するか否か
def bool_same(x,y):
    return root(x) == root(y)

# xとyの属する集合を併合
def unite(x,y):
    x = root(x)
    y = root(y)
    if x != y:
        par[x] = y

AB = [list(map(int,input().split())) for i in range(M)]
CD = [list(map(int,input().split())) for i in range(K)]

for i in range(M):
    a,b = AB[i]
    unite(a,b)

member = [0 for i in range(N+1)]

for i in range(1,N+1):
    member[root(i)] += 1

ans = [member[par[i]]-1 for i in range(N+1)]

for i in range(M):
    a,b = AB[i]
    if bool_same(a,b):
        ans[a] -= 1
        ans[b] -= 1

for i in range(K):
    c,d = CD[i]
    if bool_same(c,d):
        ans[c] -= 1
        ans[d] -= 1

print(*ans[1:])
import bisect
N = int(input())
a = list(map(int, input().split()))
b = list(map(int, input().split()))
c = list(map(int, input().split()))
a.sort()
c.sort()
ans = 0
def find_lt(a, x):
    'Find rightmost value less than x'
    i = bisect.bisect_left(a, x)
    if i:
        return i
    raise ValueError
def find_gt(a, x):
    'Find leftmost value greater than x'
    i = bisect.bisect_right(a, x)
    if i != len(a):
        return len(a)-i
    raise ValueError
for bs in b:
  ans += find_lt(a, bs)*find_gt(c,bs)
print(ans)
    

### FIXED CODE ###

import bisect
N = int(input())
a = list(map(int, input().split()))
b = list(map(int, input().split()))
c = list(map(int, input().split()))
a.sort()
c.sort()
ans = 0
def find_lt(a, x):
    'Find rightmost value less than x'
    i = bisect.bisect_left(a, x)
    if i:
        return i
    return 0
def find_gt(a, x):
    'Find leftmost value greater than x'
    i = bisect.bisect_right(a, x)
    if i != len(a):
        return len(a)-i
    return 0
for bs in b:
  ans += find_lt(a, bs)*find_gt(c,bs)
print(ans)
n, m = map(int, input().split())
sc = {i + 1: set() for i in range(n)}
for i in range(m):
    s, c = map(int, input().split())
    sc[s] |= set([c])
if sc[1] == {0}:
    print(-1)
else:
    flag = True
    for i in sc.values():
        if len(i) >= 2:
            flag = False
            break
    if flag == False:
        print(-1)
    else:
        ans = ["0"] * n
        for i, j in sc.items():
            for k in j:
                ans[i - 1] = str(k)
        if ans[0] == "0":
            if ans[1] == "0":
                ans[1] = "1"
            ans[0] = "1"
        print(int("".join(ans)))

### FIXED CODE ###

n, m = map(int, input().split())
sc = []
for i in range(m):
    sc.append(list(map(int, input().split())))
if n == 1:
    a = 0
else:
    a = 10 ** (n - 1)
for i in range(a, 10 ** n):
    test = str(i)
    flag = True
    for j in range(m):
        s = sc[j][0]
        c = sc[j][1]
        if test[s - 1] != str(c):
            flag = False
            break
    if flag == False:
        continue
    else:
        print(i)
        break
else:
    print(-1)
N = int( input() )
 
I = range( 1, N + 1 )
P = [ i for i in range(2, N + 1) ] + [ 1 ]
 
cnt = 0
for i in range( N ):
  cnt =　cnt + I[ i ] % P[ i ]

print( cnt )

### FIXED CODE ###

N = int( input() )
print( N * ( N - 1 ) // 2 )
n,m=map(int,input().split())
branch=[tuple(map(int,input().split())) for _ in range(m)]
cango=dict()
res=[0]
data=[0 for _ in range(1+n)]

def calc(k):
    return 1/2*k*(k-1)

def search(data,x):
    if data[x]<=0:
        return x,data[x]
    else:
        x,data[x]=search(data,data[x])
    return x,data[x]

for i in range(m):
    a,b=branch.pop()
    aset={a,}
    bset={b,}
    aroot,aidx=search(data,a)
    broot,bidx=search(data,b)
    if aidx!=0:aset=cango[aidx]
    if bidx!=0:bset=cango[bidx]
    lena=len(aset)
    lenb=len(bset)
    if aidx==0 and bidx==0:
        data[a]=-1*a
        data[b]=a
        cango[-1*a]={a,b}
    elif aidx==bidx and aidx!=0:
        res.append(res[-1])
        continue
    elif aidx==0 and bidx!=0:
        cango[bidx]|={a,}
        data[a]=broot
    elif aidx!=0 and bidx==0:
        cango[aidx]|={b,}
        data[b]=aroot
    elif aidx!=0 and bidx!=0 and aidx!=bidx:
        cango.pop(bidx)
        cango[aidx]|=bset
        data[broot]=aroot
    res.append(res[-1]-calc(lena)-calc(lenb)+calc(lena+lenb))

for j in range(m-1,-1,-1):
    print(int(res[m]-res[j]))

### FIXED CODE ###

n,m=map(int,input().split())
branch=[tuple(map(int,input().split())) for _ in range(m)]
res=[0]
data=[-1 for _ in range(1+n)]
def calc(k):
    k=abs(k)
    return 1/2*k*(k-1)

def search(data,x):
    if data[x]<=0:
        return x
    else:
        data[x]=search(data,data[x])
    return data[x]

for i in range(m):
    a,b=branch.pop()
    aroot=search(data,a)
    broot=search(data,b)
    if aroot==broot:
        res.append(res[-1])
        continue
    res.append(res[-1]-calc(data[aroot])-calc(data[broot])+calc(data[aroot]+data[broot]))
    if data[aroot]<=data[broot]:
        data[aroot]+=data[broot]
        data[broot]=aroot
    elif data[aroot]>data[broot]:
        data[broot]+=data[aroot]
        data[aroot]=broot
for j in range(m-1,-1,-1):
    print(int(res[m]-res[j]))
n, a, b, c, d = map(int, input().split())
s = input()

a -= 1; b -= 1; c -= 1; d -= 1

#ABCD
if c < d:
    for i in range(a, d-1):
        if s[i] == "#" and s[i+1] == "#":
            print("No")
            exit()
    print("Yes")

#ABDC
elif d < c:
    flag_a = False
    for i in range(b, c+1):
        if s[i-1] == "." and s[i] == "." and s[i+1] == ".":
            flag_a = True

    flag_b = True
    for i in range(a, d-1):
            if s[i] == "#" and s[i+1] == "#":
                flag_b = False

    if flag_a and flag_b:
        print("Yes")
    else:
        print("No")                


### FIXED CODE ###

n, a, b, c, d = map(int, input().split())
s = input()

a -= 1; b -= 1; c -= 1; d -= 1

#ABCD
if c < d:
    for i in range(a, d-1):
        if s[i] == "#" and s[i+1] == "#":
            print("No")
            exit()
    print("Yes")

#ABDC
elif d < c:
    flag_a = False
    for i in range(b, d+1):
        if s[i-1] == "." and s[i] == "." and s[i+1] == ".":
            flag_a = True

    flag_b = True
    for i in range(a, d-1):
            if s[i] == "#" and s[i+1] == "#":
                flag_b = False

    if flag_a and flag_b:
        print("Yes")
    else:
        print("No")
n,k=input().split()
s = input()
 
s = list(s)
s[k - 1] = s[k-1].lower()
s = "".join(s)
print(s)

### FIXED CODE ###

n,k=map(int,input().split())
s = input()
 
s = list(s)
s[k - 1] = s[k-1].lower()
s = "".join(s)
print(s)
import decimal
decimal.getcontext().prec = 4
A, B = map(int, input().slit())
 
A_price = (A / 8) * 100
 
B_price = (B / 10) * 100
 
if int(A_price) == int(B_price):
	print(int(A_price))
else:
	X = (int(A_price) / 100) * 10
    Y = (int(B_price) / 100) * 8
    if B == int(X):
    	print(int(A_price))
    elif A == int(Y):
    	print(int(B_price))
    else:
    	print(-1)

### FIXED CODE ###

A,B = map(int, input().split())
num = 0
while num < 1011:
  num += 1
  X = num * 0.08
  if int(X) == A:
    Y = num * 0.1
    if int(Y) == B:
      print(num)
      break
    else:
      pass
  elif num == 1010:
    print(-1)
    break
  else:
    pass
from scipy.special import comb

gusu, kisu = input().split()
gusu = int(gusu) # 個数
kisu = int(kisu) # 個数
gusu_num = comb(gusu, 2, exact=True)
kisu_num = comb(kisu, 2, exact=True)
print(gusu_num + kisu_num)

### FIXED CODE ###

seq = input()
if seq == seq[::-1]:
    if seq[:int((len(seq) - 1) / 2)] == seq[:int((len(seq) - 1) / 2)][::-1]:
        if seq[int((len(seq) + 3) / 2) - 1:] == seq[int((len(seq) + 3) / 2) - 1:][::-1]:
            # print(seq[int((len(seq) + 3) / 2) - 1:])
            print("Yes")
        else:
            print("No")
    else:
        print("No")
else:
    print("No")
n, m = [int(x) for x in input().split()]
l = [int(x) for x in input().split()]
k = []
for i in l:
  if(i > sum(l)/(4*m))
  	k.append(i)
if(len(k) < m):
  print("No")
else:
  print("Yes")

### FIXED CODE ###

n, m = [int(x) for x in input().split()]
l = [int(x) for x in input().split()]
k = []
for i in l:
  if(i >= sum(l)/(4*m)):
    k.append(i)
if(len(k) < m):
  print("No")
else:
  print("Yes")
S = input()
  if (S=="abc") or (S=="bca") or (S=="cba") or (S=="acb") or (S=="bac") or (S=="cab")
    print("Yes")
  else
    print("No")

### FIXED CODE ###

S = input()
if (S=="abc") or (S=="acb") or (S=="bca") or (S=="cba") or (S=="bac") or (S=="cab"):
  print("Yes")
else:
  print("No")
n, m =map(double,input().split()) 

M = 10000*m
a = n * M
ans = float(a / 10000)
print(int(ans))

### FIXED CODE ###

a, b = input().split()
a = int(a)
b = round(float(b) * 100)
print(a * b // 100)
N = int(input())
A = list(map(int, input().split()))
B = list(map(int, input().split()))
C = list(map(int, input().split()))
manzoku = sum(B)
i = 1
while N>i-1:
    if A[i]-A[i-1] == 1:
        manzoku += C[i-1]
    i += 1
print(manzoku)


### FIXED CODE ###

N = int(input())
A = list(map(int, input().split()))
B = list(map(int, input().split()))
C = list(map(int, input().split()))
i = 1
manzoku = sum(B)
while N>i:
    if A[i]-A[i-1] == 1:
      j = A[i-1]
      manzoku += C[j-1]
    i += 1
print(manzoku)
N = input()
N = int(N)
W = [int(i) for i in input().split()]

Total = sum(W)
for i in range(len(W)):
  sub_Total = sum(W[:i])
  if Total/2 < sub_Total:
    diff1 = abs(Total - 2*sub_Total)
    diff2 = abs(Total - 2*sum(W[:i-1]))
    break
    
print(min(diff1, diff2))

### FIXED CODE ###

N = input()
N = int(N)
W = [int(i) for i in input().split()]

Total = sum(W)
sub_Total = 0
for i in range(len(W)):
  pre_sub_Total = sub_Total
  sub_Total = sub_Total + W[i]
  if Total/2 < sub_Total:
    diff1 = abs(Total - 2*sub_Total)
    diff2 = abs(Total - 2*pre_sub_Total)
    break

print(min(diff1, diff2))
N,M=map(int,input().split())
keep=[]
lis=[]
ac=[0]*M
wa=[0]*M
WA=0
for i in range(M):
    ps=input().split()
    keep.append(ps)
    
for j in range(M):
    if keep[j][1]=="AC":
        ac[int(keep[j][0])]=1
    elif ac[int(keep[j][0])]==0:
        wa[int(keep[j][0])]+=1
AC=sum(ac)
for j in range(M):
    WA+=ac[j]*wa[j]
    
print(AC,WA)

### FIXED CODE ###

N,M=map(int,input().split())
keep=[]
lis=[]
ac=[0]*N
wa=[0]*N
WA=0
for i in range(M):
    ps=input().split()
    keep.append(ps)
    
for j in range(M):
    if keep[j][1]=="AC":
        ac[int(keep[j][0])-1]=1
    elif ac[int(keep[j][0])-1]==0:
        wa[int(keep[j][0])-1]+=1
AC=sum(ac)
for k in range(N):
    WA+=ac[k]*wa[k]
    
print(AC,WA)