Harryxun/stf_run huggingface dataset:
from collections import Counter
n = int(input())
s, t = [], []
for _ in range(n):
    s.append(input())
m = int(input())
for _ in range(m):
    t.append(input())
u = Counter(s) - Counter(t)
ans = u.most_common(1)[0][1]
print(ans)


### FIXED CODE ###

from collections import Counter, defaultdict
n = int(input())
s= []
t = defaultdict(int)
for _ in range(n):
    s.append(input())
u = Counter(s)
m = int(input())
for _ in range(m):
    word = input()
    t[word] -= 1
    if word in u.keys():
        u[word] -= 1

ans = u.most_common(1)[0][1]
t = sorted(t.items(), key=lambda x:x[1], reverse=True)[0][1]
t = max(t, 0)
print(max(ans,t))
x,y,z = input.split()
if (x/y >= z):
	print("Yes")
elif
	print("No")

### FIXED CODE ###

x,y,z = input().split()
if ( int(x) / int(y) <= int(z)):
	print("Yes")
else:
	print("No")
import math
import numpy as np

def lcm(x, y):
    return (x * y) // math.gcd(x, y)

# %%
A, B, C, D = list(map(int, input().split()))
    
CD = lcm(C, D) 

n_C = int(np.floor(B/C) - np.floor((A-1)/C))
n_D = int(np.floor(B/D) - np.floor((A-1)/D))

n_CD = int(np.floor(B/CD) - np.floor((A-1)/CD))

print('{}'.format(B-A+1-(n_C+n_D-n_CD)))


### FIXED CODE ###

# -*- coding: utf-8 -*-
"""
Created on Sat Jun 22 21:34:54 2019

@author: owner
"""
import numpy as np

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

def lcm(x, y):
    return (x * y) // gcd(x, y) #math.gcd(x, y)

# %%
A, B, C, D = list(map(int, input().split()))
    
CD = lcm(C, D) 

n_C = np.int(np.floor(B/C) - np.floor((A-1)/C))
n_D = np.int(np.floor(B/D) - np.floor((A-1)/D))

# n_CD = np.int(np.floor(B/CD) - np.floor((A-1)/CD))

Cdiv = B // C - (A-1) // C
Ddiv = B // D - (A-1) // D
import fractions
cddiv = (C*D)//fractions.gcd(C,D)
CDdiv = B // (cddiv) - (A-1) // (cddiv)
    
ans = B - A + 1 -Cdiv - Ddiv + CDdiv#- n_C - n_D + CDdiv#n_CD
print('{}'.format(ans))
N, K=map(int, input().split())
A=list(sorted(list(map(int, input().split())), reverse=True))

def gcd(a,b):
	while b:
		a,b=b,a%b
	return a

if K>max(A):
	print("IMPOSSIBLE")
	exit(0)

g=gcd(A[0],A[1])
for i in range(2,len(A)):
	g=gcd(g,A[i])

print("POSSIBLE" if K%g==0 else "IMPOSSIBLE")

### FIXED CODE ###

N, K=map(int, input().split())
A=list(sorted(list(map(int, input().split())), reverse=True))

def gcd(a,b):
	while b:
		a,b=b,a%b
	return a

g=A[0]
for i in range(1,len(A)):
	g=gcd(g,A[i])

print("POSSIBLE" if K%g==0 and K<=max(A) else "IMPOSSIBLE")
n,k=map(int,input().split())
for i in range(21):
  if k<=2**i:
    t=i
    break
   
#print(t)
if n>=k:
  ans=1/n*((1/2**t)*(2**(k-1)-1)+n-k+1)
else:
  ans=1/n*(1/2**t)*(2**(n)-1)
print('{:.13f}'.format(ans))
    

### FIXED CODE ###

n,k = map(int, input().split())
 
ans = 0
for i in range(1,n+1):
  t = 0
  while i < k:
    i *= 2
    t += 1
  ans += 0.5**t
print(ans/n)
input_N_L = input()
#print( input_N_L )
N, L = map( int, input_N_L.split() )

#print( N )
#print( L )

str_set = set()
for i in range( L ):
  str_set.add( input() )
#print( array )

sorted_str = ""
for s in sorted( str_set ):
  sorted_str += s
print( sorted_str )

### FIXED CODE ###

n, l = map( int, input().split( ' ' ) )
strs = sorted( [ input() for i in range(n) ] )
print( ''.join( strs ) )
S, T = [input() for _ in range(2)]

S = sorted(S)
T = sorted(T)
print(S,T)
flg = False
if len(S) < len(T):
  flg =True
      
if len(S) == len(T):
  for i in range(len(S)):
    if T[i] > s[i]:
      print("T>S")
      flg =True
    
if flg:
  print('Yes')
else:
  print('No')

### FIXED CODE ###

s = input()
s_dash = sorted(s)
#print(s_dash)

t = input()
t_dash = sorted(t, reverse=True)
#print(t_dash)

if s_dash < t_dash:
  print('Yes')
else:
  print('No')
import sys
input = sys.stdin.readline
import numpy as np
 
N,W = map(int, input().split())
 
dp = [10 ** 10] * N * (10 ** 3)
dp[0] = 0
dp = np.array(dp)
 
 
for i in range(N):
    w,v = map(int, input().split())
    dp[v:] = np.minimum(dp[v:] , dp[:-v] + w)
    dp[:v] = np.minimum(dp[:v] , w)
  
for v in range(V + 1):
    if dp[v] <= W:
        ans = v
print(ans)

### FIXED CODE ###

import numpy as np
 
N, W = map(int, input().split())
WV = np.array([input().split() for _ in range(N)], np.int64)
V = sum(WV[:,1])
dp = np.zeros(V + 1, np.int64)
dp += 10 ** 10
dp[0] = 0
for w, v in WV:
    dp[v:] = np.minimum(dp[v:], dp[:-v] + w)
for v in range(V + 1):
    if dp[v] <= W:
        ans = v
print(ans)
N,L = [int(x) for x in input().split()]
A = list(range(L,L+N))
Min = 100
for i in A:
    if Min > abs(i):
        youso = i
        Min = abs(i)
A.remove(youso)
print(sum(A))

### FIXED CODE ###

N,L = [int(x) for x in input().split()]
A = list(range(L,L+N))
Min = 100
for i in A:
    if Min >= abs(i):
        youso = i
        Min = abs(i)
A.remove(youso)
print(sum(A))
n,q = map(int,input().split())

g = [[] for _ in range(n)]
c = [0] * n
visited = [False] * n

#根に近い順に累積和
def dfs(i):
    visited[i] = True
    for j in g[i]:
        if visited[j]:
            continue
        c[j]+=c[i]
        dfs(j)

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

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

dfs(0)
print(*c)

### FIXED CODE ###

import sys
input = sys.stdin.readline
sys.setrecursionlimit(10**6)
n,q = map(int,input().split())

g = [[] for _ in range(n)]
c = [0] * n
visited = [False] * n

#根に近い順に累積和
def dfs(i):
    visited[i] = True
    for j in g[i]:
        if visited[j] == True:
            continue
        c[j]+=c[i]
        dfs(j)

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

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

dfs(0)
print(*c)
r = input()
print(r * r)

### FIXED CODE ###

r = int(input())
ans = r * r
print(ans)
n,a,b=map(int,input().split())
if a>b:
    print(0)
    exit()
elif n=1 and a!=b:
    print(0)
    exit()
print((b-a)*(n-2)+1)


### FIXED CODE ###

n,a,b=map(int,input().split())
if a>b:
    print(0)
    exit()
elif n==1 and a!=b:
    print(0)
    exit()
print((b-a)*(n-2)+1)
s_dash = input()
t = input()
n = len(s_dash)
m = len(t)


if n < m:
    print("UNRESTORABLE")
    exit()


for i in range(n - m + 1):
    flag = True
    for j in range(m):
        if s_dash[i+j] != '?' and s_dash[i+j] != t[j]:
            flag = False
            break
    if flag:
    #範囲外をaに置き換える
    ans = list(s_dash)
    ans[i:i+m] = list(t)
    ans = "".join(ans).replace("?", "a")
    print(ans)
    exit()
        
      
print("UNRESTORABLE")

### FIXED CODE ###

S = input()
T = input()
if len(S) < len(T):
    print("UNRESTORABLE")
    exit()
for i in range(len(S) - len(T), -1, -1):
    for s, t in zip(S[i:i+len(T)], T):
        if s != "?" and s != t:
            break
    else:
        S = list(S)
        S[i:i+len(T)] = list(T)
        S = "".join(S).replace("?", "a")
        print(S)
        exit()
print("UNRESTORABLE")
n,k=map(int,input().split())
a=list(map(int,input().split()))
a.sort()
bit = [0]*60
zouryou = [0]*60
tmpX = 0
if k == 0:
    print(sum(a))
    exit()

t=k
keta=0
while(t):
    keta += 1
    t >>= 1

for num in a:
    for b in range(keta):
        if num>>b & 1:
            bit[b] += 1

for i in range(keta):
    if bit[i] < n-bit[i]:
        zouryou[i] = (n-2*bit[i])*(1<<i)
        tmpX += 1<<i
  
while(tmpX > k):
    mini = 123456789012345
    minidx = -1
    for i in range(keta):
        if zouryou[i] > 0 and zouryou[i] < mini:
            mini = zouryou[i]
            minidx = i
    zouryou[minidx] = 0
    tmpX -= 1<<minidx
print(sum(zouryou) + sum(a))

### FIXED CODE ###

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

c=[[0 for _ in range(2)] for _ in range(64)]

for i in range(n):
    for j in range(60):
        c[j][a[i]>>j&1] += 1
x=0
for i in range(59,-1,-1):
    if(c[i][0] > c[i][1] and x|(1<<i) <= k):
        x |= 1<<i

sum = 0
for i in range(n):
    sum += a[i]^x
print(sum)
n = int(input())
h_list = [int(input()) for h in range(n)]

count = 0
last_h = 0
for index,h in enumerate(h_list):
	if last_h <= h:
		count += 1
	
	if last_h < h:
		last_h = h

print(count)
		
	
	

### FIXED CODE ###

n = int(input())
h_list = list(map(int, input().split()))
h_list = h_list[:n]
count = 0
last_h = 0
for index,h in enumerate(h_list):
	if last_h <= h:
		count += 1
	
	if last_h <= h:
		last_h = h

print(count)
def comb(n, r):
  if r == 0  or n == r: return 1
  else: return comb(n-1, r) + comb(n-1, r-1)
 
k, s = map(int, input().split())
if s <= k: print(comb(s+2, 2))
elif s <= 2*k: print(3*comb(s-k+2, 2))
else: print(3*comb(s-2*k+2,2))

### FIXED CODE ###

ans = 0
k, s = map(int, input().split())
for x in range(k+1):
  for y in range(k+1):
    z = s - x - y
    if 0 <= z and z <= k:
      ans += 1
 
 
 
print(ans)
a,b=map(int(input()));print(min(a,b)-1)

### FIXED CODE ###

a,b=map(int,input().split());print([a-1,a][b>=a])
import sys,queue,math,copy,itertools,bisect,collections,heapq

def main():
    sys.setrecursionlimit(10**7)
    INF = 10**18
    MOD = 10**9 + 7
    LI = lambda : [int(x) for x in sys.stdin.readline().split()]
    NI = lambda : int(sys.stdin.readline())

    H,W = LI()
    f = [[0] * W for _ in range(H)]
    q = collections.deque()
    for i in range(H):
        for j,x in enumerate(sys.stdin.readline().rstrip()):
            if x == '#':
                f[i][j] = 1
                q.append((i,j,0))
    ans = 0
    while q:
        y,x,c = q.popleft()
        ans = max(ans,c)
        for dy,dx in ((0,1),(1,0),(-1,0),(0,-1)):
            if 0 <= x+dx < W and 0 <= y+dy < H:
                if f[x+dx][y+dy] == 0:
                    f[x+dx][y+dy] = 1
                    q.append((y+dy,x+dx,c+1))
    print(ans)

if __name__ == '__main__':
    main()

### FIXED CODE ###

import sys,queue,math,copy,itertools,bisect,collections,heapq

def main():
    sys.setrecursionlimit(10**7)
    INF = 10**18
    MOD = 10**9 + 7
    LI = lambda : [int(x) for x in sys.stdin.readline().split()]
    NI = lambda : int(sys.stdin.readline())

    H,W = LI()
    f = [[0] * W for _ in range(H)]
    q = collections.deque()
    for i in range(H):
        for j,x in enumerate(sys.stdin.readline().rstrip()):
            if x == '#':
                f[i][j] = 1
                q.append((i,j,0))
    ans = 0
    while q:
        y,x,c = q.popleft()
        ans = max(ans,c)
        for dy,dx in ((0,1),(1,0),(-1,0),(0,-1)):
            if 0 <= x+dx < W and 0 <= y+dy < H:
                if f[y+dy][x+dx] == 0:
                    f[y+dy][x+dx] = 1
                    q.append((y+dy,x+dx,c+1))
    print(ans)

if __name__ == '__main__':
    main()
n=int(input())

x=[[int(i) for i in input().split()] for i in range(n)]
#print(x)

x.reverse()

def hight(a,b,x,y,z):
  h=z+abs(x-a)+abs(y-b)
  return h

ans=0

for k in range(101):
  for l in range(101):
    flag=0
    for i in range(1,n):
      if hight(k,l,x[0][0],x[0][1],x[0][2])==hight(k,l,x[i][0],x[i][1],x[i][2]):
        flag+=1 
    if flag==n-1:
      ans1=k
      ans2=l
      ans3=hight(k,l,x[0][0],x[0][1],x[0][2])

print(ans1,ans2,ans3)

### FIXED CODE ###

n=int(input())

x=[[int(i) for i in input().split()] for i in range(n)]
#print(x)
cnt=0
for m in range(n):
  if x[m][2]>0:
    cnt+=1
    ii=m
    
#print(ii,cnt)

def hight(a,b,x,y,z):
  h=z+abs(x-a)+abs(y-b)
  return h

for i in range(101):
  for j in range(101):
    flag=0
    for k in range(n):
      if x[k][2]>0:
        if hight(i,j,x[ii][0],x[ii][1],x[ii][2])==hight(i,j,x[k][0],x[k][1],x[k][2]):
          flag+=1
      else:
        if hight(i,j,x[ii][0],x[ii][1],x[ii][2]) > hight(i,j,x[k][0],x[k][1],x[k][2]):
          flag=0
     
    if flag==cnt:
      ans1=i
      ans2=j
      ans3=hight(i,j,x[ii][0],x[ii][1],x[ii][2])
      
print(ans1,ans2,ans3)
#print(flag)
N, K = map(int, input().split())

if K%2 == 1:
  cand = N // K
  print(int(cand + comb(cand,2) * 6 + comb(cand,3) * 6))
else:
  cand_mod0 = N // K
  ans_mod0 = cand_mod0\
           + cand_mod0 * (cand_mod0-1) * 3\
           + cand_mod0 * (cand_mod0-1) * (cand_mod0-2)
  cand_modhalf = N // K if N % K < K / 2 else (N // K) + 1
  ans_modhalf = cand_modhalf\
           + cand_modhalf * (cand_modhalf-1) * 3\
           + cand_modhalf * (cand_modhalf-1) * (cand_modhalf-2)
  print(int(ans_mod0 + ans_modhalf))

### FIXED CODE ###

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

if K%2 == 1:
  cand = N // K
  ans = cand\
      + cand * (cand-1) * 3\
      + cand * (cand-1) * (cand-2)
  print(int(ans))
else:
  cand_mod0 = N // K
  ans_mod0 = cand_mod0\
           + cand_mod0 * (cand_mod0-1) * 3\
           + cand_mod0 * (cand_mod0-1) * (cand_mod0-2)
  cand_modhalf = N // K if N % K < K / 2 else (N // K) + 1
  ans_modhalf = cand_modhalf\
           + cand_modhalf * (cand_modhalf-1) * 3\
           + cand_modhalf * (cand_modhalf-1) * (cand_modhalf-2)
  print(int(ans_mod0 + ans_modhalf))
import bisect
import numpy as np
n = int(input())
abc = [sorted(list(map(int, input().split()))) for i in range(3)]

unko = np.zeros(n)
for c in abc[2]:
  unko[:bisect.bisect_left(abc[1], c)] += 1
s = 0

print()
for i in range(len(abc[1])):
  s += bisect.bisect_left(abc[0], abc[1][i])*unko[i]
  
print(int(s))

### FIXED CODE ###

import bisect
n = int(input())
abc = [sorted(list(map(int, input().split()))) for i in range(3)]
print(sum([bisect.bisect_left(abc[0], b)*(n-bisect.bisect_right(abc[2], b)) for b in abc[1]]))
N = int(input())
K = int(input())
win = []
win[0] = 0
point = 0
for i in range(1,N+1):
  for j in range(1,K):
    if  i**j >= K:
      win[i] = (1/N)*{(1/2)**j}
      i += 1
    else:
      j += 1
ans = sum(win)
print(ans)

### FIXED CODE ###

N,K = map(int,input().split())
ans = 0
for i in range(1,N+1):
  j = 0
  point = i
  while point < K:
    point *= 2
    j += 1
  ans += (1/N)*(0.5**j)
print(ans)
N, *S = map(open(0).read().split())
print(len(set(S))

### FIXED CODE ###

N = int(input())
S = list()
for i in range(N):
  x = input()
  S.append(x)
  
A = set(S)
print(len(A))
S = input()
s_len = len(S)
ans = [0 for _ in range(s_len)]

def L_checker(n):
    if n+1 == s_len:
        return s_len

    for i in range(n+1,s_len):
        if S[i]=='R':
            return i
    return s_len


def check(n, r_count):
    if S[n]=='R':
        check(n+1, r_count+1)
    else:
        next_r = L_checker(n)
        total = r_count+next_r-n
        if (total)%2==0:
            ans[n-1]=int((total)/2)
            ans[n]=int((total)/2)
        elif r_count%2==1:
            ans[n-1]=int((total)//2)+1
            ans[n]=int((total)//2)
        else:
            ans[n-1]=int((total)//2)
            ans[n]=int((total)//2)+1
        if next_r == s_len:
            print(*ans)
        else:
            check(next_r,0)

check(0,0)

### FIXED CODE ###

S = str(input())
s_len = len(S)
ans = [0 for _ in range(s_len)]
r_count = 0
l_count = 0
before = 0
switch = 'R'


for i in range(s_len):
    if S[i]==switch:
        if switch == 'R':
            r_count += 1
        else:
            l_count += 1
    else:
        if switch == 'L':
            switch = 'R'
            if (r_count+l_count)%2 == 0:
                ans[before] = (r_count+l_count)//2
                ans[before-1] = (r_count+l_count)//2
            elif r_count%2 == 0:
                ans[before] = (r_count+l_count)//2+1
                ans[before-1] = (r_count+l_count)//2
            else:
                ans[before] = (r_count+l_count)//2
                ans[before-1] = (r_count+l_count)//2+1
            r_count = 1
            l_count = 0
        else:
            switch = 'L'
            before = i
            l_count = 1


if (r_count+l_count)%2 == 0:
    ans[before] = (r_count+l_count)//2
    ans[before-1] = (r_count+l_count)//2
elif r_count%2 == 0:
    ans[before] = (r_count+l_count)//2+1
    ans[before-1] = (r_count+l_count)//2
else:
    ans[before] = (r_count+l_count)//2
    ans[before-1] = (r_count+l_count)//2+1

print(*ans)
a,b,c = map(int,input().split(" "))
if a == b:
    if a == c:
        print("No")
    else:
        print("Yes")
else
    if b == c:
        print("Yes")
    else:
        if a == c:
            print("Yes")
        else:
            print("No")

### FIXED CODE ###

a,b,c = map(int,input().split(" "))
if a == b:
    if a == c:
        print("No")
    else:
        print("Yes")
else:
    if b == c:
        print("Yes")
    else:
        if a == c:
            print("Yes")
        else:
            print("No")
N,Q = map(int, input().split())
S = input()
C = [tuple(map(str, input().split())) for _ in range(Q)]
C = C[::-1]

left = -1
right = N

for (t,d) in C:
  if ('L' == d):
    if (S[left+1] == t):
      left += 1
      if (N <= left):
        print(0)
        exit()
    if (right < N):
      if (S[right] == t):
        right += 1
        if (N < right):
          right = N
  else:
    if (S[right-1] == t):
      right -= 1
      if (right <= -1):
        print(0)
        exit()
    if (-1 < left):
      if (S[left] == t):
        left -= 1
        if (left < -1):
          left = -1

print(right - left - 1)


### FIXED CODE ###

N,Q = map(int, input().split())
S = input()
C = [tuple(map(str, input().split())) for _ in range(Q)]
C = C[::-1]

left = -1
right = N

for (t,d) in C:
  if ('L' == d):
    if (S[left+1] == t):
      left += 1
      if (N-1 <= left):
        print(0)
        exit()
    if (right < N):
      if (S[right] == t):
        right += 1
        if (N < right):
          right = N
  else:
    if (S[right-1] == t):
      right -= 1
      if (right <= 0):
        print(0)
        exit()
    if (-1 < left):
      if (S[left] == t):
        left -= 1
        if (left < -1):
          left = -1

print(right - left - 1)
a,b,c = map(int,input().split())

if a = b = c :
  print('No')
else:
  print('Yes')

### FIXED CODE ###

a,b,c = map(int,input().split())
if a == b == c == a:
  print('No')
elif a == b or b == c or a == c:
  print('Yes')
else:
  print('No')
#C - Stones
#黒い石のすぐ右に白い石があるような箇所がないようにしたいです。 

n = int(input())
state = input()
state_list = list(state)
prob_num = 0
state_list.append(" ")
for i in range(n):
	if state_list[i] == "#" and state_list[i+1] == ".":
		prob_num += 1

state_list.remove(" ")
black = state_list.count("#")
white = state_list.count(".")
min_stone = min(black, white)

if min_stone > prob_num:
	if state_list[-1] == "#":
		print(min_ - 1)
	else:
		print(min_)
else:
	print(prob_num)

### FIXED CODE ###

#毎回関数を呼ぶとおそくなる
n = int(input())
stones = input()
score = stones.count(".")
r = score
for i in range(n):
	if stones[i] == ".":
		r -= 1
	else:
		r += 1
	score = min(r, score)
print(score)
N = int(input())
l = [int(i) for i in input().split()]
count = 0
total = 1
for i in l:
    total *= i
while total%2==0:
    total /= 2
    count += 1
print(count)


### FIXED CODE ###

N = int(input())
l = [int(i) for i in input().split()]
count = 0
for i in l:
    while i % 2 == 0:
        i /= 2
        count += 1
print(count)
import math
ary1 = [int(input()) for x in range(5)]
ans = sum(10*math.ceil(x/10) for x in ary1) - max([10-(y % 10) for y in ary1 if y % 10 !=0])
print(ans)

### FIXED CODE ###

import math
ary1 = [int(input()) for x in range(5)]
x1 = sum(10*math.ceil(x/10) for x in ary1)
x2 = max([10-(y % 10) if y % 10 !=0 else 0 for y in ary1 ])
ans = x1 - x2
print(ans)
n,m,k=map(int,input().split())
A=list(map(int,input().split()))
B=list(map(int,input().split()))
i=0
j=0
time=0
while time<k:
    if A[i]<=B[j]:
        time+=A[i]
        i+=1
    elif A[i]>B[j]:
        time+=B[j]
        j+=1
print(i+j-1)

### FIXED CODE ###

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

a=[0]
b=[0]
for i in range(n):
  a.append(a[i]+A[i])
for i in range(m):
  b.append(b[i]+B[i])
ans=0
j=m
for i in range(n+1):
  if a[i]>k:
    break
  while a[i]+b[j]>k:
    j-=1
  ans=max(ans,i+j)
print(ans)
N,A,B= map(int,input().split())
count = 0
for A in range(N):
  for B in range(N):
    if A[0:] == B[:-1] and A[:-1] == B[0]:
      count += 1
print(count)

### FIXED CODE ###

N = int(input())
count = [10*[0]for _ in range(10)]
ans = 0
for i in range(1,N+1):
  s = str(i)
  if s[0] == '0' or s[-1] == '0':
    pass
  else:
    count[int(s[0])][int(s[-1])] += 1
for j in range(1,10):
  for k in range(1,10):
    ans += count[j][k]*count[k][j]
print(ans)
class UnionFind():
    def __init__(self, n):
        self.n = n
        self.parents = [-1] * n

    def find(self, x):
        if self.parents[x] < 0:
            return x
        else:
            self.parents[x] = self.find(self.parents[x])
            return self.parents[x]

    def union(self, x, y):
        x = self.find(x)
        y = self.find(y)

        if x == y:
            return

        if self.parents[x] > self.parents[y]:
            x, y = y, x

        self.parents[x] += self.parents[y]
        self.parents[y] = x

    def size(self, x):
        return -self.parents[self.find(x)]

    def same(self, x, y):
        return self.find(x) == self.find(y)

    def members(self, x):
        root = self.find(x)
        return [i for i in range(self.n) if self.find(i) == root]

    def roots(self):
        return [i for i, x in enumerate(self.parents) if x < 0]

    def group_count(self):
        return len(self.roots())

    def all_group_members(self):
        return {r: self.members(r) for r in self.roots()}

    def __str__(self):
        return '\n'.join('{}: {}'.format(r, self.members(r)) for r in self.roots())

    
from sys import stdin
imput = stdin.readline
n,m = map(int, input().split())  # 3個の数字の入力を受け取る
uf = UnionFind(n)
#print(uf.parents)

num_list = []
for i in range(m):
    num_list.append(list(map(int,input().split())))
#print(num_list)
for i in range(m):
    uf.union(num_list[i][0], num_list[i][1])
print(uf.group_count()-1)

### FIXED CODE ###

class UnionFind():
    def __init__(self, n):
        self.n = n
        self.parents = [-1] * n

    def find(self, x):
        if self.parents[x] < 0:
            return x
        else:
            self.parents[x] = self.find(self.parents[x])
            return self.parents[x]

    def union(self, x, y):
        x = self.find(x)
        y = self.find(y)

        if x == y:
            return

        if self.parents[x] > self.parents[y]:
            x, y = y, x

        self.parents[x] += self.parents[y]
        self.parents[y] = x

    def size(self, x):
        return -self.parents[self.find(x)]

    def same(self, x, y):
        return self.find(x) == self.find(y)

    def members(self, x):
        root = self.find(x)
        return [i for i in range(self.n) if self.find(i) == root]

    def roots(self):
        return [i for i, x in enumerate(self.parents) if x < 0]

    def group_count(self):
        return len(self.roots())

    def all_group_members(self):
        return {r: self.members(r) for r in self.roots()}

    def __str__(self):
        return '\n'.join('{}: {}'.format(r, self.members(r)) for r in self.roots())

    
from sys import stdin
imput = stdin.readline
n,m = map(int, input().split())  # 3個の数字の入力を受け取る
uf = UnionFind(n)
#print(uf.parents)

num_list = []
for i in range(m):
    num_list.append(list(map(int,input().split())))
#print(num_list)
for i in range(m):
    #print(num_list[i][0])
    #print(num_list[i][1])
    uf.union(num_list[i][0]-1, num_list[i][1]-1)
    #print(uf.parents)
print(uf.group_count()-1)
n = int(input())
s = str(input())

a = s[0:s.rfind('.')].count('#')
b = s[s.find('#'):n].count('.')
c = 0

for i in range(n//2):
  if s[i] == "#" and s[i:n].find('.') != -1:
    c += 1
  if s[n-i] == "." and s[i:n].find('#') != -1:
    c += 1
    
ans = min([a, b, c])
print(ans)


### FIXED CODE ###

n = int(input())
s = str(input())
k = [s.count('.')]

for i in range(n):
  if s[i] == "#":
    k.append(k[i]+1)
  else:
    k.append(k[i]-1)
    
print(min(k))