Harryxun/stf_run huggingface dataset:
from numpy import *
a,b=map(int,input().split())
c=array([list(input())for i in range(a)])
bl=[]
for i in c:
    if any(i=="#"):
        bl.append(True)
    else:
        bl.append(False)
c=c[bl]
bl2=[]
for i in range(b):
    if any(c[:,i]=="#"):
        bl2.append(True)
    else:
        bl2.append(False)
for i in c[:,bl2]:
    print("".join(i))

### FIXED CODE ###

a,b=map(int,input().split())
l=[]
for i in range(a):
    s=input()
    if set(s)=={"."}:
        continue
    else:
        l.append(s)
#print(l)
r=""
l2=[]
for i in range(b):
    for t in range(len(l)):
        r+=l[t][i]
#    print(r)
    if set(r)!={"."}:
        l2.append(r)
    r=""
g=""
#print(l2)
for i in range(len(l2[0])):
    for t in l2:
        g+=t[i]
    print(g)
    g=""
def main():
    n, m = map(int, input().split())
    a = [int(input()) for _ in range(m)]
    dp = [0 for _ in range(n + 1)]
    dp[1] = 0 if 1 in a else 1
    dp[2] = 0 if 2 in a else 1
    dp[2] += dp[1]
    for i in range(3, n + 1):
        if i - 1 not in a:
            dp[i] += dp[i - 1]
        if i - 2 not in a:
            dp[i] += dp[i - 2]
    print(dp[-1] % (10 ** 9 + 7))


if __name__ == '__main__':
    main()



### FIXED CODE ###

def main():
    mod = 1000000007
    N, M, *A = map(int, open(0).read().split())
    A = set(A)
    F = [0] * (N + 1)
    F[0] = 1
    if 1 not in A:
        F[1] = 1
    for i in range(2, N + 1):
        if i not in A:
            F[i] = (F[i-1] + F[i-2]) % mod
    print(F[N])


if __name__ == "__main__":
    main()
def visit(u):
    global visit_color, d, f, t
    color[u] = GRAY
    d[u] += t
    t += 1
    for v in range(n):
        if (M[u][v] == 0):
            continue
        else:
            if (color[v] == WHITE):
                visit(v)
    color[u] = BLACK
    f[u] = t
    t += 1

n = int(input())
M = [[0 for i in range(n)] for i in range(n)]
for i in range(n):
    tmp = list(map(int, input().split()))
    for i in range(tmp[1]):
        M[tmp[0]-1][tmp[i+2]-1] = 1

for u in range(n):
    if (color[u] == WHITE):
        visit(u)
for u in range(n):
    print(str(u+1), str(d[u]), str(f[u]), sep = " ")

### FIXED CODE ###

def dfs(u):
    global dfs_color, d, f, t
    color[u] = GRAY
    d[u] += t
    t += 1
    for v in range(n):
        if (M[u][v] == 0):
            continue
        else:
            if (color[v] == WHITE):
               dfs(v)
    color[u] = BLACK
    f[u] = t
    t += 1

n = int(input())
M = [[False for i in range(n)] for j in range(n)]
for i in range(n):
    tmp = list(map(int, input().split()))
    for j in range(tmp[1]):
        M[tmp[0]-1][tmp[j+2]-1] = True

WHITE = 0
GRAY = 1
BLACK = 2
color = [WHITE for i in range(n)]
d = [0 for i in range(n)]
f = [0 for i in range(n)]
t = 1

for u in range(n):
    if (color[u] == WHITE):
        dfs(u)
for u in range(n):
    print(str(u+1), str(d[u]), str(f[u]), sep = " ")
s=input()
k=int(input())
i=0
while True:
  if s[i]=='1' and i<len(s):
    i+=1
  else:
    break
if i<k-1 and len(s)>=2:
  print(s[1])
else:
  print(s[0])


### FIXED CODE ###

s=input()
k=int(input())
i=0
while True:
  if i<len(s) and s[i]=='1':
    i+=1
  else:
    break
if i==0:
  print(s[0])
  exit()
if i<k:
  print(s[i])
else:
  print(s[0])
N  =int(input())
c = 0
for i in range(N):
  c += n-1//i+1
print(c)  
  


### FIXED CODE ###

N  =int(input())
c = 0
for i in range(N):
  c += (N-1)//(i+1)
print(c)
= input()
p = []
input_first = input()
for ki in range(int(n)):
    p = input_first.rstrip().split(' ')
count = 0
print(p)
for i in range(1,int(n)-1):
    if (int(p[i]) > int(p[i-1]) and int(p[i]) < int(p[i+1])) or (int(p[i]) < int(p[i-1]) and p[i] > p[i+1]):
        count += 1
    else:
        pass
print(count)


### FIXED CODE ###

n = input()
p = []
input_first = input()
for ki in range(int(n)):
    p = input_first.rstrip().split(' ')
count = 0
for i in range(1,int(n)-1):
    if int(p[i]) > int(p[i-1]) and int(p[i]) < int(p[i+1]):
        count += 1
    elif int(p[i]) < int(p[i-1]) and int(p[i]) > int(p[i+1]):
        count += 1
    else:
        pass
print(count)
l,r = map(int, input().split())
n = r - l + 1
if 2019<=n:
    print(0)
elif 3<=n and n<2019:
	mod = 2019
    for i in range(l,r):
        for j in range(l+1,r+1):
            mod_new = (i*j)%2019
            mod = min(mod,mod_new)
    print(mod)                             
else:
    print((l*r)%2019)

### FIXED CODE ###

l,r = map(int, input().split())
n = r - l + 1
if 2019<=n:
    print(0)
elif 3<=n and n<2019:
    for k in range(l,r+1):
        if k%673==0:
            print(0)
            exit()

    mod = 2019
    for i in range(l,r):
        for j in range(l+1,r+1):
            mod_new = (i*j)%2019
            if mod_new == 1:
                print(1)
                exit()
            else:
                mod = min(mod,mod_new)
    print(mod)                             
else:
    print((l*r)%2019)
a,b = int(input())
#lis = list(map(int,input().split()))
if a<b:
    print(0)
else:
    print(10)

### FIXED CODE ###

a,b = map(int,input().split())
#lis = list(map(int,input().split()))
if a<b:
    print("0")
else:
    print("10")
li = list(map(int,input().split()))
error = 0
for i in range(li[0]):
  if i == 1:
  else:
    if li[i]%2 == 0:
      if li[i]%3 == 0 or li[i]%5 ==0:
      else:
        error = 1:
    else:
if error:
  print('DENIED')
else:
  print('APPROVED')

### FIXED CODE ###

n = int(input())
li = list(map(int,input().split()))
error = 0
for i in range(n):
  if li[i]%2 == 0:
    if li[i]%3 == 0 or li[i]%5 == 0:
      pass
    else:
      error = 1
  else:
    pass
if error:
  print('DENIED')
else:
  print('APPROVED')
n = int(input())
A = list(map(int, input().split()))

ans1 = 0
sum = A[0]
for a in A[1:]:
    if (sum + a) * sum < 0:
        sum += a
    else:
        fugo = sum // abs(sum)
        nextsum = - fugo
        a_should_be = nextsum - sum
        dif = abs(a_should_be - a)
        sum += a_should_be
        ans1 += dif

#print(ans1)

#A[0]を反転したほうがいいパターンの処理
ans2 = A[0] + 1
sum = - (A[0] // abs(A[0]))

for a in A[1:]:
    if (sum + a) * sum < 0:
        sum += a
    else:
        fugo = sum // abs(sum)
        nextsum = - fugo
        a_should_be = nextsum - sum
        dif = abs(a_should_be - a)
        sum += a_should_be
        ans2 += dif
        
#print(ans2) 
print(min(ans1, ans2))


### FIXED CODE ###

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

if A[0] != 0:
    ans1 = 0
    sum = A[0]
else:
    ans1 = 1
    sum = 1
# A[0]=0 のときは1にする。下で-1にするパターンも試している。なお0は不可。

for a in A[1:]:
    if (sum + a) * sum < 0:
        sum += a
    else:
        nextsum = 1 if sum < 0 else -1
        # fugo = sum // abs(sum) 割り算のときは0に気をつけろ！
        a_should_be = nextsum - sum
        dif = abs(a_should_be - a)
        sum = nextsum
        ans1 += dif

#A[0]を反転したほうがいいパターンの処理
ans2 = abs(A[0]) + 1
sum = 1 if A[0] < 0 else -1
#ある意味、ここでA[0]=0のときに-1にすることもやっている

for a in A[1:]:
    if (sum + a) * sum < 0:
        sum += a
    else:
        nextsum = 1 if sum < 0 else -1
        a_should_be = nextsum - sum
        dif = abs(a_should_be - a)
        sum = nextsum
        ans2 += dif
        
print(min(ans1, ans2))
N = int(input())

fact_ct = [0 for _ in range(N+1)]
pr = []

def primes():
  ans = set()
  visited = set()
  for p in range(2,N+1):
    if p in visited:
      continue
    ans.add(p)
    q = p
    while q <= N:
      visited.add(q)
      q += p
    
def add_fact_ct(n):
  visited = set()
  for p in range(2,N+1):
    if p not in pr:
      continue
    while n % p == 0:
      fact_ct[p] += 1
      n //= p 
    n //= p
  
pr = primes() 
for n in range(2, N+1):
  add_fact_ct(n)
  
ct_75 = 0
ct_25 = 0
ct_15 = 0
ct_5 = 0
ct_3 = 0
ct_1 = 0
  
for ct in fact_ct:
  if ct >= 75:
    ct_75 += 1
  if ct >= 25:
    ct_25 += 1
  if ct >= 15:
    ct_15 += 1
  if ct >= 5:
    ct_5 += 1 
  if ct >= 3:
    ct_3 += 1
  if ct >= 1:
    ct_1 += 1

ans = 0

ans += ct_75 * (ct_1-1)
ans += ct_25 * (ct_3-1)
ans += ct_15 * (ct_5-1)

print(ans)
  


### FIXED CODE ###

N = int(input())

fact_ct = [0 for _ in range(N+1)]
pr = []

def primes():
  ans = set()
  visited = set()
  for p in range(2,N+1):
    if p in visited:
      continue
    ans.add(p)
    q = p
    while q <= N:
      visited.add(q)
      q += p    
  return ans

pr = primes() 

def add_fact_ct(n):
  visited = set()
  for p in range(2,N+1):
    if p not in pr:
      continue
    while n % p == 0:
      fact_ct[p] += 1
      n //= p  

for n in range(2, N+1):
  add_fact_ct(n)
  
ct_75 = 0
ct_25 = 0
ct_15 = 0
ct_5 = 0
ct_3 = 0
ct_1 = 0
  
for ct in fact_ct:
  if ct >= 74:
    ct_75 += 1
  if ct >= 24:
    ct_25 += 1
  if ct >= 14:
    ct_15 += 1
  if ct >= 4:
    ct_5 += 1 
  if ct >= 2:
    ct_3 += 1

ans = 0

ans += ct_75

ans += ct_25 * (ct_3-1)
ans += ct_15 * (ct_5-1)

ans += ct_5*(ct_5-1)*(ct_3-2) // 2

print(ans)
#print(fact_ct)
w,h = (int(i) for i in input().split())
s = []
for i in range(h):
    s.append(input())

isPaintable = True
for y in range(h):
    for x in range(w):
        if s[x][y]=="#":
            if x-1>=0 and s[x-1][y]=="#":
                continue
            elif y-1>=0 and s[x][y-1]=="#":
                continue
            elif x+1<w and s[x+1][y]=="#":
                continue
            elif y+1<h and s[x][y+1]=="#":
                continue
            isPaintable=False
if isPaintable:
    print("Yes")
else:
    print("No")

### FIXED CODE ###

h,w = (int(i) for i in input().split())
s = []
for i in range(h):
    s.append(input())

isPaintable = True
for y in range(h):
    for x in range(w):
        if s[y][x]=="#":
            if x-1>=0 and s[y][x-1]=="#":
                continue
            elif y-1>=0 and s[y-1][x]=="#":
                continue
            elif x+1<w and s[y][x+1]=="#":
                continue
            elif y+1<h and s[y+1][x]=="#":
                continue
            isPaintable=False
if isPaintable:
    print("Yes")
else:
    print("No")
n, k = map(int, input().split())
step = list(map(int, input().split()))

ans = [float('inf')]*(10)

ans[0] = 0
def dp(n):
  for i in range(n):
    for j in range(k+1):
      if i+j < n:
        ans[i+j] = min(ans[i+j], ans[i] + abs(step[i+j] - step[i]))
  return ans[n-1]

print(dp(n))

### FIXED CODE ###

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

ans = [float('inf')]*(10**6)

ans[0] = 0
def dp(n):
  for i in range(n):
    for j in range(k+1):
      if i+j < n:
        ans[i+j] = min(ans[i+j], ans[i] + abs(step[i+j] - step[i]))
  return ans[n-1]

print(dp(n))
a,b,c=map(int,input().split())
print(max(c-(a-b)),0)

### FIXED CODE ###

a,b,c=map(int,input().split())
print(max(c-(a-b),0))
a = int(input())
 if a >= 1200:
    print("ARC");
else:
    print("ABC");

### FIXED CODE ###

a = int(input())
 
if a >= 1200:
    print("ARC");
else:
    print("ABC");
n = int(input())

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

for i in range(35):
    j = i // 9
    cand = []
    for k in range(j+1):
       _i = i
       _i -= 9*k
       l = _i // 6
       for m in range(l+1):
           __i = _i
           __i -= 6*m
           cand.append(k+m+__i)
    dp[i] = min(cand)
nine_list = [pow(9, i) for i in range(1, 6)]
six_list = [pow(6, i) for i in range(1, 7)]
for i in range(35, n+1):
    for j in range(len(nine_list)):
        if nine_list[j] > i:
            max_nine = nine_list[j-1]
            break
    for j in range(len(six_list)):
        if six_list[j] > i:
            max_six = six_list[j-1]
            break
    dp[i] = min(dp[i-max_nine]+1, dp[i-max_six]+1)

print(dp[n])

### FIXED CODE ###

n = int(input())

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

for i in range(35):
    j = i // 9
    cand = []
    for k in range(j+1):
       _i = i
       _i -= 9*k
       l = _i // 6
       for m in range(l+1):
           __i = _i
           __i -= 6*m
           cand.append(k+m+__i)
    dp[i] = min(cand)
nine_list = [pow(9, i) for i in range(1, 6)]
six_list = [pow(6, i) for i in range(1, 7)]
for i in range(35, n+1):
    max_nine = nine_list[len(nine_list) - 1]
    max_six = six_list[len(six_list) - 1]
    for j in range(len(nine_list)):
        if nine_list[j] > i:
            max_nine = nine_list[j-1]
            break
    for j in range(len(six_list)):
        if six_list[j] > i:
            max_six = six_list[j-1]
            break
    dp[i] = min(dp[i-max_nine]+1, dp[i-max_six]+1)

print(dp[n])
N = int(input())
# v = [list(map(int, input().split())) for _ in range(N-1)]

edge = [[] for _ in range(N)]

for i in range(N-1):
    v1, v2, w = map(int, input().split())
    edge[v1-1].append((v2-1, w))
    edge[v2-1].append((v1-1, w))

color = [-1 for _ in range(N)]
color[0] = 1

def dfs(x):
    for v, w in edge[x]:
        if color[v] == -1:
            color[v] = (w + color[x])%2
            dfs(v)



dfs(0)
print(*color, sep="\n")

### FIXED CODE ###

import sys
input=sys.stdin.buffer.readline
sys.setrecursionlimit(10**9)
n=int(input())
edges=[[] for i in range(n)]
for i in range(n-1):
    a,s,w=map(int,input().split())
    edges[a-1].append([s-1,w]);edges[s-1].append([a-1,w])
colors=[-1]*n
colors[0]=1
def dfs(now):
    for to,cost in edges[now]:
        if colors[to]==-1:
            colors[to]=(cost+colors[now])%2
            dfs(to)

dfs(0)
print(*colors,sep="\n")
N, K, L = map(int, input().split())
city = [{"road":{"Connected":[i],"seen":False}, "rail":{"Connected":[i],"seen":False}} for i in range(N)]
Connected_Components = {"road":list(),"rail":list()}
def dfs(graph, v, way, List):
    graph[v][way]["seen"] = True
    List.append(v)
    for next_v in graph[v][way]["Connected"]:
        if graph[next_v][way]["seen"] == True:
            continue
        dfs(graph, next_v, way, List)

for i in range(K):
    p, q = map(int, input().split())
    city[p-1]["road"]["Connected"].append(q-1)
    city[q-1]["road"]["Connected"].append(p-1)
for i in range(L):
    r, s = map(int, input().split())
    city[r-1]["rail"]["Connected"].append(s-1)
    city[s-1]["rail"]["Connected"].append(r-1)
for X in ["road", "rail"]:
    count = 0
    for v in range(N):
        if city[v][X]["seen"] == True:
            continue
        Connected_Components[X].append(list())
        dfs(city, v, X, Connected_Components[X][count])
        
        for i in Connected_Components[X][count]:
            city[i][X]["Connected"] = Connected_Components[X][count]
        count += 1
for v in range(N):
    print(len(set(city[v]["road"]["Connected"])&set(city[v]["rail"]["Connected"])), end=" ")


### FIXED CODE ###

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

def fp(x, parentList): #findParent
    if parentList[x] == x:
        return x
    else:
        parentList[x] = fp(parentList[x], parentList)
        return parentList[x]

#各ノードのparentをリストで表現(連結前は自身がparent)
road = [i for i in range(N)]
rail = [i for i in range(N)]

for _ in range(K):
    p, q = map(int, input().split())
    par_p, par_q = fp(p-1, road), fp(q-1, road) #p, qのparent 
    #連結する際、若い番号をparentとする
    if par_p < par_q:
        road[par_q] = par_p
    else:
        road[par_p] = par_q

#railについても同様
for _ in range(L):
    s, t = map(int, input().split())
    par_s, par_t = fp(s-1, rail), fp(t-1, rail)
    if par_s < par_t:
        rail[par_t] = par_s
    else:
        rail[par_s] = par_t

#連結成分の要素をカウント
cnt = {}
for i in range(N):
    key = (fp(i,road),fp(i,rail))
    if key in cnt:
        cnt[key] += 1
    else:
        cnt[key] = 1
#出力
for i in range(N):
    key = (fp(i,road),fp(i,rail))
    ans = cnt[key]
    print(ans, end=" ")
a,b = map(int, input().split())
if a < 6:
    print(0)
    exit()
elif a < 14:
    print(int(b / 2))
	exit()
else:
    print(b)

### FIXED CODE ###

a,b = map(int, input().split())
if a >= 13:
    print(b)
    exit()
elif a >= 6:
    print(int(b / 2))
    exit()
else:
    print(0)
X, N = list(map(int, input().split()))
p = list(map(int, input().split()))
p_max = max(p)
p = set(p)
#リストに含まれるものは飛ばす
for i in range(1, 101):
    if X - i not in p:
        print(X -1)
        break
    if X + i not in p:
        print(X + i)
        break
        

### FIXED CODE ###

X, N = map(int, input().split())
p = list(map(int, input().split()))

p = set(p)
for i in range(200):
    if X - i not in p:
        print(X - i)
        break
    if X + i not in p:
        print(X + i)
        break
ls=list(map(int,input().split()))
ls1=[[5,7,5],[5,5,7],[7,5,5]]
if ls in ls1:
  print('YES')
  else:
    print('NO')

### FIXED CODE ###

ls=list(map(int,input().split()))
ls1=[[5,7,5],[5,5,7],[7,5,5]]
if ls in ls1:
	print('YES')
else:
	print('NO')
n = int(input())
s = str(input())
k = int(input())

a = []
for i in s:
    
    if i != s[k]:
        a.append('*')
    else:
        a.append(i)

print(*[i for i in a],sep='')

### FIXED CODE ###

n = int(input())
s = str(input())
k = int(input())

a = []
for i in s:
    
    if i != s[k-1]:
        a.append('*')
    else:
        a.append(i)

print(*[i for i in a],sep='')
[n, m] = map(int, input().split())

_map = {}
for i in range(n):
    _map[i+1] = []

for i in range(m):
    [x1, y1] = map(int, input().split())

    _map[y1].append(x1)

_memo = {}

def lpath(vertex):
    if vertex in _memo:
        return _memo[vertex]

    if len(_map[vertex]) == 0:
        return 0
    else:
        _max = 0
        for nv in _map[vertex]:
            # print(nv)
            x = lpath(nv)
            if (x > _max):
                _max = x

        _memo[vertex] = _max + 1
        return _max + 1

global_longest_path = 0
for i in range(n):
    longest_path_to_cur_node = lpath(i + 1)
    if global_longest_path < longest_path_to_cur_node:
        global_longest_path = longest_path_to_cur_node

print(global_longest_path)

### FIXED CODE ###

import sys
sys.setrecursionlimit(10000000)

[n, m] = map(int, input().split())

_map = {}
for i in range(n):
    _map[i+1] = []

for i in range(m):
    [x1, y1] = map(int, input().split())

    _map[y1].append(x1)

_memo = {}

def lpath(vertex):
    if vertex in _memo:
        return _memo[vertex]

    if len(_map[vertex]) == 0:
        return 0
    else:
        _max = 0
        for nv in _map[vertex]:
            # print(nv)
            x = lpath(nv)
            if (x > _max):
                _max = x

        _memo[vertex] = _max + 1
        return _max + 1

global_longest_path = 0
for i in range(n):
    longest_path_to_cur_node = lpath(i + 1)
    if global_longest_path < longest_path_to_cur_node:
        global_longest_path = longest_path_to_cur_node

print(global_longest_path)
A=list(map(int,input().split()))
sort(A)
if A==[5,5,7]:
  print("YES")
else:
  print("NO")
    


### FIXED CODE ###

A=list(map(int,input().split()))
A.sort()
if A==[5,5,7]:
  print("YES")
else:
  print("NO")
#!/usr/bin/env python3

from sympy import factorint


def parse(n):
    # n -> largest m s.t. m(m+1)/2 <= n
    m = 1
    while m * (m + 1) <= 2 * n:
        m += 1
    return m - 1


def factorint(n):
    fct = []
    b, e = 2, 0
    while b * b <= n:
        while n % b == 0:
            n = n // b
            e = e + 1
        if e > 0:
            fct.append((b, e))
        b, e = b + 1, 0
    if n > 1:
        fct.append((n, 1))
    return fct


def main():
    N = int(input())
    factors = factorint(N)
    print(sum(parse(v) for _, v in factors))
    return


if __name__ == "__main__":
    main()


### FIXED CODE ###

#!/usr/bin/env python3


def parse(n):
    # n -> largest m s.t. m(m+1)/2 <= n
    m = 1
    while m * (m + 1) <= 2 * n:
        m += 1
    return m - 1


def factorint(n):
    fct = []
    b, e = 2, 0
    while b * b <= n:
        while n % b == 0:
            n = n // b
            e = e + 1
        if e > 0:
            fct.append((b, e))
        b, e = b + 1, 0
    if n > 1:
        fct.append((n, 1))
    return fct


def main():
    N = int(input())
    factors = factorint(N)
    print(sum(parse(v) for _, v in factors))
    return


if __name__ == "__main__":
    main()
import itertools
K, S = map(int, input().split())
s = set([x for x in itertools.combinations_with_replacement(range(K+1), 3) if sum(x) == S]) 
print(len(s) * 3 - (S % 3 == 0) * 2)

### FIXED CODE ###

print(*input().split(','))
import heapq
N,M = map(int,input().split())
As = list(map(int,input().split()))

As = sorted(As)
BCs = []
heapq.heapify(BCs)
for i in range(M):
    B,C =   map(int,input().split())
    heapq.heappush(BCs,(-C,B))

ind = 0
ans = 0
flg = False
for i in range(M):
    _C,B = heapq.heappop(BCs)
    for i in range(B):
        if As[ind+i] > -_C:
            flg = True
            ind += i
            break
        else:
            ans -= _C
    if flg: break
    ind += B
ans += sum(As[ind:])
print(ans)

### FIXED CODE ###

import heapq
N,M = map(int,input().split())
As = list(map(int,input().split()))

As = sorted(As)
BCs = []
heapq.heapify(BCs)
for i in range(M):
    B,C =   map(int,input().split())
    heapq.heappush(BCs,(-C,B))

ind = 0
ans = 0
flg = False
for i in range(M):
    _C,B = heapq.heappop(BCs)
    for i in range(B):
        if As[ind+i] > -_C:
            flg = True
            ind += i
            break
        else:
            ans -= _C
        if ind+i+1 > N-1:
            flg = True
            ind += i+1
            break
    if flg: break
    ind += B
ans += sum(As[ind:])
print(ans)
#!/usr/bin/env python3
#  = input()
#a  = int(input())
n, a, b = map(int, input().split())
#  = list(map(int, input().split()))
#  = [int(input()) for i in range(N)]
#
# c = collections.Counter()

if a == 0:
  print(0)
else:
  nab = n // (a + b)
  ans = nab * a
  mod = n % (nab * (a + b))
  ans += min(mod, a)
  print(ans)


### FIXED CODE ###

#!/usr/bin/env python3
#  = input()
#a  = int(input())
n, a, b = map(int, input().split())
#  = list(map(int, input().split()))
#  = [int(input()) for i in range(N)]
#
# c = collections.Counter()

if a == 0:
  print(0)
elif n < (a + b):
  print(min(n, a))
else:
  nab = n // (a + b)
  ans = nab * a
  mod = n % (nab * (a + b))
  ans += min(mod, a)
  print(ans)
n = 10**2
k = [0]*10**2
for x in range(1,34):
    for y in range(1,34):
        for z in range(1,34):
            for i in range(n+1):
                if (x+y+z)**2 -(x*y+y*z+z*x) == i:
                    k[i-1] += 1
for i in range(int(input())):
    print(k[i])

### FIXED CODE ###

n = 10**4
ans = [0]*10**4
for x in range(1,100):
    for y in range(1,100):
        for z in range(1,100):
            a = (x+y+z)**2 -(x*y+y*z+z*x)
            if a <= n:
                ans[a-1] += 1
for i in range(int(input())):
    print(ans[i])
# Original Submission At: https://atcoder.jp/contests/abc149/submissions/16823042
x= int(input())

def prime_check(num,count):
    while num % count == 0:
        num = num + 1
        count = 2
    if num <= count**2:
        print(num)
    else:
        prime_check(num,count+1)

if x==2 :
    print (2)
else:
    prime_check(x,2)


### FIXED CODE ###

MAX=200000
def get_prime(x):
  is_prime = [True] * 200000
  for i in range(2,MAX):
    if is_prime[i] and i >= x:
      return i
    elif is_prime[i]:
      for j in range(2 * i, MAX, i):
        is_prime[j] = False

print(get_prime(int(input())))
s = input()
print('Bad' if true in [s[i] is s[i + 1] for i in range(3)] else 'Good')

### FIXED CODE ###

s = input()
print('Bad' if True in [s[i] is s[i + 1] for i in range(3)] else 'Good')
from numba import njit

def dis(a, b):
  d = 0
  for ai, bi in zip(a, b):
    if ai == bi:
      continue
      d += 1
      return d

@njit
def main():
    s = list(input())
    t = list(input())
    lt = len(t)
    ls = len(s)
    ans = 1000

    for i in prange(ls-lt+1):
        ans = 1
    
    print(ans)
        
    

if __name__ == "__main__":
    main()


### FIXED CODE ###

def main():
    s = list(input())
    t = list(input())
    lt = len(t)
    ls = len(s)
    ans = 1000
    
    
    def dis(a, b):
        d = 0
        for ai, bi in zip(a, b):
            if ai == bi:
                continue
            d += 1
        return d
    
    for i in range(ls-lt+1):
        ans = min(ans, dis(s[i:i+lt], t))
    
    print(ans)
        
    

if __name__ == "__main__":
    main()
a = int(input())
mochi = []
for _ in range(a):
    mochi.append(int(input())
print(len(set(mochi)))


### FIXED CODE ###

a = int(input())
mochi = []
for _ in range(a):
    mochi.append(int(input()))

print(len(set(mochi)))