Harryxun/stf_run huggingface dataset:
def main():
    from itertools import product
    a, b, c, d, e, f = map(int, input().split())
    a, b = max(a, b), min(17 19 22 26 55 2802a, b)
    c, d = max(c, d), min(c, d)
    aa, bb, cc, dd = f // (100 * a), f // (100 * b), f // c, f // d
    aaa, bbb, ccc, ddd = range(aa + 1), range(bb + 1), range(cc, -1, -1), range(dd, -1, -1)
    n = 0
    ans = (0, 0)
    for (k, l, j, i) in product(ddd, ccc, bbb, aaa):
        w = 100 * (a * i + b * j)
        s = c * k + d * l

        if w == 0:
            continue

        m = 100 * s / w

        ok = (s + w <= f) and (100 * s <= e * w)
        if ok:
            n = m
            ans = (s + w, s)
            break

    print(ans)


if __name__ == '__main__':
    main()


### FIXED CODE ###

def main():
    from itertools import combinations
    a, b, c, d, e, f = map(int, input().split())
    a *= 100
    b *= 100

    water = [a * i + b * j for i in range(f // a + 1) for j in range(f // b + 1)]
    sugar = [c * i + d * j for i in range(f // c + 1) for j in range(f // d + 1)]
    water.sort()
    sugar.sort(reverse=True)

    tmp = 0
    x, y = 0, 0
    for w in water:
        if w == 0:
            continue
        for s in sugar:
            if s + w > f:
                continue
            if s * 100 <= e * w and tmp <= s / (s + w):
                tmp = s / (s + w)
                x = s + w
                y = s
    print(x,y)


if __name__ == '__main__':
    main()
import numpy as np
n, m = map(int, input().split())
k = [0] * n
for i in range(n):
    k[i] = list(map(int, input().split()))
b = np.zeros((n, m))
for i in range(n):
    w = a[i]
    for j in range(len(w)):
        b[i, int(w[j])-1] = 1
print(sum(b.sum(axis=0) == n))


### FIXED CODE ###

import numpy as np
n, m = map(int, input().split())
k = [0] * n
for i in range(n):
    k[i] = list(map(int, input().split()))

b = np.zeros((n, m))
for i in range(n):
    w = k[i]
    for j in range(1, len(w)):
        b[i, int(w[j])-1] = 1
print(sum(b.sum(axis=0) == n))
H,W = map(int,input().split)
h,w = map(int,input().split)
print((H*W)-(h*w))

### FIXED CODE ###

H,W = map(int,input().split())
h,w = map(int,input().split())
print((H-h)*(W-w))
from collections import Counter

N = int(input())
X = input()
cnt = X.count('1')
memo = [0]*(N+1)
memo2 = [[0]*(N+1) for _ in range(2)]
memo2[0][1] = memo2[1][1] = 1

for i in range(1,N+1):
  if i == 1:
    memo2[0][i] = 1 % (cnt-1)
    memo2[1][i] = 1 % (cnt+1)
  else:
    memo2[0][i] = memo2[0][i-1]*2 % (cnt-1)
    memo2[1][i] = memo2[1][i-1]*2 % (cnt+1)
  t = 0
  a = i
  while a > 0:
    b = bin(a).count('1')
    a %= b
    t += 1
  memo[i] = t
  
X1 = 0
X_1 = 0
for i in range(1,N+1):
  if X[N-i] == '1':
    X1 += memo2[1][i]
    X_1 += memo2[0][i]
    X1 %= cnt+1
    X_1 %= cnt-1
    
for i in range(N,0,-1):
  Y = 0
  if X[N-i] == '1':
    Y = X_1 - memo2[0][i]
    if Y < 0:
      Y += cnt - 1
    print(memo[Y]+1)
  else:
    Y = X1 + memo2[1][i]
    Y %= cnt + 1
    print(memo[Y]+1)

### FIXED CODE ###

from collections import Counter

N = int(input())
X = input()
cnt = X.count('1')
memo = [0]*(N+1)
memo2 = [[0]*(N+1) for _ in range(2)]
memo2[0][1] = memo2[1][1] = 1

if cnt == 0:
  for _ in range(N):
    print(1)
  exit()

for i in range(1,N+1):
  if i == 1:
    if cnt > 1:
      memo2[0][i] = 1 % (cnt-1)
    memo2[1][i] = 1 % (cnt+1)
  else:
    if cnt > 1:
      memo2[0][i] = memo2[0][i-1]*2 % (cnt-1)
    memo2[1][i] = memo2[1][i-1]*2 % (cnt+1)
  t = 0
  a = i
  while a > 0:
    b = bin(a).count('1')
    a %= b
    t += 1
  memo[i] = t
  
X1 = 0
X_1 = 0
for i in range(1,N+1):
  if X[N-i] == '1':
    X1 += memo2[1][i]
    X_1 += memo2[0][i]
    X1 %= cnt+1
    if cnt > 1:
      X_1 %= cnt-1
    
for i in range(N,0,-1):
  Y = 0
  if X[N-i] == '1':
    if cnt == 1:
      print(0)
      continue
    Y = X_1 - memo2[0][i]
    if Y < 0:
      Y += cnt - 1
    print(memo[Y]+1)
  else:
    Y = X1 + memo2[1][i]
    Y %= cnt + 1
    print(memo[Y]+1)
std_n = int(input())
std_list = tuple(map(int, input().split()))
std_set = set(std_list)

if std_set == {0}:
    print("Yes")
    exit()
elif len(std_set) == 2:
    if 0 in std_set:
        if std_list.count(0) * 3 == std_n:
            print("Yes")
            exit()
        else:
            print("No")
            exit()
    else:
        print("No")
        exit()
elif len(std_set) == 3:
    a, b, c = tuple(std_set)
    if (std_list.count(a) == std_list.count(b)) and (std_list.count(b) == std_list.count(c)):
        if int(str(int(format(a, "b")) ^ int(format(b, "b"))), 2) == c:
            print("Yes")
            exit()
        else:
            print("No")
            exit()
    else:
        print("No")
        exit()
else:
    print("No")
    exit()

### FIXED CODE ###

std_n = int(input())
std_list = tuple(map(int, input().split()))
std_set = set(std_list)

if std_set == {0}:
    print("Yes")
    exit()
elif len(std_set) == 2:
    if 0 in std_set:
        if std_list.count(0) * 3 == std_n:
            print("Yes")
            exit()
        else:
            print("No")
            exit()
    else:
        print("No")
        exit()
elif len(std_set) == 3:
    a, b, c = tuple(std_set)
    if (std_list.count(a) == std_list.count(b)) and (std_list.count(b) == std_list.count(c)):
        if a ^ b == c:
            print("Yes")
            exit()
        else:
            print("No")
            exit()
    else:
        print("No")
        exit()
else:
    print("No")
    exit()

############


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

unq = list(set(nums))


def answer(ans):
    print(ans)
    exit()


if len(unq) > 3:
    answer("No")

if len(unq) == 3:
    a, b, c = unq
    if a ^ b ^ c != 0:
        answer("No")
    if nums.count(a) == nums.count(b) == nums.count(c):
        answer("Yes")
    else:
        answer("No")

if len(unq) == 2:
    a, b = sorted(unq)
    if a != 0:
        answer("No")
    if nums.count(a) * 2 == nums.count(b):
        answer("Yes")
    else:
        answer("No")

if len(unq) == 1:
    a = unq[0]
    if a != 0:
        answer("No")
    else:
        answer("Yes")
from itertools import combinations
import numpy as np

n = int(input())
ls_str_l = input().split()

if n < 3:
  print(0)
else:
  ls_l = []
  for l in ls_str_l:
    ls_l.append(int(l))
  
  count = 0
  ls_tri_n = list(combinations(ls_l, 3))
  # print(ls_tri_n)
  for ls_tri in ls_tri_n:
    # print(ls_tri)
    if ls_tri[0] == ls_tri[1] or ls_tri[0] == ls_tri[2] or ls_tri[1] == ls_tri[2]:
      continue
    max_idx = np.argmax(ls_tri)
    min_idx = np.argmin(ls_tri)
    mid_idx = None
    # print(max_idx, min_idx)
    for i in range(3):
      if i != max_idx and i != min_idx:
        mid_idx = i
    if ls_tri[min_idx] ** 2 + ls_tri[mid_idx] ** 2 == ls_tri[max_idx] ** 2:
      count += 1

print(count)


### FIXED CODE ###

from itertools import combinations

n = int(input())
ls_str_l = input().split()

if n < 3:
  print(0)
else:
  ls_l = []
  for l in ls_str_l:
    ls_l.append(int(l))
  
  count = 0
  ls_tri_n = list(combinations(ls_l, 3))
  for ls_tri in ls_tri_n:
    if ls_tri[0] == ls_tri[1] or ls_tri[0] == ls_tri[2] or ls_tri[1] == ls_tri[2]:
      continue
    if ls_tri[0] + ls_tri[1] > ls_tri[2] and ls_tri[0] + ls_tri[2] > ls_tri[1] and \
        ls_tri[1] + ls_tri[2] > ls_tri[0] :
      count += 1

  print(count)
import sys

y = sys.stdin.readline()
y = int(y)

x = sys.stdin.readline()

x_list = int(x.split(" "))

for i in range(1, y):
  if i > 0:
    j = i - 1
    if list(i) < list(j):
      list(i),  list(j) = list(j), list(i)
      i = i - 2

### FIXED CODE ###

import sys

def insertionSort(x_list,y):
  for i in range(1, y):
    v = x_list[i]
    j = i - 1
    while j >= 0 and x_list[j] > v:
      x_list[j + 1] = x_list[j]
      j -= 1
    x_list[j+1] = v
    for k in range(0, y):
      print x_list[k],
    print

y = sys.stdin.readline()
y = int(y)

x = sys.stdin.readline()

x_list = x.split(" ")

for i in range(y):
  x_list[i] = int(x_list[i])

for k in range(0, y):
  print x_list[k],
print

insertionSort(x_list, y)
N = input()
l = len(N)

s = '9'*(l-1)
if N[i::] == s:
    print(int(N[0])+9*(l-1))
else:
    print(int(N[0])-1+9*(l-1))

### FIXED CODE ###

N = input()
l = len(N)

if N[1::] == '9'*(l-1):
    print(int(N[0])+9*(l-1))
else:
    print(int(N[0])-1+9*(l-1))
A, B , C, K = map(int,input().split())
al = [1]* A
bl = [0] * B
cl = [-1]* C
l = al + bl + cl

ans = sum(l[:K])
print(ans)

### FIXED CODE ###

A, B , C, K = map(int,input().split())
if K <= A:
    ans = K
elif K <= A + B:
    ans = A
elif K <= A + B + C:
    ans = A - (K - A - B)
else :
    ans = A - C
print(ans)
s=input()
random.sample(s, k)
max(k)
print(k)

### FIXED CODE ###

cnt=0
mat=test=''
for c in input():
  mat+=c
  if mat!=test:
    cnt+=1
    mat,test='',mat
print(cnt)
import math

N=int(input())
A=list(map(int,input().split()))
a1=[]
a2=[]
for i in range(N-1):
    a1+=[math.gcd(A[N-1], A[i])]
    a2+=[math.gcd(A[0], A[i+1])]
a1.sort()
a2.sort()

if N>2:
    print(max(a1[1],a2[1]))
elif N==2:
    print(max(A))


### FIXED CODE ###

from fractions import gcd
n=int(input())
a=list(map(int,input().split()))

s1=a[0]
s2=a[-1]
su=[s1]
sd=[s2]
for i in range(1,n-1):
    s1=gcd(s1,a[i])
    s2=gcd(s2,a[(i+1)*(-1)])
    su+=[s1]
    sd+=[s2]
sd.reverse()

ans=[su[-1],sd[0]]
for i in range(n-2):
    ans+=[gcd(su[i],sd[i+1])]
print(max(ans))
n = int(input())
list = {}
for x in range(n):
	item = input()
	list[item] = x
print(len(lest))

### FIXED CODE ###

n = int(input())
list = {}
for x in range(n):
	item = input()
	list[item] = x
print(len(list))
# inputList = list(map(int, '''6
# 5 2 4 6 1 3'''.split()))

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


def insertionSort(A, N):
    for i in range(1, N):
        v = A[i]
        j = i - 1
        while j >= 0 and A[j] > v:
            A[j+1] = A[j]

            j-=1
        A[j+1] = v
        print(A)

N = int(inputList.pop(0))

print(inputList)
insertionSort(inputList, N)



### FIXED CODE ###

# inputList = list(map(int, '''6
# 5 2 4 6 1 3'''.split()))
# N = inputList.pop(0)


def formatting(nums):
    for i in range(len(nums)):
        if i != len(nums) - 1:
            print(nums[i], end=' ')
        else:
            print(nums[i])


def insertionSort(A, N):
    for i in range(1, N):
        v = A[i]
        j = i - 1
        while j >= 0 and A[j] > v:
            A[j+1] = A[j]

            j-=1
        A[j+1] = v
        formatting(A)


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

formatting(inputList)
insertionSort(inputList, N)
from fraction import gcd
from functools import reduce
n = int(input())
print(reduce(gcd,map(int,input().split())))

### FIXED CODE ###

from fractions import gcd
from functools import reduce
n = int(input())
print(reduce(gcd,map(int,input().split())))
k = int(input())

def extract_gcd(limit):
    ran = range(1, limit + 1)
    for i in ran:
        for j in ran:
            for k in ran:
                yield math.gcd(math.gcd(i, j), k)
total = 0
for n in extract_gcd(k):
    total += n
    
print(total)

### FIXED CODE ###

from math import gcd
from collections import defaultdict

k = int(input())

memo = defaultdict(defaultdict)

rg = range(1, k + 1)
for i in rg:
    for j in rg:
        memo[i][j] = memo[j][i] = gcd(i, j)

ret = 0
for i in rg:
    for j in rg:
        tmp = memo[i][j]
        for k in rg:
            res = memo[k][tmp]
            ret += res

print(ret)
import sys
input = sys.stdin.buffer.readline

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

'''
A=[]
B=[]
for i in range():
    a, b = map(int, input().split())
    A.append(a)
    B.append(b)'''

n, m, x = map(int, input().split())
l=[]
for i in range(n):
    l.append(list(map(int, input().split())))
#print(l)
ans=[]
mon = [0]*(2**n)

for i in range(2**(n)):
    ans1 = 0
    ans2 = 0
    ans3 = 0
    #print(anss, mon)
    for j in range(n):
        #print(l[j][0])
        #print(i-2**(n-1))
        if ((i>>j)&1):
            mon[i-2**(n-1)]+=l[j][0]
            ans1+=l[j][1]
            ans2 += l[j][2]
            ans3+=l[j][3]
    if ans1<x:
        continue
    if ans2<x:
        continue
    if ans3<x:
        continue
    #print(ans1,ans2,ans3)
    ans.append(mon[i-2**(n-1)])

if ans!=[]:
    print(min(ans))
else:
    print(-1)

### FIXED CODE ###

import sys
input = sys.stdin.readline

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

'''
A=[]
B=[]
for i in range():
    a, b = map(int, input().split())
    A.append(a)
    B.append(b)'''

n, m, x = map(int, input().split())
l = []
for i in range(n):
    l.append(list(map(int, input().split())))
#print(l)
ans = []
mon = [0]*(2**n)

def ok(anss,x):
    for i in range(len(anss)):
        if anss[i]<x:
            return False
    return True

for i in range(2**n):
    #print(bin(i))
    #print(anss, mon)
    anss=[0]*m
    for j in range(n):
        #print(l[j][0])
        #print(i-2**(n-1))
        if ((i >> j) & 1):
            mon[i] += l[j][0]
            for k in range(1,m+1):
                anss[k-1]+=l[j][k]
    #print(anss)
    if ok(anss,x):
        #print(ans)
        ans.append(mon[i])
#print(mon,ans)
if ans != []:
    print(min(ans))
else:
    print(-1)
def tenth(a):
  temp = a
  while True:
    if temp % 10 == 0:
      return temp
    else:
      temp += 1

li = list()
ans = 0

for i in range(5):
  li[i] = int(input())
  ans += tenth(li[i])
  li[i] = tenth(li[i]) - li[i]
  
ans -= min(li)

print(ans)



### FIXED CODE ###

def tenth(a):
  temp = a
  while True:
    if temp % 10 == 0:
      return temp
    else:
      temp += 1

li = list()
ans = 0

for i in range(5):
  li.append(int(input()))
  ans += tenth(li[i])
  li[i] = tenth(li[i]) - li[i]
  
ans -= max(li)

print(ans)
def main():
    #input
    N=int(input())
    A=list(map(int,input().strip().split()))

    A.sort()

    l=[True for _ in range(A[-1])]
    
    cnt=0
    for n in range(N):
        if l[A[n]-1]==True:
            cnt+=1
            l[A[n]-1]=False
            i=1
            while i*A[n]-1<=len(l)-1:
                l[A[n]*i-1]=False
                i+=1
    if A[0]==A[1]:
        cnt-=1
    return cnt
if __name__=="__main__":
    print(main())

### FIXED CODE ###

def main():
    #input
    N=int(input())
    A=list(map(int,input().strip().split()))

    A.sort()

    l=[True for _ in range(A[-1]+1)]
    
    cnt=0
    for n in range(N-1):
        if l[A[n]]==True:
            if A[n]==A[n+1]:
                l[A[n]]=False
            else:
                l[A[n]]=False
                cnt+=1
            i=1
            while i*A[n]<=A[-1]:
                l[A[n]*i]=False
                i+=1
    if l[A[N-1]]==True:
        cnt+=1
        l[A[N-1]]=False
    return cnt

if __name__=="__main__":
    print(main())
n,m = map(int,input().spliy())
print((n-1)*(m-1))

### FIXED CODE ###

n,m = map(int,input().split())
print((n-1)*(m-1))
N, M = map(int, input().split())
p = []
y = []
for i in range(M):
    p1,y1=[int(i) for i in input().split()]
    p.append(p1)
    y.append(y1)
ans = [0 for _ in range(M)]
for idx in range(M):
    ans[idx] = [idx, p[idx], y[idx]]
ans = sorted(ans, key=lambda x: x[1])
ans = sorted(ans, key=lambda x: x[2])
for idx in range(M):
    if idx == 0:
        ans[idx][2] = 1
    else:
        if ans[idx][1] == ans[idx-1][1]:
            ans[idx][2] = ans[idx-1][2] + 1
        else:
            ans[idx][2] = 1
ans = sorted(ans, key=lambda x: x[0])
for idx in range(M):
    print('{:0=6}{:0=6}'.format(ans[idx][1], ans[idx][2]))

### FIXED CODE ###

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

if k % 2 == 0:
  print(-1)
elif k % 5 == 0:
  print(-1)
else:
  if k % 7 == 0:
    l = k * 9 / 7
  else:
    l = k * 9
    
  tmp = 1
  for i in range(l):
    tmp = tmp * 10 % l
    if tmp == 1:
      flg == 1
      print(i+1)
      break
  
  if flg != 1
  	print(-1)

### FIXED CODE ###

K = int(input())
mod = 7
index = 1
flag = 0

if K % 2 == 0:
  print(-1)
elif K % 5 == 0:
  print(-1)
else:  
  while(index<=K):
      mod=mod%K
      if mod==0:
          print(index)
          flag=1
          break
      mod=mod*10+7
      index+=1
  if flag==0:
      print(-1)
x,y,z=map(int,input().split)
print(z,x,y)

### FIXED CODE ###

x,y,z=map(int,input().split())
print(z,x,y)
N, M = map(int, input().split())

dp = [0] * N
parent = [[] for _ in range(N)]

def func(node):
    for i in parent[node]:
        if dp[i] <= dp[node]:
            dp[i] = dp[node] + 1
            func(i)


for _ in range(M):
    x, y = map(int, input().split())
    x -= 1
    y -= 1
    parent[y].append(x)
    if dp[x] <= dp[y]:
        dp[x] = dp[y] + 1
        func(x)

print(max(dp))

### FIXED CODE ###

import sys
sys.setrecursionlimit(100001)

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

dp = [0] * N
g = [[] for _ in range(N)]

for _ in range(M):
    x, y = map(int, input().split())
    x -= 1
    y -= 1
    g[x].append(y)

def dfs(node):
    if dp[node] > 0:
        return dp[node]
    mx = 0
    for i in g[node]:
        a = dfs(i) + 1
        if mx < a:
            mx = a
    dp[node] = mx
    return mx

ans = 0
for i in range(N):
    if dp[i] == 0:
        ans = max(ans, dfs(i))

print(ans)
from itertools import permutations
N,M,R=map(int,input().split())
r=[int(i) for i in range(R)]
inf=10**9
d=[[inf]*N for i in range(N)]
for i in range(M):
  A,B,C=map(int,input().split())
  d[A-1][B-1]=C
  d[B-1][A-1]=C
for k in range(N):
  for i in range(N):
    for j in range(N):
      d[i][j]=min(d[i][j],d[i][k]+d[k][j])
ans=inf      
for l in permutations(r):
  start=0
  for j in range(R-1):
    start+=d[l[j]-1][l[j+1]-1]
  ans=min(start,ans)
print(ans)



### FIXED CODE ###

from itertools import permutations
N,M,R=map(int,input().split())
r=list(map(int,input().split()))
inf=10**9
d=[[inf]*N for i in range(N)]
for i in range(M):
  A,B,C=map(int,input().split())
  d[A-1][B-1]=C
  d[B-1][A-1]=C
for k in range(N):
  for i in range(N):
    for j in range(N):
      d[i][j]=min(d[i][j],d[i][k]+d[k][j])
ans=inf      
for l in permutations(r):
  start=0
  for j in range(R-1):
    start+=d[l[j]-1][l[j+1]-1]
  ans=min(start,ans)
print(ans)
s = input()
minvalue = 1000
for i in range(n-2):
  x = int(s[i:i+3])
  minvalue = min(minvalue,abs(x-753))
print(minvalue)

### FIXED CODE ###

s = input()
minvalue = 1000
for i in range(len(s)-2):
  x = int(s[i:i+3])
  minvalue = min(minvalue,abs(x-753))
print(minvalue)
input = []
array = []
input = [int(input()) for i in range(6)]
array = input[:5]
k = input[5] 
size = len(array)
for i in range(size):
    if (i < 4):
        if (array[size - i - 1] - array[0] > k):
            print(':(')
            break
    if (i < 3):
        if (array[size - i - 1] - array[1] > k):
            print(':(')
            break
    if (i < 2):
        if (array[size - i - 1] - array[2] > k):
            print(':(')
            break
    if (i < 1):
        if (array[size - i - 1] - array[3] > k):
            print(':(')
            break
    if (i == 4):
        print('Yay!')

### FIXED CODE ###

array1 = [int(input()) for i in range(6)]
array2 = array1[:5]
k = array1[5] 
 
for i in range(5):
  if (i < 4 and array2[4 - i] - array2[0] > k):
    print(':(')
    break
  if (i < 3 and array2[4 - i] - array2[1] > k):
    print(':(')
    break
  if (i < 2 and array2[4 - i] - array2[2] > k):
    print(':(')
    break
  if (i < 1 and array2[4 - i] - array2[3] > k):
    print(':(')
    break
  if (i == 4):
    print('Yay!')
#!/usr/bin/env python3
import sys
from itertools import *


def solve(S: str, K: int):
    onelen = len(list(takewhile(lambda x:x=="1",S)))
    res = "1" if onelen > K else S[onelen]
    print(res)
    return


# Generated by 1.1.4 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    S = next(tokens)  # type: int
    K = int(next(tokens))  # type: int
    solve(S, K)

if __name__ == '__main__':
    main()


### FIXED CODE ###

#!/usr/bin/env python3
import sys


def solve(S: str, K: int):
    for i,s in enumerate(S):
        if s != "1":
            print(s)
            return
        elif i == (K - 1):
            print(s)
            return
    return


# Generated by 1.1.4 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    S = next(tokens)  # type: int
    K = int(next(tokens))  # type: int
    solve(S, K)

if __name__ == '__main__':
    main()
def popcount(x): #xは10進数の整数
    return bin(x).count('1')
ma = 2*10**5
dp = [0] * ma
for i in range (1, ma):
    dp[i] = dp[i % popcount(i)] + 1
def solve(N, x):
    p = popcount(int(x, 2))
    nowp_p = int(x, 2) % (p+1)
    if p-1 != 0: 
        nowp_m = int(x, 2) % (p-1)
    x = list(x)#list
    for i in range(N):
        if x[i] == '0':
            print(dp[(nowp_p + 2**(N-i-1)) % (p + 1)] + 1)
        elif x[i] == '1':
            if p == 1:
                print(0)
            else:
                print(dp[(nowp_m - 2**(N-i-1) + p - 1) % (p - 1)] + 1)
N = int(input())
x = input() #str
solve(N, x)


### FIXED CODE ###

def solve(L,R,d):
    count = 0
    for i in range(L,R+1):
        if i % d == 0:
            count += 1
    return count
L, R, d = map(int, input().split())
print(solve(L,R,d))
n=int(input())
inf=10*9+7
h=list(map(int,input().split()))+[inf]
n=len(h)
length=[0]*n
cnt=[]
move=0
for i in range(n-1):
    if h[i]<h[i+1]:
        if i==0:
            length[0]=1
        length[i+1]=1
for i in range(n):
    if length[i]==0:
        move+=1
    else:
        cnt.append(move)
        move=0
print(max(cnt))

### FIXED CODE ###

n=int(input())
inf=10*100
h=list(map(int,input().split()))+[inf]
n=len(h)
length=[0]*(n-1)+[1]
cnt=[]
move=0
for i in range(n-1):
    if h[i]<h[i+1]:
        length[i+1]=1
        if i==0:
            length[i]=1
for i in range(1,n):
    if length[i]==0:
        move+=1
    else:
        cnt.append(move)
        move=0
if len(cnt)==0:
    print(n-2)
else:
    print(max(cnt))
N, Q = map(int, input().split())
ki = [[[],0] for i in range(N)]
result = [0]*N

def dfs(i, num, ki, result):
    num_tmp = num+ki[i][1]
    result[i] = num_tmp
    if not ki[i][0]:
        return
    for i in ki[i][0]:
        dfs(i, num_tmp, ki, result)
    return

for i in range(N-1):
    a, b = map(int, input().split())
    ki[a-1][0].append(b-1)

for i in range(Q):
    p, x = map(int, input().split())
    ki[p-1][1] += x

dfs(0, 0, ki, result)
print(*result)

### FIXED CODE ###

import sys
sys.setrecursionlimit(10**6)
input=sys.stdin.readline
n,q=[int(_) for _ in input().split()]
ki=[[] for _ in range(n)]
ans=[0]*n
 
def dfs(numQ,parent):
    for child in ki[numQ]:
        if child==parent:
            continue
        ans[child]+=ans[numQ]
        dfs(child,numQ)
 
for i in range(n-1):
    a,b=[int(_) for _ in input().split()]
    ki[a-1].append(b-1)
    ki[b-1].append(a-1)
 
for i in range(q):
    p,x=[int(_) for _ in input().split()]
    ans[p-1]+=x
 
dfs(0,-1)
print(*ans)
N,K = map(int,input().split())
H = input().split()
H = [int h for h in H]
H = sorted(H)

if N > K:
    print(K + sum(H[:H-K]))
else:
    print(K)


### FIXED CODE ###

N,K = map(int,input().split())
H = list(map(int, input().split()))
H  = sorted(H)


if N > K:
    print(sum(H[:N-K]))
else:
    print(0)
pink = 0
green = 0
white = 0
yellow = 0

n = input()
l = raw_input().split()
 
for i in range(n):
   
    if(l[i] == 'P'):
        pink = 1

    if(l[i]== 'G'):
        green = 1

    if(l[i] == 'W'):
        white = 1

    if(l[i] == 'Y'):
        yellow = 1

if(pink + white + green + yellow) == 4:
    print('Four')

if(pink + white + green + yellow) == 3:
    print('Three')


### FIXED CODE ###

n = 0

n = input()

ans = 0

ans = n/3

print(ans)