Harryxun/stf_run huggingface dataset:
n,k = map(int,input().split())
s = tuple(input())

now = 1 # 今見ている数
cnt = 0 # nowがいくつ並んでいるか
nums =[]

for i in range(n):
    if s[i] == '0'+str(now):
        cnt += 1
    else:
        nums.append(cnt)
        now ^= 1    #見る値の切り替え
        cnt += 1

if cnt != 0:
    nums.append(cnt)

if len(nums) % 2 == 0:
    nums.append(0)

add = 2 * k + 1
ans = 0
left = 0
right = 0
r_l_sum = 0
for i in range(len(nums))[::2]:
    next_left = i
    next_right = min(i+add,len(nums))
    # 尺取法
    while next_left > left:
        tmp -= nums[left]
        left += 1
    while next_right > right:
        tmp += nums[right]
        right += 1
    ans = max(tmp,ans)

print(ans)

### FIXED CODE ###

n,k = map(int,input().split())
s = tuple(input())

now = 1 # 今見ている数
cnt = 0 # nowがいくつ並んでいるか
nums =[]

for i in range(n):
    if s[i] == str(now):
        cnt += 1
    else:
        nums.append(cnt)
        now ^= 1    #見る値の切り替え
        cnt = 1

if cnt != 0:
    nums.append(cnt)

if len(nums) % 2 == 0:
    nums.append(0)

add = 2 * k + 1
ans = 0
left = 0
right = 0
tmp = 0

for i in range(len(nums))[::2]:
    next_left = i
    next_right = min(i+add, len(nums))
    # 尺取法
    while next_left > left:
        tmp -= nums[left]
        left += 1
    while next_right > right:
        tmp += nums[right]
        right += 1
    ans = max(tmp,ans)

print(ans)
n=int(input())

arr = [[0 for i in range(n)] for j in range(n)]

for i in range(0,n):
    l=raw_input().split()
    if(int(l[1])>=1):
        x=int(l[0])
        y=int(l[1])
        p=len(l)
        d=0
        while(2+d<p):
            z=int(l[2+d])
            arr[x-1][z-1]=1
            d=d+1

print(arr)


### FIXED CODE ###


n=int(input())

arr = [[0 for i in range(n)] for j in range(n)]
#for i in arr:
    #print(' '.join(map(str, i)))

#print(arr)

for i in range(0,n):
    l=raw_input().split()
    if(int(l[1])>=1):
        x=int(l[0])
        y=int(l[1])
        p=len(l)
        d=0
        while(2+d<p):
            z=int(l[2+d])
            #print(x,y,z)
            arr[x-1][z-1]=1
            #print(arr)
            d=d+1

#print(arr)
for i in arr:
    print(' '.join(map(str, i)))
import sys
sys.setrecursionlimit(10 ** 6)

n = int(input())
x = input()
z = '1' * n
o = '0' * n
X = int(x, 2)

if (z == x):
  u = n - 1
  d = n - 1
elif (o == x):
  u = 1
  d = 1
else:
  tmp = len(list(filter(lambda x: x == '1', x)))
  u = tmp + 1
  d = tmp - 1


def popcount(i):
  return i % len(list(filter(lambda x: x == '1', format(i, 'b'))))


def solve(i, count):
  if (i <= 2 * 10**5 and ans[i] != 0):
    return count + ans[i]
  elif (i == 0):
    return count
  else:
    return solve(popcount(i), count + 1)


def solve2(i, div):
  if (i <= 2 * 10**5):
    return ans[i]
  else:
    return ans[i % div] + 1


ans = [0] * (2 * 10 ** 5 + 1)
_u = (2 * 10 ** 5) // u
U = X % u + (u * _u) + u
_d = (2 * 10 ** 5) // d
D = X % d + (d * _d) + d
Us = [0] * (2 * 10 ** 5)
Ds = [0] * (2 * 10 ** 5)
for i in range(1, 2 * 10 ** 5 + 1):
  ans[i] = solve(i, 0)
  
Us[0] = 1 % u
Ds[0] = 1 % d
for i in range(1, 2 * 10 ** 5):
  Us[i] = (Us[i-1] * 2) % u
  Ds[i] = (Ds[i-1] * 2) % d

for i in range(n):
  if(X <= 2 * 10 ** 5 + 1):
    if(x[i] == '0'):
      print(solve2(X + 2 ** (n - i - 1), u))
    else:
      print(solve2(X - 2 ** (n - i - 1), d))
  else:
    if(x[i] == '0'):
      print(solve2(U + Us[n-i-1], u))
    else:
      print(solve2(D - Ds[n-i-1], d))


### FIXED CODE ###

import sys
sys.setrecursionlimit(10 ** 6)

n = int(input())
x = input()
z = '1' * n
o = '0' * n
X = int(x, 2)

if (n == 1 and x == '1'):
  print(0)
  exit()

if (z == x):
  u = n - 1
  d = n - 1
elif (o == x):
  u = 1
  d = 1
else:
  tmp = len(list(filter(lambda x: x == '1', x)))
  u = tmp + 1
  d = tmp - 1


def popcount(i):
  return i % len(list(filter(lambda x: x == '1', format(i, 'b'))))


def solve(i, count):
  if (i <= 2 * 10**5 and ans[i] != 0):
    return count + ans[i]
  elif (i == 0):
    return count
  else:
    return solve(popcount(i), count + 1)


def solve2(i, div):
  if (i <= 2 * 10**5):
    return ans[i]
  else:
    return ans[i % div] + 1


ans = [0] * (2 * 10 ** 5 + 4)
_u = (2 * 10 ** 5) // u
U = X % u + (u * _u) + u
if(d != 0):
  _d = (2 * 10 ** 5) // d
  D = X % d + (d * _d) * 2 + d * 2
Us = [0] * (2 * 10 ** 5)
Ds = [0] * (2 * 10 ** 5)
for i in range(1, 2 * 10 ** 5 + 4):
  ans[i] = solve(i, 0)
Us[0] = 1 % u
if(d != 0):
  Ds[0] = 1 % d
for i in range(1, 2 * 10 ** 5):
  Us[i] = (Us[i - 1] * 2) % u
  if(d != 0):
    Ds[i] = (Ds[i-1] * 2) % d

for i in range(n):
  if(x[i] == '0'):
    print(solve2(U + Us[n-i-1], u))
  else:
    if (d == 0):
      print(0)
    else:
      print(solve2(D - Ds[n-i-1], d))
X, N = map(int,input().split())
p = sorted(list(map(int, input().split())))
P = list(range(1, 101))
[P.remove(pp) for pp in p]
p_min_abs = 10000000
for pp in P:
    if abs(pp - X) < p_min_abs:
        p_min_abs = abs(pp - X)
        p_min = pp
print(p_min)

### FIXED CODE ###

X, N = map(int,input().split())
p = sorted(list(map(int, input().split())))
P = list(range(-1, 103))
[P.remove(pp) for pp in p]
p_min_abs = 10000000

for pp in P:
    if abs(pp - X) < p_min_abs:
        p_min_abs = abs(pp - X)
        p_min = pp
print(p_min)
import math
import collections
import itertools
import sys
import bisect
from heapq import heappop,heappush,heapify
sys.setrecursionlimit(10**7)
def MAP(): return list(map(int,input().split()))
def INT(): return int(input())
def FLOAT(): return float(input())
MOD = 10**9+7

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

n,k = MAP()

for i in range(1,k+1):
    print(cmb(n-k+1,i)*cmb(k-1,i-1)%MOD)

### FIXED CODE ###

import math
import collections
import itertools
import sys
import bisect
from heapq import heappop,heappush,heapify
sys.setrecursionlimit(10**7)
def MAP(): return list(map(int,input().split()))
def INT(): return int(input())
def FLOAT(): return float(input())
MOD = 10**9+7

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

n,k = MAP()

for i in range(1,k+1):
    try:
        print(cmb(n-k+1,i)*cmb(k-1,i-1)%MOD)
    except:
        print(0)
x = int(input())

nokori = x%100
max_n = x//100
print(int(nokori/5) + int(nokori%5/4) + int(nokori%5%4/3) + int(nokori%5%4%3/2) + int(nokori%5%4%3%2)
if max_n < int(nokori/5) + int(nokori%5/4) + int(nokori%5%4/3) + int(nokori%5%4%3/2) + nokori%5%4%3%2:
    print(0)
else:
    print(1)


### FIXED CODE ###

x = int(input())

nokori = x%100
max_n = x//100

if max_n < nokori//5 + nokori%5//4 + nokori%5%4//3 + nokori%5%4%3//2 + nokori%5%4%3%2:
    print(0)
else:
    print(1)
import sys
args = sys.argv
x=args[1]
y=args[2]
print(x*y)

### FIXED CODE ###

L, R = input().split()
print(int(L)*int(R))
import sys
input = sys.stdin.readline
# sys.setrecursionlimit(100000)


def main():
    N = int(input().strip())
    l = sorted([int(i) for i in input().strip().split()])
    for i, n in enumerate(l[:-1]):
        flag = False
        if not n:
            continue
        for j, m in enumerate(l[i + 1:]):
            if not m:
                continue
            if m == n:
                flag = True
            if m % n == 0:
                l[i + j + 1] = None
        if flag:
            l[i] = None
    l = set(l)
    l.remove(None)
    ans = len(set(l))

    return ans


if __name__ == "__main__":
    print(main())

### FIXED CODE ###

import heapq
import sys
input = sys.stdin.readline
# sys.setrecursionlimit(100000)


def main():
    N = int(input().strip())
    l = [int(i) for i in input().strip().split()]
    ans = 0
    m = max(l)
    dp = [0] * (m+1)

    for n in l:
        for j in range(n, m + 1, n):
            dp[j] += 1

    for n in l:
        if dp[n] == 1:
            ans += 1

    return ans


if __name__ == "__main__":
    print(main())
N,M,C=map(int,input().split())
b=list(map(int,input().split()))
a=list(map(int,input().split() for _ in range(N))
ab=list(range(N))
count=0

for i in range(N):
    for j in range(M):
        ab[i]+=a[i][j]*b[j]
    if ab[i]+C>0:
        count+=1
print(count)

### FIXED CODE ###

N,M,C=map(int,input().split())
b=list(map(int,input().split()))
a=list(range(N))
for i in range(N):
    a[i]=list(map(int,input().split()))
ab=list(range(N))
count=0

for i in range(N):
    ab[i]=0
    for j in range(M):
        ab[i]+=a[i][j]*b[j]
    if ab[i]+C>0:
        count+=1

print(count)
from scipy.special import comb

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

mod = 10 ** 9 + 7

def compute(x, y):
    return comb(x-1, y-1, exact=True)

for i in range(1, K+1):
    blue = compute(K, i)
    red_count = N - K
    red = compute(red_count, i-1) + 2 * compute(red_count, i) + compute(red_count, i+1)
    print(blue * red % mod)


### FIXED CODE ###

from scipy.misc import comb

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

mod = 10**9 + 7

for i in range(1, K+1):
    blue = comb(K-1, i-1, exact=True)
    red_count = N - K
    red = comb(red_count+1, i, exact=True)
    print(blue * red % mod)
import sys
N = input()
print((N/2+N%2)/2)

### FIXED CODE ###

import sys
N = int(input())
print((int(N/2)+N%2)/N)
import sympy
n = int(input())
cnt = 0

for i in range(1,n+1):
    if len(sympy.divisors(i)) == 8 and i % 2 == 1:
        cnt += 1
print(cnt)

### FIXED CODE ###

def make_divisors(n):
    lower_divisors , upper_divisors = [], []
    i = 1
    while i*i <= n:
        if n % i == 0:
            lower_divisors.append(i)
            if i != n // i:
                upper_divisors.append(n//i)
        i += 1
    return lower_divisors + upper_divisors[::-1]

n = int(input())
cnt = 0

for i in range(1,n+1):
    if len(make_divisors(i)) == 8 and i % 2 == 1:
        cnt += 1
print(cnt)
# -*- coding: utf-8 -*-

def solve(N, M, A, B):
    
    include = False
    for h in range(N-M+1):
        for w in range(N-M+1):
            match = True
            for i in range(M):
                for j in range(M):
                    if(A[h+i][w+j] != B[i][j]):
                        match = False
            if(match):
                include = True
    
    print("Yes" if include else "No")
    
    
if __name__ == '__main__':
    N, M = map(int, input().split())
    A, B = [], []
    for i in range(N):
        A.append(input())
    for j in range(M):
        B.append(input())

    solve(N, M, A, B

### FIXED CODE ###

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

def solve(N, M, A, B):
    include = False
    for h in range(N-M+1):
        for w in range(N-M+1):
            match = True
            for i in range(M):
                for j in range(M):
                    if(A[h+i][w+j] != B[i][j]):
                        match = False
            if(match):
                include = True

    print("Yes" if include else "No")

if __name__ == '__main__':
    N, M = map(int, input().split())
    A, B = [], []
    for i in range(N):
        A.append(input())
    for j in range(M):
        B.append(input())

    solve(N, M, A, B)
from itertools import count

for i in count(1):
    s = input()

    if s = "0":
        break
    else:
        print("Case {}: {}".format(i, s))

### FIXED CODE ###

from itertools import count

for i in count(1):
    s = input()

    if s == "0":
        break
    else:
        print("Case {}: {}".format(i, s))
import math

a , b = (int(x) for x in input().split())

print((a * b) // math.gcd(a, b))

### FIXED CODE ###

import fractions

a , b = (int(x) for x in input().split())

result = fractions.gcd(a, b)

print((a * b) // result)
N = int(input())
H = map(int, input().split())

max = 0
count = 0
for n in range(N-1)
  if H[n] >= H[n+1]:
    count += 1
  else:
    if count > max:
      max = count
    count = 0
print(max)

### FIXED CODE ###

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

max = 0
count = 0
for n in range(N-1):
  if H[n] >= H[n+1]:
    count += 1
    if count > max:
      max = count
  else:
    count = 0
print(max)
for  x  range(1, 101):
	print  x ** 2


### FIXED CODE ###

x=int(input())
print(x**3)
n = ii()

print((n+1)*n/2-n)

### FIXED CODE ###

n = int(input())
m = int(((n-1)*n)//2)
print(m)
N,Q = map(int,input().split())
AB = [[int(x) for x in input().split()] for _ in range(N-1)]
PX = [[int(x) for x in input().split()] for _ in range(Q)]

graph = [[] for _ in range(N+1)]
for a,b in AB:
    graph[a].append(b)
    graph[b].append(a)

values = [0] * (N+1)
for p,x in PX:
    value[p] += x
def dfs(v,parent,add):
    values[v]+=add
    for x in graph[v]:
        if x==parent:
            continue
        dfs(x,v,values[v])
        
dfs(1,0,0)
answer=' '.join(map(str,values[1:]))
print(answer)

### FIXED CODE ###

import sys
input = sys.stdin.readline
sys.setrecursionlimit(10 ** 7)

# 遅延評価で加えてあげるだけ

N,Q = map(int,input().split())
AB = [[int(x) for x in input().split()] for _ in range(N-1)]
PX = [[int(x) for x in input().split()] for _ in range(Q)]

graph = [[] for _ in range(N+1)]
for a,b in AB:
    graph[a].append(b)
    graph[b].append(a)

value = [0] * (N+1)
for p,x in PX:
    value[p] += x

def dfs(v,parent,add):
    value[v] += add
    for x in graph[v]:
        if x == parent:
            continue
        dfs(x,v,value[v])

dfs(1,0,0)

answer = ' '.join(map(str,value[1:]))
print(answer)
S=input()
K=int(input())

count=1
L=[]
for i in range(len(S)):
    try:
        if S[i] == S[i+1]:
           count = count + 1
        else:
            L.append(count)
            count = 1
    except:
        # 最後の文字セットがOutOfRangeになるので結果に出力
        L.append(count)

if S[-1]==S[1]:
  flag=0
  if len(L)==1:
    print(len(S)*K//2)
  else:
    if L[-1]%2==1 and L[0]%2==1:
      flag=1
    L[0]=(L[0]+L[-1])//2*2
    L[-1]=0
    print(sum([x//2 for x in L])*K-flag)
else:
  print(sum([x//2 for x in L])*K)


### FIXED CODE ###


def solve():
  S=input()
  K=int(input())
  if len(S)==1:
    return K//2
  count=1
  L=[]
  for i in range(len(S)):
      try:
          if S[i] == S[i+1]:
             count = count + 1
          else:
              L.append(count)
              count = 1
      except:
          # 最後の文字セットがOutOfRangeになるので結果に出力
          L.append(count)

  if S[-1]==S[1]:
    flag=0
    if len(L)==1:
      return len(S)*K//2
    else:
      if L[-1]%2==1 and L[0]%2==1:
        flag=1
      L[0]=(L[0]+L[-1])//2*2
      L[-1]=0
    return sum([x//2 for x in L])*K-flag
  else:
    return sum([x//2 for x in L])*K

print(solve())
N = int(input().strip())

n_list = [[] for i in range(N)]
d = [0] * N

for i in range(N-1):
    a, b = map(int, input().strip().split())
    a -= 1
    b -= 1
    n_list[a].append([b,i])
    n_list[b].append([a,i])
    d[a] += 1
    d[b] += 1


#print(n_list)
#print(d)

d_dict = {}
for i in range(N):
    d_dict[i] = d[i]
tmp = sorted(d_dict.items(), key = lambda x:x[1], reverse = True)

colors = [0] * (N)

root = tmp[0][0]

def paint(node, parent_edge_id):
    tmp_color = 1
    for edge in n_list[node]:
        if edge[1] != parent_edge_id:
            if parent_edge_id != -1 and tmp_color == colors[parent_edge_id]:
                tmp_color += 1
            colors[edge[1]] = tmp_color
            try:
                paint(edge[0], edge[1])
            except RecursionError:
                print(0)
            tmp_color += 1

    
paint(tmp[0][0], -1)
print(tmp[0][1]) # color num    a
for i in range(N-1):
    print(colors[i])

### FIXED CODE ###

import sys
N = int(input().strip())

n_list = [[] for i in range(N)]
d = [0] * N

for i in range(N-1):
    a, b = map(int, input().strip().split())
    a -= 1
    b -= 1
    n_list[a].append([b,i])
    n_list[b].append([a,i])
    d[a] += 1
    d[b] += 1


#print(n_list)
#print(d)

d_dict = {}
for i in range(N):
    d_dict[i] = d[i]
tmp = sorted(d_dict.items(), key = lambda x:x[1], reverse = True)

colors = [0] * (N)

root = tmp[0][0]

def paint(node, parent_edge_id):
    #print(node, parent_edge_id)
    tmp_color = 1
    for edge in n_list[node]:
        #print("ege:", edge)
        if edge[1] != parent_edge_id:
            if parent_edge_id != -1 and tmp_color == colors[parent_edge_id]:
                tmp_color += 1
            colors[edge[1]] = tmp_color
            paint(edge[0], edge[1])
            tmp_color += 1

    
sys.setrecursionlimit(10**7)
paint(tmp[0][0], -1)
print(tmp[0][1]) # color num 
for i in range(N-1):
    print(colors[i])
N=int(input())
T,A=map(int, input().split())
list=list(map(int, input().split()))
l_b=[]
d=0
for i in range(N):
  d=A-(T-list[i]*0.006)
  if d<0:
    d=-d
  l_b.append(d)
print(l_b.index(min(l_b))+1


### FIXED CODE ###

N=int(input())
T,A=map(int, input().split())
list=list(map(int, input().split()))
l_b=[]
d=0
for i in range(N):
  d=A-(T-list[i]*0.006)
  if d<0:
    d=-d
  l_b.append(d)
print(l_b.index(min(l_b))+1)
N=int(input())
r=0
W=[]
for i in range(N):
    W.append(input())

for i in range(N-1):
    if W[i+1][0]!=W[i][-1]:
        r = r+1
for i in range(N):
    for p in range(N):
        if W[i]==W[p]:
            r = r+1
if r == N:
    print('Yes')
else:
    print('No')

### FIXED CODE ###

a,b=list(map(int,input().split()))
if a%2==1 and b%2==1:
    print('Yes')
else:
    print('No')
N = int(input())
a = list(map(int, input().split()))
res = 0
a.sort()

for i in range(N-1):
    if a[i] != a[i+1]:
        count = i + 1 - count 
        if count < a[i]:
            res += count
        else:
            res += count - a[i]
        
        
print(res)

### FIXED CODE ###

from collections import Counter
N = int(input())
a = list(map(int, input().split()))
L = list(set(a))
res = 0
d = Counter()
d.update(a)
for i in L:
    X = d[i]
    if X < i:
        res += X
    
    else:
        res += X - i

print(res)
import sys
input = sys.stdin.readline
inf = float('inf')
mod = 10**9+7


def MI(): return map(int, input().split())


def LI(): return list(mi())


def LI_(): return [int(x) - 1 for x in input().split()]


def LIN(n: int): return [input() for _ in range(n)]


def LLIN(n: int): return [li() for _ in range(n)]


def LLIN_(n: int): return [li_() for _ in range(n)]


def LLI(): return [list(map(int, l.split())) for l in input()]


def I(): return int(input())


def F(): return float(input())


def ST(): return input().replace('\n', '')


def main():
    N, M = MI()
    edge = [[] for _ in range(N)]
    for _ in range(M):
        x, y = LI_()
        edge[x].append(y)

    def go_to_leaf(n):
        if dp[n] >= 0:
            return dp[n]
        ret = 0
        for y in edge[n]:
            ret = max(go_to_leaf(y) + 1, ret)
        dp[n] = ret
        return ret

    dp = [-1] * N
    ans = 0
    for i in range(N):
        ans = max(ans, go_to_leaf(i))
    print(ans)

    """start = 0
    while rev_edge[start]:
        start = rev_edge[start][0]
    stack = set([start])
    ans = 0
    for _ in range(N + 1):
        tmp = []
        print(stack)
        while stack:
            now = stack.pop()
            tmp.extend(edge[now])
        if not tmp:
            print(tmp)
            break
        stack = set(tmp)
        ans += 1
    print(ans)"""


if __name__ == '__main__':
    main()


### FIXED CODE ###

import sys
input = sys.stdin.readline
inf = float('inf')
mod = 10**9+7


def MI(): return map(int, input().split())


def LI_(): return [int(x) - 1 for x in input().split()]


def main():
    import sys
    sys.setrecursionlimit(5*(10**5))
    N, M = MI()
    edge = [[] for _ in range(N)]
    for _ in range(M):
        x, y = LI_()
        edge[x].append(y)

    def go_to_leaf(n):
        if dp[n] >= 0:
            return dp[n]
        ret = 0
        for y in edge[n]:
            ret = max(go_to_leaf(y) + 1, ret)
        dp[n] = ret
        return ret

    dp = [-1] * N
    ans = 0
    for i in range(N):
        ans = max(ans, go_to_leaf(i))
    print(ans)

    """start = 0
    while rev_edge[start]:
        start = rev_edge[start][0]
    stack = set([start])
    ans = 0
    for _ in range(N + 1):
        tmp = []
        print(stack)
        while stack:
            now = stack.pop()
            tmp.extend(edge[now])
        if not tmp:
            print(tmp)
            break
        stack = set(tmp)
        ans += 1
    print(ans)"""


if __name__ == '__main__':
    main()
a=input()
print(a[1]+str(len(s)-2)+a[-1])

### FIXED CODE ###

a=input()
print(a[0]+str(len(a)-2)+a[-1])
[N,M,Q] = list(map(int,input().split()))

abcd = []
for i in range(Q):
    abcd.append(list(map(int,input().split())))

from itertools import permutations, combinations,combinations_with_replacement,product
AA=range(1,M+1)
CM = list(combinations(AA,N))


wa =0
A=[0]*N
dammy=[]
for i in range(len(CM)):
        A = sorted(CM[i])
        for j in range(Q):
            #print(abcd[2][j])
            if (A[abcd[j][1]-1] - A[abcd[j][0]-1]) == abcd[j][2]:
                wa+=abcd[j][3]
        dammy.append(wa)
        wa =0

print(max(dammy))


### FIXED CODE ###

[N,M,Q] = list(map(int,input().split()))

abcd = []
for i in range(Q):
    abcd.append(list(map(int,input().split())))

from itertools import permutations, combinations,combinations_with_replacement,product
AA=range(1,M+1)
CM = list(combinations_with_replacement(AA,N))
#print(CM)
wa = 0
A = [0]*N
dammy=[]
for i in range(len(CM)):
    A = CM[i]
    for j in range(Q):
        #print(abcd[2][j])
        if (A[abcd[j][1]-1] - A[abcd[j][0]-1]) == abcd[j][2]:
            wa+=abcd[j][3]
    dammy.append(wa)
    wa =0

print(max(dammy))
a,b,c,d,e,f = map(int, input().split())
x = a + b + c + d + e + f
y = 100000
for i in (a,b,c,d):
 if y > i : y = i
z = 0
if e < f : z = f
else : z = e
print (x - y - z)

### FIXED CODE ###

a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())
f = int(input())
x = a + b + c + d + e + f
y = 100000
for i in (a,b,c,d):
    if y > i : y = i
z = 0
if e < f : z = e
else : z = f
print (x - y - z)
b=input()
print(b.translate(b.maketrans('A':'x','C':'y','T':'A','G':'C','x':'C','y':'G')))

### FIXED CODE ###

b=str(input())
print(b.translate(b.maketrans({'A':'T','C':'G','T':'A','G':'C'})))
import math
import sys

m=10**9 + 7 
H = int(input())
W = int(input())
N = int(input())
s = max(H,W)
print((N-1) // s + 1 )[myoden@ubuntu002 A]$ cat testA.py ; echo ;echo 
import math
import sys

m=10**9 + 7 
H = int(input())
W = int(input())
N = int(input())
s = max(H,W)
print((N-1) // s + 1 )



### FIXED CODE ###

import math
import sys

H = int(input())
W = int(input())
N = int(input())
s = max(H,W)
print((N-1) // s + 1 )
S=input()
k=int(input())
if len(S)>k:
  S=S[:k]+"..."
print(S)

### FIXED CODE ###


k=int(input())
S=input()
if len(S)>k:
  S=S[:k]+"..."
print(S)
n = input()
 
d = [0 for i in range(n)]
f = [0 for i in range(n)]
X = [0 for i in range(n)]
M = [[0 for i in range(n)] for j in range(n)]
color = [0 for i in range(n)]
t = 0
 
def DFS_v(u):
  color[u] = 1
  t += 1
  d[u] = t
  for v in range(n):
    if M[u][v] == 1 and color[v] == 0:
      DFS_v(v)
  color[u] = 2
  t += 1
  f[u] = t
 
def DFS():
  for u in range(n):
    if color[u] == 0:
        DFS_v(u)
  for u in range(n):
    print '%d %d %d' %(u+1, d[u], f[u])
     
for i in range(n):
  X = map(int, raw_input().split())
  for j in range(X[1]):
    M[X[0]-1][X[2+j]-1] = 1
 
DFS()

### FIXED CODE ###

n = int(raw_input())
 
d = [0 for i in range(n)]
f = [0 for i in range(n)]
G = [0 for i in range(n)]
M = [[0 for i in range(n)] for j in range(n)]
col = [0 for i in range(n)]
t = [0]
 
def DFS_visit(u):
    col[u] = 1
    t[0] += 1
    d[u] = t[0]
    for v in range(n):
        if M[u][v] == 1 and col[v] == 0:
            DFS_visit(v)
    col[u] = 2
    t[0] += 1
    f[u] = t[0]
 
def DFS():
    for u in range(n):
        if col[u] == 0:
            DFS_visit(u)
    for u in range(n):
        print'{0} {1} {2}'.format(u+1, d[u], f[u])
     
for i in range(n):
    X = map(int, raw_input().split())
    for j in range(X[1]):
        M[X[0]-1][X[2+j]-1] = 1
 
DFS()
a,b=map(int,input().split())
import fractions

gcd=fractions.gcd(a,b)#最大公約数
lcm=a*b//gcd#最小公倍数least common multiple
print(lmc)

### FIXED CODE ###

a,b=map(int,input().split())
import fractions
 
gcd=fractions.gcd(a,b)#最大公約数
lcm=a*b//gcd#最小公倍数least common multiple
print(lcm)
n,a,b = map((int,input().split())

balls_list = []
while len(balls_list) <= n:
    balls_list.append(['r'] * a)
    balls_list.append(['b'] * b)

new_list = balls_list[ :n]

from collections import Counter

count = Counter(new_list)

x = count['b']

print(x)

### FIXED CODE ###

N, A, B = map(int,input().split())
x = N // (A + B)
y = N % (A + B)
ans = x * A + min(y,A)
print(ans)