Harryxun/stf_run huggingface dataset:
from collections import deque
if __name__ == "__main__":
    h, w = map(int, input().split())
    grid = []
    for _ in range(h):
        grid.append(input())
    
    white = 0
    for i in range(h):
        for j in range(w):
            if grid[i][j] == ".":
                white += 1
    
    qu = deque()
    qu.append(((0, 0), 0))
    
    visited = [[False] * w for _ in range(h)]
    visited[0][0] = True
    ans = 0

    while True:
        now, dis = qu.pop()
        if now[0] == h-1 and now[1] == w-1:
            ans = white - dis - 1
            break

        if now[0] + 1 < h and grid[now[0] + 1][now[1]] != "#" and not visited[now[0] + 1][now[1]]:
            visited[now[0] + 1][now[1]] = True
            qu.appendleft(((now[0] + 1, now[1]), dis + 1))
        
        if now[0] - 1 >= 0 and grid[now[0] - 1][now[1]] != "#" and not visited[now[0] - 1][now[1]]:
            visited[now[0] - 1][now[1]] = True
            qu.appendleft(((now[0] - 1, now[1]), dis + 1))

        if now[1] + 1 < w and grid[now[0]][now[1] + 1] != "#" and not visited[now[0]][now[1] + 1]:
            visited[now[0]][now[1] + 1] = True
            qu.appendleft(((now[0], now[1] + 1), dis + 1))
        
        if now[1] - 1 >= 0 and grid[now[0]][now[1] - 1] != "#" and not visited[now[0]][now[1] - 1]:
            visited[now[0]][now[1] - 1] = True
            qu.appendleft(((now[0], now[1] - 1), dis + 1))
    print(ans)

### FIXED CODE ###

from collections import deque
if __name__ == "__main__":
    h, w = map(int, input().split())
    grid = []
    for _ in range(h):
        grid.append(input())
    
    white = 0
    for i in range(h):
        for j in range(w):
            if grid[i][j] == ".":
                white += 1
    
    qu = deque()
    qu.append(((0, 0), 0))
    
    visited = [[False] * w for _ in range(h)]
    visited[0][0] = True
    ans = -1

    while qu:
        now, dis = qu.pop()
        if now[0] == h-1 and now[1] == w-1:
            ans = white - dis - 1
            break

        if now[0] + 1 < h and grid[now[0] + 1][now[1]] != "#" and not visited[now[0] + 1][now[1]]:
            visited[now[0] + 1][now[1]] = True
            qu.appendleft(((now[0] + 1, now[1]), dis + 1))
        
        if now[0] - 1 >= 0 and grid[now[0] - 1][now[1]] != "#" and not visited[now[0] - 1][now[1]]:
            visited[now[0] - 1][now[1]] = True
            qu.appendleft(((now[0] - 1, now[1]), dis + 1))

        if now[1] + 1 < w and grid[now[0]][now[1] + 1] != "#" and not visited[now[0]][now[1] + 1]:
            visited[now[0]][now[1] + 1] = True
            qu.appendleft(((now[0], now[1] + 1), dis + 1))
        
        if now[1] - 1 >= 0 and grid[now[0]][now[1] - 1] != "#" and not visited[now[0]][now[1] - 1]:
            visited[now[0]][now[1] - 1] = True
            qu.appendleft(((now[0], now[1] - 1), dis + 1))
    print(ans)
a = int(input())
sum = 0
for i in range(a):
  b = int(input())
  sum += pow(b, -1)
print(pow(sum, -1)

### FIXED CODE ###

N = int(input())
A = list(map(int, input().split()))
sam = 0
for i in range(N):
  sam += A[i]**-1
print(sam**-1)
w = input()
cnt = 0
while True:
    t = input().lower()
    if t == 'END_OF_TEXT':
        break
    if w in t.split():
        cnt += 1
print(cnt)



### FIXED CODE ###

w = input()
cnt = 0
while True:
    t = input()
    if t == 'END_OF_TEXT':
        break
    cnt += t.lower().split().count(w)
print(cnt)
S=print()
print(-S.count('-')+S.count('+'))

### FIXED CODE ###

S=input()
print(-S.count('-')+S.count('+'))
import sys

table = "abcdefghijklmnopqrstuvwxyz"

sentence = sys.stdin.read()
sentence1 = str(entence.lower())
for i in table:
    print(i + ' : ' + str(sentence1.count(i)))


### FIXED CODE ###

import sys

table = "abcdefghijklmnopqrstuvwxyz"

sentence = sys.stdin.read()
sentence1 = sentence.lower()
for i in table:
    print(i + ' : ' + str(sentence1.count(i)))
s=input()
n=0
for i in range(s):
    if s[i]=="+":
        n+=1
print(n-(4-n))


### FIXED CODE ###

s=input()
n=0
for i in range(len(s)):
    if s[i]=="+":
        n+=1
print(n-(4-n))
# input
X, Y = map(int, input().split())

# check
if Y in set([sum(p) for p in set(product([2, 4], repeat=X))]):
    print("Yes")
else:
    print("No")

### FIXED CODE ###

# input
X, Y = map(int, input().split())

# check
if Y < 2 * X or Y > 4 * X or abs(Y - 2 * X) % 2 != 0:
    print("No")
else:
    print("Yes")
def main2():
    n,m=map(int,input().split())
    jobs_list=[list(map(int,input().split())) for _ in range(n)]
    #breakするタイミングを作るため、Mより大きい値の仕事を作成
    banpei_list=[[i,0] for i in range(1,m+2)]
    #リストの統合
    jobs_list.extend(banpei_list)
    jobs_list=sorted(jobs_list)
    print(jobs_list)
    ans=0
    index=0
    que=[]
    while True:
        day,pay=jobs_list[index]
        print(jobs_list[index])
        #dayがMを超えていればbreak
        if day>m:
            break
        #同じdayのデータが次にもあれば-1倍してheapにpush
        if day==jobs_list[index+1][0]: 
            heapq.heappush(que,-pay)
        #仕事の報酬の最大値を答えに加える
        #前の日のデータからも報酬が良い仕事は選べるようにqueにデータは貯めておく
        else:
            heapq.heappush(que,-pay)
            print(que)
            ans-=heapq.heappop(que)
        index+=1
    print(ans)

if __name__ == "__main__":
    main2()

### FIXED CODE ###

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

import heapq

def main2():
    n,m=map(int,input().split())
    jobs_list=[list(map(int,input().split())) for _ in range(n)]
    #breakするタイミングを作るため、Mより大きい値の仕事を作成
    banpei_list=[[i,0] for i in range(1,m+2)]
    #リストの統合
    jobs_list.extend(banpei_list)
    jobs_list=sorted(jobs_list)
    ans=0
    index=0
    que=[]
    while 1:
        day,pay=jobs_list[index]
        #dayがMを超えていればbreak
        if day>m:
            break
        #同じdayのデータが次にもあれば-1倍してheapにpush
        if day==jobs_list[index+1][0]: 
            heapq.heappush(que,-pay)
        #仕事の報酬の最大値を答えに加える
        #前の日のデータからも報酬が良い仕事は選べるようにqueにデータは貯めておく
        else:
            heapq.heappush(que,-pay)
            ans-=heapq.heappop(que)
        index+=1
    print(ans)

if __name__ == "__main__":
    main2()
a, b = map(int, input().split())
retu = ""
retu += str(a) + str(b)
c**2 = int(retu)
def koro(n):
  if isinstance(n, int):
  	return True
  else:
    return False
koro(c)

### FIXED CODE ###

a, b = map(int, input().split())
c = str(a) + str(b)
c = int(c)
d = c**(1/2)

if d.is_integer():
    print("Yes")
else:
    print("No")
N=int(input())
L=list(map(int,input().split()))
L=sorted(L)
if sum(L[:-1])>L:
  print('Yes')
else:
  print('No')

### FIXED CODE ###

N=int(input())
L=list(map(int,input().split()))
L=sorted(L)
if sum(L[:-1])>L[-1]:
  print('Yes')
else:
  print('No')
from collections import defaultdict
N = int(input())

string_dict = defaultdict(int)

for i in range(N):
    inp = list(input())
    inp.sort()

    string_dict["".join(inp)] += 1
# print(string_dict)


def kaijo(N):
    if N == 0:
        return 0
    if N == 1:
        return 0
    return N-1 + kaijo(N-1)


count = 0
for i in string_dict.values():
    if i >= 2:
        # print(kaijo(i))
        count += kaijo(i)
print(count)


### FIXED CODE ###

from collections import defaultdict
N = int(input())
# N = 1000
string_dict = defaultdict(int)

for i in range(N):
    inp = list(input())
    # inp = list("aaaa")
    inp.sort()

    string_dict["".join(inp)] += 1
# print(string_dict)

count = 0
for i in string_dict.values():
    count += i*(i-1)//2
print(count)
n=int(input())
mul=1
limit=1000000000000000000
for i in range (n):
  x=int(input())
  mul*=x
if(mul>limit):
  print(-1)
else:
  print(mul)

### FIXED CODE ###

n=int(input())
mul=1
limit=1000000000000000000
x=input().split()
for i in range (n):
    p=int(x[i])
    if(p==0):
        mul=0
        break
if(mul==0):
    print(mul)
else:
    for i in range (n):
        p=int(x[i])
        mul*=p
        if(mul>limit):
            break
    if(mul>limit):
      print(-1)
    else:
      print(mul)
A,B = map(int,input().split())
print(int(A*B))

### FIXED CODE ###

import sys
from decimal import Decimal
A,B= map(str,input().split())

A = Decimal(A)
B = Decimal(B)


print(int(A*B))
def get_kyori(i):
    if kos[i]==[]:
        return 0
    if kyori[i]!=-1:
        return kyori[i]
    re=0
    for ko in kos[i]:
        new=get_kyori(ko)+1
        if re<new:
            re=new
    kyori[i]=re
    return re

n,m=map(int,input().split())
kos=[[] for _ in range(n+1)]
kyori=[-1]*(n+1)
for _ in range(m):
    oya,ko=map(int,input().split())
    kos[oya]+=[ko]

ans=0
for i in range(1,n+1):
    if kyori[i]==-1:
        kyori[i]=get_kyori(i)
    if kyori[i]>ans:
        ans=kyori[i]

print(ans)

### FIXED CODE ###

import sys

input = sys.stdin.readline
sys.setrecursionlimit(10 ** 6)


def get_kyori(i):
    if kos[i] == []:
        kyori[i] = 0
        return 0
    if kyori[i] > -1:
        return kyori[i]
    re = 0
    for ko in kos[i]:
        new = get_kyori(ko) + 1
        if re < new:
            re = new
    kyori[i] = re
    return re


n, m = map(int, input().split())
kos = [[] for _ in range(n + 1)]
kyori = [-1] * (n + 1)
for _ in range(m):
    oya, ko = map(int, input().split())
    kos[oya] += [ko]

for i in range(1, n + 1):
    if kyori[i] == -1:
        kyori[i] = get_kyori(i)

print(max(kyori[1:]))
#!/usr/bin/env python3

import sys
import math
from bisect import bisect_right as br
from bisect import bisect_left as bl
sys.setrecursionlimit(2147483647)
from heapq import heappush, heappop,heappushpop
from collections import defaultdict
from itertools import accumulate
from collections import Counter
from collections import deque
from operator import itemgetter
from itertools import permutations
mod = 10**9 + 7
inf = float('inf')
def I(): return int(sys.stdin.readline())
def LI(): return list(map(int,sys.stdin.readline().split()))

n = I()
s = LI()

if n == 1:
    if s[0] == s[1]:
        print('No')
    else:
        print('Yes')
    quit()
h = []
for i in range(2**n):
    heappush(h,(-s[i],1))
x,y = heappop(h)
y = 0
heappush(h,(x,y))
for i in range(n-1):
    rest = []
    use = []
    rest_cnt = 0
    use_cnt = 0
    tmp = []
    while rest_cnt != i+1 or use_cnt != i+1:
        x,flg = heappop(h)
        if flg and rest_cnt < i+1:
            rest.append(-x)
            rest_cnt += 1
        elif not flg and use_cnt < i+1:
            use.append(-x)
            use_cnt += 1
        else:
            tmp.append((x,flg))
    for j in range(i+1):
        if use[j] > rest[j]:
            heappush(h,(-rest[j],0))
            heappush(h,(-use[j],0))
        else:
            print('No')
            quit()
    for j,f in tmp:
        heappush((j,f))
print('Yes')

### FIXED CODE ###

#!/usr/bin/env python3

import sys
import math
from bisect import bisect_right as br
from bisect import bisect_left as bl
sys.setrecursionlimit(2147483647)
from heapq import heappush, heappop,heappushpop
from collections import defaultdict
from itertools import accumulate
from collections import Counter
from collections import deque
from operator import itemgetter
from itertools import permutations
mod = 10**9 + 7
inf = float('inf')
def I(): return int(sys.stdin.readline())
def LI(): return list(map(int,sys.stdin.readline().split()))

n = I()
s = LI()
s.sort(reverse=True)
use = [s[0]]
rest = s[1:]
for _ in range(n):
    new_use = []
    que = deque(rest)
    for i in use:
        rest_tmp = []
        while que:
            x = que.popleft()
            if i > x:
                new_use.append(x)
                break
            else:
                rest_tmp.append(x)
        que += rest_tmp
    use += new_use
    use.sort(reverse=True)
    rest = list(que)
    rest.sort(reverse=True)
if len(use) == 2**n:
    print('Yes')
else:
    print('No')
arr=list(map(int,input().split()))

for i range(5):
  if arr[i]==0:
    print(i+1)

### FIXED CODE ###

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

for i in range(5):
    if arr[i]==0:
        print(i+1)
N = int(input())
l =[]
for i in range(1,1000000):
  if type(N/i) == int:
    l.append(i + N/i)
print(min(l)-2)

### FIXED CODE ###

N = float(input())
l = []
for i in range(1,1000001):
  a = N/i
  if a.is_integer():
    l.append(i + N/i)
print(int(min(l)-2))
N, M = map(int, input().split())
LRD = [list(map(int, input().split())) for i in range(M)]
 
 
class WeightedUnionFind:
    def __init__(self, n):
        self.par = [i for i in range(n+1)]
        self.rank = [0] * (n + 1)
        self.weight = [0] * (n+1)
 
    # 検索
    def find(self, x):
        if self.par[x] == x:
            return x
        else:
            self.weight[x] += self.weight[self.par[x]]
            self.par[x] = self.find(self.par[x])
            return self.par[x]
 
    # 重さの検索
    def weighting(self, x):
        self.find(x)
        return self.weight[x]
 
    # 併合
    def union(self, x, y, w):
        w -= self.weighting(x)
        w += self.weighting(y)
        x = self.find(x)
        y = self.find(y)
 
        if self.rank[x] < self.rank[y]:
            self.par[x] = y
        else:
            w = -w
            self.weight[y] = w
            self.par[y] = x
            if self.rank[x] == self.rank[y]:
                self.rank[x] += 1
 
    # 同じ集合に属するか
    def same(self, x, y):
        return self.find(x) == self.find(y)
 
    # 各頂点間の絶対距離
    def diff(self, x, y):
        return abs(self.weighting(x) - self.weighting(y))
 
 
wuf = WeightedUnionFind(N)
for l, r, d in LRD:
    if wuf.same(l, r):
        if wuf.diff(l, r) != d:
            print("No")
            break
    else:
        wuf.union(l, r, d)
else:
    print("Yes")

### FIXED CODE ###

N = int(input())
A = [list(map(int, input().split())) for i in range(2)]

ans = 0
for i in range(N):
    ans = max(ans, sum(A[0][:i+1])+sum(A[1][i:]))

print(ans)
#区間スケジューリング
n, m = map(int, input().split())
lst = []
for _ in range(m):
    a, b = map(int, input().split())
    lst.append([a, b])

lst.sort(key=lambda x:x[1])

ans = 0
ed = 0
for _ in lst:
    if _[0] < ed:
    else:
        ed = _[1]
        ans += 1
print(ans)

### FIXED CODE ###

#区間スケジューリング
n, m = map(int, input().split())
lst = []
for _ in range(m):
    a, b = map(int, input().split())
    lst.append([a, b])

lst.sort(key=lambda x:x[1])

ans = 0
ed = 0
for _ in lst:
    if _[0] < ed:
      pass
    else:
        ed = _[1]
        ans += 1
print(ans)
# xの逆元は、x*y = 1 mod pとなるようなy
N, K = map(int, input().split())
mod = 10**9 + 7
a = N - K + 1
print(a)
for i in range(K-1):
    a = a * (N - K - i) * (K - (i + 1)) // ((i+2) * (i+1)) % mod
    print(a)



### FIXED CODE ###

from collections import defaultdict
S = input()
D = defaultdict(int)
for s in S:
    D[s] += 1

def main(D):
    if len(D.keys()) != 2:
        return 0
    else:
        for v in D.values():
            if v != 2:
                return 0
    return 1

if main(D):
    print("Yes")
else:
    print("No")
N = int(input())
S = [input() for i in range(N)]
S.sort()
c = 1
for i in range(N-1):
  if S[i] == S[i+1]:
  else c++:
print(c)

### FIXED CODE ###

N = int(input())
S = [input() for i in range(N)]
S.sort()
c = 1
for i in range(N-1):
  if S[i] == S[i+1]:
    continue
  else:
    c += 1
print(c)
# 数字
N = int(input())

# 文字
S = input()

AAA = ""

for char in list(S):
    hoge = ord(char)
    huga = hoge - 97
    huga = (huga + N) % 26
    hoge = num + 97
    AAA += chr(hoge)

print()

### FIXED CODE ###

N = int(input())
S = input()


def encrypt(S, N):
    X = ""

    for ch in list(S):
        if 'A' <= ch <= 'Z':
            X += chr((ord(ch) - ord('A') + int(N)) % 26 + ord('A'))
        elif 'a' <= ch <= 'z':
            X += chr((ord(ch) - ord('a') + int(N)) % 26 + ord('a'))
        else:
            X += ch

    return X

# 暗号化
X = encrypt(S, N)
print(X)
n,m = map(int,raw_input().split())
arr = [1]*n
x = [False]*n
x[0] = True
counter = 0
for i in xrange(m) :
    a,b = map(int,raw_input().split())
    if x[a-1] :
        x[b-1] = True
    arr[a-1] -= 1
    arr[b-1] += 1
    if arr[a-1] == 0 :
        x[a-1] = False
for j in x :
    if j  :
        counter += 1
print counter


### FIXED CODE ###

a,b = map(int,raw_input().split())
if a > 0 and b > 0 :
    print 'Positive'
elif (a <= 0 and b >=0) :
    print 'Zero'
else :
    if b == 0 :
        print 'Zero'
    else :
        if (b-a+1)%2 == 0 :
            print 'Positive'
        else :
            print 'Negative'
N = int(input())
num = list(map(int,input().split()))

ans=0
while all(a%2==0 for a in A):
  A = [a/2 for a in A]
  ans+=1
  
print(ans)


### FIXED CODE ###

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

ans=0
while all(a%2==0 for a in A):
  A = [a/2 for a in A]
  ans+=1
  
print(ans)
import sys

args = sys.argv

n = args[1]
m = args[2]

if n == m:
    print("yes")
else:
    print("no")



### FIXED CODE ###

n,m = input().split()
 
if n == m:
  print("Yes")
else:
  print("No")
print("A%sC"%inut()[8])

### FIXED CODE ###

print("A%sC"%input()[8])
import sys
from collections import deque
import numpy as np
import math
sys.setrecursionlimit(10**6)
def S(): return sys.stdin.readline().rstrip()
def SL(): return map(str,sys.stdin.readline().rstrip().split())
def I(): return int(sys.stdin.readline().rstrip())
def IL(): return map(int,sys.stdin.readline().rstrip().split())

def solve():
    f = math.ceil(m/1.08)
    if math.floor(f*1.08)==n:
        print(f)
    else:
        print(':(')
    return

if __name__=='__main__':
    n = I()
    solve()

### FIXED CODE ###

import sys
from collections import deque
import numpy as np
import math
sys.setrecursionlimit(10**6)
def S(): return sys.stdin.readline().rstrip()
def SL(): return map(str,sys.stdin.readline().rstrip().split())
def I(): return int(sys.stdin.readline().rstrip())
def IL(): return map(int,sys.stdin.readline().rstrip().split())

def solve():
    f = math.ceil(n/1.08)
    if math.floor(f*1.08)==n:
        print(f)
    else:
        print(':(')
    return

if __name__=='__main__':
    n = I()
    solve()
X = int(input())
Y = int(input())

x = X + Y/2

print(x)

### FIXED CODE ###

X,Y = map(int,input().split())
print(X+Y//2)
from itertools import accumlate
n,x = map(int,input().split())
lst_l = [0] + list(map(int,input().split()))
lst_wa = list(accumulate(lst_l))
cnt = 0
for i in lst_wa:
    if i < x:
        cnt += 1
print(cnt)

### FIXED CODE ###

from itertools import accumulate
n,x = map(int,input().split())
lst_l = [0] + list(map(int,input().split()))
lst_wa = list(accumulate(lst_l))
cnt = 0
for i in lst_wa:
    if i <= x:
        cnt += 1
print(cnt)
s = list(input())
s.sort()
if s[0] == s[1] and s[2] == s[3] and a[1] != a[2]:
  print("Yes")
else:
  print("No")

### FIXED CODE ###

s = list(input())
s.sort()
if s[0] == s[1] and s[2] == s[3] and s[1] != s[2]:
  print("Yes")
else:
  print("No")
inf = 2019
L, R = map(int, input().split())
ans = 2018
L = L % 2019
R = R % 2019
if L > R:
    print(0)
    sys.exit
for i in range(L, L + 2019):
    if i > R:
      break
      
    for j in range(i + 1, R):
        tmp = int((i * j) % inf)
        ans = min(ans, tmp)
        
print(ans)


### FIXED CODE ###

inf = 2019
L, R = map(int, input().split())
ans = 0
df = R - L
if df < 2019:
    L = L % inf
    R = L + df
    ans = 2019
    for i in range(L, R):
        for j in range(i + 1, R + 1):
            tmp = int((i * j) % inf)
            ans = min(ans, tmp)

print(ans)
n,q=map(int,input().split())
tree=[[] for _ in range(n)]
for i in range(n-1):
    a,b=map(int,input().split())
    tree[a-1].append(b-1)
    tree[b-1].append(a-1)
p=[0]*q
x=[0]*q
for i in range(q):
    p[i],x[i] = map(int,input().split())
    
px=[[] for i in range(n)]
for pp,xx in zip(p,x):
    px[pp-1].append(xx)
px=[sum(i) for i in px]
c=[0]*n
flag=[True]*n

from collections import deque
q = deque([(-1,0,0)])
while q:
    parent,child,point = q.popleft()
    if parent!=-1:
        flag[parent]=False
    point+=px[child]
    c[child]=point
    print(parent,child,point,tree[child],c)
    for y in tree[child]:
        if y == parent
            continue
        if flag[y]:
            q.append((child,y,point))
print(*c)

### FIXED CODE ###

def main():
    import sys
    input = sys.stdin.readline
    
    n,q=map(int,input().split())
    tree=[[] for _ in range(n)]
    for i in range(n-1):
        a,b=map(int,input().split())
        tree[a-1].append(b-1)
        tree[b-1].append(a-1)
    p=[0]*q
    x=[0]*q
    for i in range(q):
        p[i],x[i] = map(int,input().split())
        
    px=[[] for i in range(n)]
    for pp,xx in zip(p,x):
        px[pp-1].append(xx)
    px=[sum(i) for i in px]
    c=[0]*n
    flag=[True]*n
     
    from collections import deque
    q = deque([(-1,0,0)])
    while q:
        parent,child,point = q.popleft()
        if parent!=-1:
            flag[parent]=False
        point+=px[child]
        c[child]=point
        for y in tree[child]:
            if y == parent:
                continue
            if flag[y]:
                q.append((child,y,point))
    print(*c)
if __name__ == '__main__':
    main()
# -*- coding: utf-8 -*-

def main():
    n, m, x = map(int, input().split())
    a = list(map(int, input().split()))
    print(min(len([b for b in a if b < x]), len([b for b in a if b > x])))

if __name__ == '__main__':
    main()


### FIXED CODE ###

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

def main():
    a, b, x = map(int, input().split())
    print ('YES' if (x >= a and x <= a + b) else 'NO')

if __name__ == '__main__':
    main()
a,b = int(input().split())
print(a*b)

### FIXED CODE ###

a, b = input().split()
print(int(a)*int(b))
times = [int(input()) for i in range(5)]
summ = sum(times)

time = times[:]

for i in range(5):
  while time[i] - 10 >= 0:
    time[i] -= 10

unko = [10-i for i in time]

while 10 in unko:
  unko.remove(10)

unko.remove(max(unko))

print(summ+sum(unko))

### FIXED CODE ###

times = [int(input()) for i in range(5)]

time = []

for i in range(5):
  time.append(0)
  while (times[i] + time[i]) % 10 != 0:
    time[i] += 1

print(sum(times)+sum(time)-max(time))
while 1:
H , W = map(int, raw_input().split(" "))

if H == 0 or W == 0:
  break
width = ''
for _ in range(W):
  width += '#'
for _  in range(H):
  print width
    
    

### FIXED CODE ###

while 1:
  h, w = map(int, raw_input().split())
  if h == 0 and w == 0:
    break
  for i in range(h):
    print "#" * w
  print""
from math import gcd
N=int(input())
L=list(map(int,input().split()))
M=max(L)

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

p=1
for i in L:
    p=lcm(i,p)
q=0
print(sum([(p-1)%i for i in L]))

### FIXED CODE ###

from fractions import gcd
N=int(input())
L=list(map(int,input().split()))
M=max(L)

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

p=1
for i in L:
    p=lcm(i,p)
q=0
print(sum([(p-1)%i for i in L]))
N = int(input())
C=list(input())
L=0
R=0
X=0
for i in range(N):
  L=i
  if L==N-1-R:
    break
  if C[i]=='W':
    for ii in range(N-L-R):
      R+=ii 
      if C[N-1-R]=='R':
        C[L]='R'
        C[N-1-R]='W'
        X+=1
        R+=1
        if L==N-1-R:
          break
        break
print(X)

### FIXED CODE ###

N = int(input())
C=list(input())
type=set(C)
L=0
R=0
RR=0
X=0
if 'R' in type and 'W' in type:
    for i in range(N):
      L=i
      R=RR
      if L>=N-1-R:
        break
      if C[i]=='W':
          for ii in range(N-L-R):
            if C[N-1-R-ii]=='R':
              C[L]='R'
              C[N-1-R-ii]='W'
              X+=1
              break
            RR+=1
            if L>=N-1-R:
              break
print(X)