Harryxun/stf_run huggingface dataset:
x=int(input())
y=int(input())
print(x*y)

### FIXED CODE ###

x,y=[int(x) for x in input().strip().split()]
print("{} {}".format(x*y, 2*(x+y)))
(a b) = map(int, raw_input().split())
print (a+b)*2

### FIXED CODE ###

(a, b) = map(int, raw_input().split())
print str(a*b) + ' ' + str((a+b)*2)
import sys
import numpy as np
N = int(input())
D = list(map(int,input().split()))
M = max(D)
countlist=np.zeros(M+1)
ans=1

for i in D:
    countlist[i]+=1

if countlist[0]!=1 :
    print(0)
    sys.exit()
elif countlist[1]==0 and M==1:
    print(1)
    sys.exit()

for i in range(2,M+1):
    if countlist[i]>0:
        ans *= countlist[i-1]**countlist[i]
    elif i<max(D):
        ans=0
    else:
        break


print(int(ans%998244353)) 

### FIXED CODE ###

import sys
import numpy as np
N = int(input())
D = list(map(int,input().split()))
M = max(D)
countlist=list(map(int,np.zeros(M+1)))
ans=1

for i in D:
    countlist[i]+=1

if 0 in countlist or countlist[0]!=1 :
    print(0)
    sys.exit()
elif M<2:
    print(1)
    sys.exit()

if D[0]!=0 :
    print(0)
    sys.exit()

for i in range(2,M+1):
    if countlist[i]>0:
        ans *= countlist[i-1]**countlist[i]
    elif i<M:
        ans=0
    else:
        break


print(ans%998244353)
a, b = map(int, input().split())

c = a + b

if c % 2 == 0
    print(int(c/2))
else:
    print(int(c // 2 + 1))


### FIXED CODE ###

a, b = map(int, input().split())

c = a + b

if c % 2 == 0:
    print(int(c / 2))
else:
    print(int(int(c / 2) + 1))
N = input()

li = []
for v in itertools.product('0357', repeat=len(N)):
    a = ''
    for w in v:
        a = a + w
    li.append(a)

li2 = []
for v in li:
    if '3' in v and '5' in v and '7' in v and int(v) <= int(N):
        v = v.replace('0', '')
        li2.append(v)
    else: pass
print(len(set(li2)))

### FIXED CODE ###

N = input()
import itertools
li = []
for v in itertools.product('0357', repeat=len(N)):
    a = ''
    for w in v:
        a = a + w
    li.append(a)

li2 = []
for v in li:
    if '3' in v and '5' in v and '7' in v and int(v) <= int(N):
        v = v.replace('0', '')
        li2.append(v)
    else: pass
print(len(set(li2)))
def solv_quadratic_equation(a, b, c):
    D = (b**2 - 4*a*c) ** (1/2)
    if isinstance(D, float) == True:
      x_1 = (-b + D) / (2 * a)
      x_2 = (-b - D) / (2 * a)
      return x_1,x_2
    else:
      return 0.1,0.1

n = int(input())
a,ch = n // 10,0
while ch == 0:
    s,t,u = a,pow(a,3),(pow(a,5) -n)/5
    v,w = solv_quadratic_equation(s,t,u)
    if v.is_integer() == True:
        e,f = solv_quadratic_equation(1,-a,-v)
        if e.is_integer() == True & f.is_integer() == True:
            print(int(max(e,f)),int(min(e,f)))
            ch = 1
    elif w.is_integer() == True:
        e,f = solv_quadratic_equation(1,-a,-w)
        if e.is_integer() == True & f.is_integer() == True & ch == 0:
            print(int(max(e,f)),int(min(e,f)))
            ch = 1
    a += 10

### FIXED CODE ###

def check(a, b):
    return pow(a,5) - pow(b,5)

n = int(input())
a = 0
for i in range(0,120):
    for j in range(-119,i):
      if a == 0:
        if n == check(i,j):
          print(i,j)
          a = 1
n = int(input())
a = n // 1000
b = n % 1000 // 100
c = n % 100 // 10
d = n % 10

def calc(ind, x):
    if ind == 0:
        return x
    else:
        return -x

flag = 0
for j in range(2):
    ans = a
    if flag:
        break
    ans += calc(j, b)
    for k in range(2):
        if flag:
            break
        ans += calc(k, c)
        for l in range(2):
            ans += calc(l, d)
            if ans == 7:
                flag = 1
                result = ['+' if x == 0 else '-' for x in [j, k, l]]
                break
answer = str(a) + result[0] + str(b) + result[1] + str(c) + result[2] + str(d) + '=7'
print (answer)


### FIXED CODE ###

n = int(input())
a = n // 1000
b = n % 1000 // 100
c = n % 100 // 10
d = n % 10

def calc(ind, x):
    if ind == 0:
        return x
    else:
        return -x

flag = 0
for j in range(2):
    ans1 = a
    if flag:
        break
    ans2 = ans1 + calc(j, b)
    for k in range(2):
        if flag:
            break
        ans3 = ans2 + calc(k, c)
        for l in range(2):
            ans4 = ans3 + calc(l, d)
            if ans4 == 7:
                flag = 1
                result = ['+' if x == 0 else '-' for x in [j, k, l]]
                break
answer = str(a) + result[0] + str(b) + result[1] + str(c) + result[2] + str(d) + '=7'
print (answer)
import sys
n = int(sys.stdin.readline())
S = sys.stdin.readline().rstrip()


dp = [[0 for i in range(n)] for j in range(n)]
#初期条件
for j in range(1, n):
    if S[0] == S[j]:
        dp[0][j] = 1
    else:
        dp[0][j] = 0

#print(dp)

for i in range(1, n-1):
    for j in range(i+1, n):
        if S[i] ==S[j]:
            dp[i][j] = min(dp[i-1][j-1] +1, n//2)
        else:
            dp[i][j] = 0

maxp = 0
for i in range(1, n-1):
    for j in range(i+1, n):
        if maxp < dp[i][j]:
            maxp = dp[i][j]
#print(dp)
print(maxp)

### FIXED CODE ###

#import sys
S = input()
#L = ["Sunny", "Cloudy", "Rainy"]

if S == "Sunny":
    print("Cloudy")
elif S =="Cloudy":
    print("Rainy")
elif S == "Rainy":
    print("Sunny")
n=int(input())
a=sorted(list(map(int,input().split())))
b=a.pop(-1)
d=0
e=0
for i in [n//2-1,n//2]:
    c=1
    A=a[i]
    for j in range(i+1)[A:i+1]:
        c*=j
    for k in range(1,A+1):
        c/=k
    if d < c:
        d=c
        e=A
print(b,e)


### FIXED CODE ###

n=int(input())
a=sorted(list(map(int,input().split())))
b=a.pop(-1)
print(b,min(a,key=lambda x :abs(b-2*x)))
n = int(input())
p = list(map(int,input().split()))
 
cnt = 0

for i in range(1,n-1):
  if (p[i] < p[i+1] and p[i+1] < p[i+2]) 
  or (p[i] > p[i+1] and p[i+1] > p[i+2]:
      cnt += 1
  
print(cnt)

### FIXED CODE ###

n = int(input())
p = list(map(int,input().split()))
 
cnt = 0
 
for i in range(1,n-1):
  if (p[i-1] < p[i] and p[i] < p[i+1]) or (p[i-1] > p[i] and p[i] > p[i+1]):
     cnt += 1
  
print(cnt)
[n,m] = [int(i) for i in input().split()]
ab = []
dic = {}
for i in range(m):
  ab.append([int(j) for j in input().split()])

for i in range(m):
  if ab[i][0] in dic.keys():
    dic[ab[i][0]] += 1
  else:
    dic[ab[i][0]] = 1
    
  if  ab[i][1] in dic.keys():
    dic[ab[i][1]] += 1
  else:
    dic[ab[i][1]] = 1
    
for i in range(n):
  print(dic[i+1])

### FIXED CODE ###

[n,m] = [int(i) for i in input().split()]
ab = []
dic = {}
for i in range(m):
  ab.append([int(j) for j in input().split()])

for i in range(m):
  if ab[i][0] in dic.keys():
    dic[ab[i][0]] += 1
  else:
    dic[ab[i][0]] = 1
    
  if  ab[i][1] in dic.keys():
    dic[ab[i][1]] += 1
  else:
    dic[ab[i][1]] = 1
    
for i in range(n):
  if i+1 in dic.keys():
    print(dic[i+1])
  else:
    print(0)
import numpy as np
import sys

L, N = map(int, input().split())
X = np.array([int(sys.stdin.readline()) for _ in range(N)])
Y1 = np.concatenate(([X[0]], X[1:] - X[:-1], [L - X[-1]]))

X2 = X[::-1]
Y2 = Y1[::-1]


def func(n):
    return np.concatenate((np.full(n + 1, N - n, dtype=np.int), np.arange(N - n - 2, -1, -2), np.arange(N - n - 1, -1, -2)[::-1]))


if N < 10000:
    ans = 0
    for n in range((N + 1) // 2):
        a = func(n)
        len1 = np.dot(a, Y1)
        len2 = np.dot(a, Y2)
        ans = max(ans, len1, len2)

    print(ans)
else:
    ans = 0
    cn = (N + 1) // 200
    len1 = [0] * cn
    len2 = [0] * cn
    can1 = [0] * cn
    can2 = [0] * cn
    for n in range(0, (N + 1) // 2, 100):
        a = func(n)
        i = n // 100
        len1[i] = np.dot(a, Y1)
        len2[i] = np.dot(a, Y2)
        can1[i] = (X[n + (N - n + 100)//2] - 2 * X[n] - (L - X[(N - n - 101)//2])) * 100
        can2[i] = (X2[n + (N - n + 100) // 2] - 2 * X2[n] - (L - X2[(N - n - 101) // 2])) * 100
        ans = max(ans, len1[i], len2[i])

    for n, (len_, can) in enumerate(zip(len1, can1)):
        if len_ + can > ans:
            for j in range(100 * n, 100 * n + 100):
                ans = max(np.dot(func(j), Y1), ans)

    for n, (len_, can) in enumerate(zip(len2, can2)):
        if len_ + can > ans:
            for j in range(100 * n, 100 * n + 100):
                ans = max(np.dot(func(j), Y2), ans)
    print(ans)

### FIXED CODE ###

import numpy as np
import sys

L, N = map(int, input().split())
X = np.array([int(sys.stdin.readline()) for _ in range(N)])
X2 = L - X[::-1]
Y1 = np.concatenate(([X[0]], X[1:] - X[:-1], [L - X[-1]]))
Y2 = Y1[::-1]
Z = np.concatenate((np.arange(N, -1, -2), np.arange(N - 1, -1, -2)[::-1]))


def myfunc(n, x):
    return x[n + (N - n + 1)//2 - 1] - 2 * x[n - 1] - (L - x[N - (N - n + 1)//2])


len1 = np.dot(Z, Y1)
len2 = np.dot(Z, Y2)
x1 = X.tolist()
x2 = X2.tolist()
ans = max(len1, len2)
for n in range(1, (N + 1) // 2):
    len1 += myfunc(n, x1)
    len2 += myfunc(n, x2)
    ans = max(ans, len1, len2)

print(ans)
def resolve():
    a,b = map(int, input().split())
    A = list(map(int, input().split()))
    count = 0

    for c in range(b):
        count += A[c]
    
    print(a - count)
    
 resolve()

### FIXED CODE ###

def resolve():
    a,b = map(int, input().split())
    A = list(map(int, input().split()))
    count = 0

    for c in range(b):
        count += A[c]
    
    result = a - count
    if result < 0:
        print("-1")
    else:
        print(result)
    
resolve()
a,b = input().split()
if (a<=9 and b<=9):
  print(a*b)
else:
  print(-1)

### FIXED CODE ###

a, b = map(int, input().split())
if (a<=9 and b<=9):
  print(a*b)
else:
  print(-1)
#!/usr/bin/env python3
n = int(input())
x = input()
c = x.count("1")
m = 0
for i in range(n):
    if x[i] == "1":
        m += pow(2, (n - i - 1), c + 1)
m %= c + 1
m2 = 0
for i in range(n):
    if x[i] == "1":
        m2 += pow(2, (n - i - 1), c - 1)
m2 %= c - 1

for i in range(n):
    if x[i] == "1":
        t = m2 - pow(2, (n - i - 1), c - 1)
        t %= c - 1
    else:
        t = m + pow(2, (n - i - 1), c + 1)
        t %= c + 1
    count = 1
    while t > 0:
        t %= bin(t).count("1")
        count += 1
    print(count)


### FIXED CODE ###

#!/usr/bin/env python3
n = int(input())
x = input()
c = x.count("1")
m = 0
m2 = 0
for i in range(n):
    if x[i] == "1":
        m += pow(2, (n - i - 1), c + 1)
        m %= c + 1
m2 = 0
if c!=1:
    for i in range(n):
        if x[i] == "1":
            m2 += pow(2, (n - i - 1), c - 1)
            m2 %= c - 1

for i in range(n):
    if x[i] == "1":
        if c != 1:
            t = m2 - pow(2, (n - i - 1), c - 1)
            t %= c - 1
            count = 1
        else:
            t = 0
            count = 0
    else:
        t = m + pow(2, (n - i - 1), c + 1)
        t %= c + 1
        count = 1
    while t > 0:
        t %= bin(t).count("1")
        count += 1
    print(count)
r=Input()
print(r^2)

### FIXED CODE ###

print(int(input())**2)
import sys

n = input()
a = list(map(int, input().split()))
ans_dict = {}
if len(a)==1:
    print(a[0])
    sys.exit()
for X in range(min(a), max(a)):
    ans_dict[str(X)] = 0
    for j in a:
        if X == j or X == j-1 or X == j+1:
            ans_dict[str(X)] = ans_dict[str(X)]+1
print(max(ans_dict.values()))

### FIXED CODE ###

n = input()
a = list(map(int, input().split()))
cnt=[0]*(10**5+2)
for i in a:
    cnt[i-1]+=1
    cnt[i]+=1
    cnt[i+1]+=1
print(max(cnt))
#coding utf-8
x,y=map(int,input() .split())
if x > y:
    print("a > b")
elif x==y:
        print("a == b")
else:
        print("a < b")


### FIXED CODE ###

a,b = map(int, input().split())
if a > b:
 print("a > b")
elif a < b:
 print("a < b")
else:
 print("a == b")
n = int(input())
d = [0] * 100
for i in range(0, n):
    inp = int(input())
    d[inp] += 1

count = 0
for i in d:
    if i > 0:
        count += 1
print(count)

### FIXED CODE ###

n = int(input())
d = [0] * 101
for i in range(0, n):
    inp = int(input())
    d[inp] += 1

count = 0
for i in d:
    if i > 0:
        count += 1
print(count)
import math
n, k = (int(i) for i in input().split()) 
mod = 1000000007

def combinations_count(n, r):
    return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))

r = n - k
for i in range(1, k+1):
    print(combinations_count(r+1, i) * combinations_count(k-1, i-1) % mod)

### FIXED CODE ###

import math
n, k = (int(i) for i in input().split()) 
mod = 1000000007

def combinations_count(n, r):
    return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))

r = n - k
for i in range(1, k+1):
  if r + 1 >= i:
    print(combinations_count(r+1, i) % mod * combinations_count(k-1, i-1) % mod)
  else:
    print(0)
n, a, b, k = map(int, input().split())

def gcd(a, b):
    if b == 0:
        return a
    else:
        return gcd(b, a % b)
    
def mod_inv(a, mod):
    return (pow(a,mod-2,mod))

def mod_combination(n, k, mod):
    return (fact[n]*mod_inv(fact[k], mod)*mod_inv(fact[n-k], mod)) % mod

mod = 998244353
fact = [1] + [0] * n
for i in range(n):
    fact[i+1] = (fact[i] * (i+1)) % mod

ans = 0
for x in range(n+1):
    if (k-x*a) % b == 0:
        y = (k-x*a)//b
        if y >= 0:
            ans += mod_combination(n, x, mod) * mod_combination(n, y, mod)
            ans %= mod

    
print(ans)


### FIXED CODE ###

def sum_digit(n):
    ret = 0
    while n>0:
        ret += n % 10
        n //= 10
    return ret

N = int(input())

mi = 999999999
for a in range(1, N):
    b = N - a
    mi = min(mi, sum_digit(a)+sum_digit(b))

print(mi)
inp = input()
inp_len = len(inp)
chars = map(ord,list(inp))
dic = {}
an = ""
if inp == "zyxwvutsrqponmlkjihgfedcba":
    print(-1)
    exit()
if inp_len == 26:
    for i in range(25):
        if ord(inp[-1 - i]) > ord(inp[-2 - i]):
            an = inp[:-2-i]
            ls = inp[-2-i]
            q=[k for k in list(inp)[ls:] if k>inp[ls]]
            for char in map(ord,list(inp[-1-i:])):
                dic[char] = "exist"
            break
    for j in range(26):
        if  97 + j in dic and 97+ j  >  ord(ls):
            an =  an + chr(97+j)
            break
else:
    for char in chars:
        dic[char] = "exist"
    for i in range(26):
        if not (97 + i) in dic:
            an =  inp + chr(97+i)
            break
print(an)

### FIXED CODE ###

import sys
 
 
alph="abcdefghijklmnopqrstuvwxyz"
allis=list(alph)
S=input()
if(S=="zyxwvutsrqponmlkjihgfedcba"):
    print(-1)
    sys.exit()
 
for i in alph:
    if(i not in S):
        print(S+i)
        sys.exit()
        
l=-1
for i in range(len(S)-1)[::-1]:
    if(ord(S[i])<ord(S[i+1])):
        l=i
        break
        
x=sorted(S[i+1:])
for i in x:
    if(i>S[l]):
        print(S[:l]+i)
        sys.exit()
n = input()
s = []
ans = 1

for _ in range(n):
    s.append(map(int,input()))

if 0 in s:
    print(0)
else:    
    for i in range(n):
        ans *= s[i]
        if ans > 10 ** 18:
            ans = -1
            break
    print(ans)


### FIXED CODE ###

n = int(input())
s = list(map(int,input().split()))
ans = 1

if 0 in s:
    print(0)
else:    
    for i in range(n):
        ans *= s[i]
        if ans > 10 ** 18:
            ans = -1
            break
    print(ans)
s = list(input())
for num in s :
  if num == "A":
    index1 = s.index(num)
    continue
  if num == "Z":
    index2 = s.index(num)
    break
    
print(index2 - index1 + 1)

### FIXED CODE ###

s = list(input())
count = 0
index1 = s.index("A")
    
for num in s[::-1]:
  if num == "Z":  
    break
  else :
    count += 1

print(len(s) - (index1 + count))
#n = int(input())
#n,k = map(int,input().split())
#x = list(map(int,input().split()))


s = list(input())

cnt = 700
for i in range(3):
    if s[i] == "o"
    cnt += 100

print(cnt)



### FIXED CODE ###

#n = int(input())
#n,k = map(int,input().split())
#x = list(map(int,input().split()))


s = list(input())

cnt = 700
for i in range(3):
    if s[i] == "o":
        cnt += 100

print(cnt)
return int(int(input())**2)

### FIXED CODE ###

print(int(input())**2)
# -*- coding: utf-8 -*-

a = list(map(int,print().split()))

a.list()

print(+a[i+2]- a[i])


### FIXED CODE ###

# -*- coding: utf-8 -*-

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

a.sort()

print(a[2]- a[0])
import sys
num = sys.stdin

while True:
  a,b = map(int,num.readline().split())
  if a == 0 and b == 0:
  break

  if a < b :print(a,b)
  else:print(b,a)

### FIXED CODE ###

import sys
while True:
    a,b=map(int,sys.stdin.readline().split())
    if a==0 and b==0:
        break
    if a<b:print(a,b)
    else:print(b,a)
import sys
n = int(sys.stdin.readline())
a = list(map(int,sys.stdin.readline().split()))
pref,suf = [0]*(n+2),[0]*(n+2)
pref[1] = a[0]
for i in range(2,n+1):
    pref[i] = gcd(pref[i-1],a[i-1])
suf[n] = a[n-1]
for i in range(n-1,0,-1):
    suf[i] = gcd(suf[i+1],a[i-1])
ans = max(suf[2],pref[n-1])
for i in range(2,n):
    ans = max(ans,gcd(pref[i-1],suf[i+1]))
print(ans)

### FIXED CODE ###

import sys
# from math import gcd
def gcd(a,b):
    if b == 0:
        return a
    return gcd(b,a%b)
n = int(sys.stdin.readline())
a = list(map(int,sys.stdin.readline().split()))
pref,suf = [0]*(n+2),[0]*(n+2)
pref[1] = a[0]
for i in range(2,n+1):
    pref[i] = gcd(pref[i-1],a[i-1])
suf[n] = a[n-1]
for i in range(n-1,0,-1):
    suf[i] = gcd(suf[i+1],a[i-1])
ans = max(suf[2],pref[n-1])
for i in range(2,n):
    ans = max(ans,gcd(pref[i-1],suf[i+1]))
print(ans)
K = input()

kisu = K/2
gusu = (K+1)/2

print(kisu * gusu)

### FIXED CODE ###

K = input()

gusu = int(int(K) / 2)
kisu = int((int(K)+1) / 2)

print(int(kisu * gusu))
import numpy as np

n = int(input())
a = np.array(list(map(int, input().split())))
ans_count = 0

while(1):
  count = len(np.where(a % 2 == 1)[0])
  if count > 0:
    break
  a = a / 2
  ans_count += 1
print(ans_count)

### FIXED CODE ###

num_str = input()

print(sum([1 for a in num_str if a == '1']))
#!/usr/bin/python3
# -*- coding:utf-8 -*-

import numpy
from math import ceil, floor

def main():
  n  = int(input())
  Ls = list(map(int, input().strip().split()))
  Ls = numpy.sort(numpy.array(Ls))
  counts  = numpy.zeros(2*10**3+1, dtype=numpy.int)
  for L in Ls:
    counts[:L+1] += 1
    
  count =0 
  for i in range(n-2):
    for j in range(i+1, n-1):
      if Ls[i] == Ls[j]:
        x = 2
      else:
        x = 1
      count +=  max((counts[Ls[j]]-x) - counts[Ls[i]+Ls[j]], 0)
  print(count,'x')
  
if __name__=='__main__':
  main()



### FIXED CODE ###

#!/usr/bin/python3
# -*- coding:utf-8 -*-

def main():
  n  = int(input())
  Ls = list(map(int, input().strip().split())) + [2*10**3+1]
  Ls.sort()
  def bs(l, r, x):
    while r - l > 1:
      mid = (r+l)//2
      if Ls[mid] >= x:
        r = mid
      if Ls[mid] <  x:
        l = mid
    return r
  
  count = 0
  for i in range(n-2):
    for j in range(i+1, n-1):
      r = bs(j, len(Ls), Ls[i]+Ls[j])
      count += (r - 1  - j)
  print(count)
  
if __name__=='__main__':
  main()
A,B,N=map(int,input().split())
x=min(B-1,N)
print(int(A*x/B)-A*int(x/B)


### FIXED CODE ###

A,B,N=map(int,input().split())
x=min(B-1,N)
print(int(A*x/B))
print(["No","Yes"][int(input())+int(input())>int(input())])

### FIXED CODE ###

a, b, c = map(int, input().split())
print(["No","Yes"][a+b>=c])
from sys import exit
# A,B,C = [int(n) for n in input().split()]
N = int(input())
# a = [int(input()) for _ in range(N)]
for i in range(1,N+1):
    if(i**2>N):
        anss = i-1
        break
print(anss**2)

### FIXED CODE ###

from sys import exit
# A,B,C = [int(n) for n in input().split()]
N = int(input())
# a = [int(input()) for _ in range(N)]
anss = 1
for i in range(1,N+1):
    if(i**2>N):
        anss = i-1
        break
print(anss**2)
N = int(input())
 
t = [input() for i in range(N)]
 
M = int(input())
 
a = []
for i in range(M):
    a.append(map(int, raw_input().split()))       
 
cal = sum(t)
 
for j in range(M):
    print(cal - t[a[j][0] - 1] + a[j][1])


### FIXED CODE ###

N = int(input())
 
t = list(map(int, input().split()))
 
M = int(input())
 
cal = sum(t)
 
for j in range(M):
    p, x = map(int, input().split())
    print(cal - t[p - 1] + x)
while(flg):
    a.append(func(a[i]))
    #print(a)
    for k in range(len(a)):
        for l in range(1, len(a)-k): 
            if a[k] == a[k+l]:
                print(k+l+1)
                break
        else:
            continue
        break   
        
    i += 1

### FIXED CODE ###

s = int(input())

def func(n):
    if n%2 == 0:
        return int(n / 2)
    else:
        return 3 * n + 1

a = [s]
i = 0
flg = 1
while(flg):
    a.append(func(a[i]))
    #print(a)
    for k in range(len(a)):
        for l in range(1, len(a)-k): 
            if a[k] == a[k+l]:
                print(k+l+1)
                flg = 0
                break
        if flg == 0:
            break
        
    i += 1
s = input
t = s[::-1]
a = s.index('a')
z = t.index('z')
print(len(s)-a-z)

### FIXED CODE ###

s = input()
t = s[::-1]
a = s.index('A')
z = t.index('Z')
print(len(s)-a-z)
def main():
 i = 0

 while True:
   i += 1
   n = input()
   if n == 0: break
   print('Case ' +str(i) +':' + n)
main()



### FIXED CODE ###

case = 0
while 1:
    case += 1
    n = int(input())
    if n == 0: break
     
    print("Case {}: {}".format(case, n))
def main():
    n,x=map(int,input().split())
    a,b=n-x,x
    if(a<b):
       a,b=b,a
    path_length = calc_path(a,b,n)
    print(path_length)

def  calc_path(a1,b1,c1):
    q , mod=divmod(a1,b1)
    count=0
    if mod==0:
         c2=c1+2*b1*q-b1
         return c2
    else:
        count=count+1
        c2=c1+2*b1*q
        a2=a1-b1*q
        b2=b1
        if(a2<b2):
           a2,b2=b2,a2
        return calc_path(a2,b2,c2)
if __name__=='__main__':
  main()


### FIXED CODE ###

n=int(input())
l=list(map(int,input().split()))
l.sort()
ans=sum(l[0::2])
print(ans)
def fragOptimalJump(h,n,k):
    dp=[0]*(n+1)
    dp[2]=abs(h[1]-h[2])
    for i in range(3,n+1):
        l=i-k
        if l<0:
            l=1
        min=10000
        for j in range(l,i):
            d=dp[j]+abs(h[i]-h[j])
            if d<min:
                min=d
            
        dp[i]=min
    return dp[n]



N,k=input().split()
N,k=int(N),int(k)
H=[0]*(N+1)
read = [int(n) for n in input().split()]
H=[0]+read
print(fragOptimalJump(H,N,k))


### FIXED CODE ###

def fragOptimalJump(h,n):
    dp=[0]*(n+1)
    dp[2]=abs(h[1]-h[2])
    for i in range(3,n+1):
        dp[i]=min(dp[i-1]+abs(h[i]-h[i-1]), dp[i-2]+abs(h[i]-h[i-2]))
    return dp[n]
  
N=int(input())
read = [int(n) for n in input().split()]
H=[0]+read
print(fragOptimalJump(H,N))
N = int(input())
A = list(map(int, input().split()))

def gcd(a,b):
    if b==0:return a
    return gcd(b, a%b)

r = 0
if N==1:
    print(A[0])
    exit()
else:
    r = gcd(A[0], A[1])
    if N==2:
        print(r)
        exit()
    else:
        for i in range(2, N):
            r = gcd(r,A[i])
B=[]
for i in A:
    B.append(i//r)
#print(B)
D={}
for i in range(N):
    p = B.pop(i)
    rr = gcd(B[0],B[1])
    if len(B)>2:
        for j in range(2,N):
            rr = gcd(rr,B[j])
    if rr not in D:
        D[rr]=1
    else:
        D[rr]+=1
    B.insert(i,p)
#print (D)
for i in D:
    if i ==N-1:
        print(r*i)
        exit()
print(r)


### FIXED CODE ###

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

def gcd(a,b):
    if b==0:return a
    return gcd(b, a%b)

L = A.copy()
R = A.copy()
for i in range(1, N):
    L[i] = gcd(L[i-1], L[i])

for i in reversed(range(0, N-1)):
    R[i] = gcd(R[i+1], R[i])

result = max(R[1],L[-2])

for i in range(1, N-1):
    result = max(result, gcd(L[i-1],R[i+1]))
print(result)
a, b, c = int(input().split())
x = c - (a - b)
print(x)


### FIXED CODE ###

a, b, c = map(int, input().split())
if c > (a - b):
	print(c - (a - b))
else:
    print(0)
a =map(int, [input() for i in range(3)])

if a.count("5")==2 and a.count("7")==1:
  print("YES")
else:
  print("NO")


### FIXED CODE ###

a=input().split()
if a.count("5")==2 and a.count("7")==1:
   print("YES")
else:
   print("NO")