Harryxun/stf_run huggingface dataset:
M=int(input())
N=int(input())

count=0

if M >= 2:
    x=M*(M-1)
    print("M",x)
    count=x/2

if N >= 2:
    x=N*(N-1)
    print("N",x)
    count=x/2 + count

print(int(count))

### FIXED CODE ###

IN=input()
M=int(IN.split(" ")[0])
N=int(IN.split(" ")[1])

count=0

if M >= 2:
    x=M*(M-1)
    count=x/2

if N >= 2:
    x=N*(N-1)
    count=x/2 + count

print(int(count))
N = int(input())
L = int(input().split())
L2 = set(L) # 重複を削除

ans = 0

for i in len(L2):
  for j in range(i+1, len(L2)):
    for k in range(i+2, len(L2)):
      l = [L2[i], L2[j], L2[k]]
      l = sorted(l, reverse = True)
      if l[0] < l[1] + l[2]:
        ans += L.count(L2[i]) * L.count(L2[j]) * L.count(L2[k])

print(ans)      
    


### FIXED CODE ###

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

L2 = list(set(L)) # 重複を削除

ans = 0

for i in range(len(L2)):
  for j in range(i+1, len(L2)):
    for k in range(j+1, len(L2)):
      l = [L2[i], L2[j], L2[k]]
      l = sorted(l, reverse = True)
      if l[0] < l[1] + l[2]:
        ans += L.count(L2[i]) * L.count(L2[j]) * L.count(L2[k])

print(ans)
def gcd(m,n):
    while n:
        m,n = n, m%n
    return m
n = int(input())
m = map(int,input().split())
ans = m[0]
for i in range(1,n):
    ans = gcd(m[i],ans)
print(ans)

### FIXED CODE ###

def gcd(m,n):
    while n:
        m,n = n, m%n
    return m
n = int(input())
m = list(map(int,input().split()))
ans = m[0]
for i in range(1,n):
    ans = gcd(m[i],ans)
print(ans)
N, M = map(int, input().split())
AB = [list(map(int, input().split())) for _ in range(M)]
ans = [0] * M

parent = [-1] * (N + 1)
size = [1] * (N + 1)
combi = N * (N - 1) // 2
count = 0

def get_parent(a):
    global parent
    temp = parent[a]
    if temp == -1:
        return a
    else:
        temp = get_parent(temp)
        parent[a] = temp
        return temp

def union(a, b):
    global count, size
    parent_a = get_parent(a)
    parent_b = get_parent(b)

    if parent_a != parent_b:
        parent[parent_b] = parent_a
        count -= size[parent_a] * (size[parent_a] - 1) // 2
        count -= size[parent_b] * (size[parent_b] - 1) // 2
        size[parent_a] += size[parent_b]
        count += size[parent_a] * (size[parent_a] - 1) // 2

for i in range(M - 1, -1, -1):
    ans[i] = combi - count

    a, b = AB[i]
    union(a, b)

for temp in ans:
    print(temp)




### FIXED CODE ###

import sys
sys.setrecursionlimit(100000)

N, M = map(int, input().split())
AB = [list(map(int, input().split())) for _ in range(M)]
ans = [0] * M

parent = [-1] * (N + 1)
size = [1] * (N + 1)
combi = N * (N - 1) // 2
count = 0

def get_parent(a):
    global parent
    temp = parent[a]
    if temp == -1:
        return a
    else:
        temp = get_parent(temp)
        parent[a] = temp
        return temp

def union(a, b):
    global count, size
    parent_a = get_parent(a)
    parent_b = get_parent(b)

    if parent_a != parent_b:
        parent[parent_b] = parent_a
        count -= size[parent_a] * (size[parent_a] - 1) // 2
        count -= size[parent_b] * (size[parent_b] - 1) // 2
        size[parent_a] += size[parent_b]
        count += size[parent_a] * (size[parent_a] - 1) // 2

for i in range(M - 1, -1, -1):
    ans[i] = combi - count

    a, b = AB[i]
    union(a, b)

for temp in ans:
    print(temp)
A,B,K = map(int,input().split())

a = 0
b = 0


    if A >= K :
        a = A-K
    elif  (A + B) > K:
        a = 0
        b = B-(K-A)
    elif  (A + B)  < K:
        a = 0
        b = 0


print(a,b,end='')


### FIXED CODE ###

A,B,K = map(int,input().split())

a = 0
b = 0

if A <= 10**12 and B <=10**12 and K <= 10**12:
    if A >= K :
        a = A-K
        b = B
    elif  (A + B) >=K:
        a = 0
        b = B-(K-A)
    elif  (A + B)  < K:
        a = 0
        b = 0
else :
    a = 0
    b = 0

print(a,b,end='')
n, q = map(int, input().split())

e = [list(map(int, input().split())) for _ in range(n-1)]
cm = [list(map(int, input().split())) for _ in range(q)]
parent = [-1]*n
child = [[]]*n
counter = [0]*n

for i, v in cm:
  counter[i-1] += v

parent[0] = 0
for a, b in e:
  if parent[a-1]<0:
    parent[a-1] = b-1
    child[b-1] = child[b-1] + [a-1]
  else:
    parent[b-1] = a-1
    child[a-1] = child[a-1] + [b-1]

cum_counter = [0]*n
def check(i, cum_cnt):
  cum_cnt += counter[i]
  cum_counter[i] = cum_cnt
  if len(child[i])>0:
    for c in child[i]:
      check(c, cum_cnt)

check(0, 0)
print(*cum_counter)

### FIXED CODE ###

#138_D
import sys
input = sys.stdin.buffer.readline
sys.setrecursionlimit(10 ** 6)

n, q = map(int, input().split())

edges = [[] for _ in range(n)]
cnt = [0 for _ in range(n)]

for _ in range(n-1):
    a, b = map(int, input().split())
    edges[a-1].append(b-1)
    edges[b-1].append(a-1)
    
for _ in range(q):
    p, x = map(int, input().split())
    cnt[p-1] += x
    
def dfs(frm, cur):
    for to in edges[cur]:
        if to != frm:
            cnt[to] += cnt[cur]
            dfs(cur, to)
dfs(-1, 0)          
print(*cnt)
N=int(input())
v=list(map(int,input().split()))
c=list(map(int,input().split()))
d=[]
for i in N-1:
  m=v[i]-c[i]
  if m>0:
    d.append(m)
print(sum(d))

### FIXED CODE ###

N=int(input())
v=list(map(int,input().split()))
c=list(map(int,input().split()))
d=[]
for i in range(N):
  m=v[i]-c[i]
  if m>0:
    d.append(m)
print(sum(d))
n,q=map(int,input().split())
edge=[[] for _ in range(n)]
for i in range(n-1):
    x,y=map(int,input().split())
    edge[x-1].append(y-1)
    edge[y-1].append(x-1)
ans=[0]*n
for i in range(q):
    p,x=map(int,input().split())
    ans[p-1]+=x
def dfs(c,p):
    for i in edge[c]:
        if i==p:
            continue
        ans[i]+=ans[c]
        dfs(i,c)
dfs(0,-1)
print(*ans)

### FIXED CODE ###

import sys
sys.setrecursionlimit(10**7)
n,q=map(int,input().split())
edge=[[] for _ in range(n)]
for i in range(n-1):
    x,y=map(int,input().split())
    edge[x-1].append(y-1)
    edge[y-1].append(x-1)
ans=[0]*n
for i in range(q):
    p,x=map(int,input().split())
    ans[p-1]+=x
def dfs(c,p):
    for i in edge[c]:
        if i==p:
            continue
        ans[i]+=ans[c]
        dfs(i,c)
dfs(0,-1)
print(*ans)
from heapq import *

def calcInk(wdt,val):
    maxval=val[-1]
    histnum=maxval//wdt
    hist=[]
    for i in range(histnum+1):
        hist.append([])
    vl=len(val)
    for i in range(vl):
        v=heappop(val)
        hist[v//wdt].append(v)
    
    highest=0
    for i in range(len(hist)):
        highest=max(highest,len(hist[i]))
    ink=0
    for i in range(len(hist)):
        ink+=(1-i/histnum)*(len(hist[i])/highest)
    return ink+0.01

if __name__=='__main__':
    while True:
        n,w=map(int,input().split())
        if n==w==0:
            break
        V=[]
        for _ in range(n):
            heappush(V,int(input()))
        print(calcInk(w,V))




### FIXED CODE ###

while 1:
    n,w=map(int,input().split())
    if n==w==0:break
    a=[0]*100
    s=h=int(0)
    while n:
        b=int(input())
        a[b//w]+=1
        s=max(s,b//w)
        h=max(h,a[b//w])
        n-=1
    ans=0.01
    for i in range(int(s)+1):
        ans+=a[i]/h*(s-i)/s
    print(ans)
def gu(n,a):
  ans=[0]*n
  for i in range(len(a)):
    ii=a[i]
    while True:
      if ii%2==0:
        ans[i]+=1
        ii=ii/2
      else:
        break
  return ans.min()
n=int(input())
a=list(map(int,input().split()))
print(gu(n,a))

### FIXED CODE ###

def count_1(a):
  c=0
  for i in a:
    if i=="1":
      c+=1
  else:
    return c
a=input()
print(count_1(a))
#Deven-Eleven:
import re
D = (((-1, -1), (0, -1), (1, 0), (0, 1), (-1, 1), (-1, 0)),
     ((0, -1), (1, -1), (1, 0), (1, 1), (0, 1), (-1, 0)))
def func(y, x):
    q = [(y, x, 0)]
    cover = [[-1] * m for _ in xrange(n)]
    while len(q) != 0:
        y, x, step = q.pop(0)
        if cover[y][x] >= 0:
            continue
        cover[y][x] = step
        for dx, dy in D[y % 2]:           
            ny, nx = y + dy, x + dx
            if 0 <= ny < n and 0 <= nx < m:
                q.append((ny, nx, step + 1))
    return cover
 
def solve():
    scover = [func(pos[1] - 1, pos[0] - 1) for pos in spos]
    min_cover = [[min(sc[y][x] for sc in scover) for x in xrange(m)] for y in xrange(n)]
    def count(cover):
        ret = 0
        for y in xrange(n):
            for x in xrange(m):
                if cover[y][x] < min_cover[y][x]:
                    ret += 1
        return ret
    return max(count(func(pos[1] - 1, pos[0] - 1)) for pos in tpos)

while True:
    data = raw_input().sprit()
    if data == "0 0":
        break
    m, n = map(int, data.split())
    s = input()
    spos = [map(int, raw_input().split()) for _ in xrange(s)]
    t = input()
    tpos = [map(int, raw_input().split()) for _ in xrange(t)]
    print solve()

### FIXED CODE ###

#Deven-Eleven:
D = (((-1, -1), (0, -1), (1, 0), (0, 1), (-1, 1), (-1, 0)),
     ((0, -1), (1, -1), (1, 0), (1, 1), (0, 1), (-1, 0)))
def func(y, x):
    q = [(y, x, 0)]
    cover = [[-1] * m for _ in xrange(n)]
    while len(q) != 0:
        y, x, step = q.pop(0)
        if cover[y][x] >= 0:
            continue
        cover[y][x] = step
        for dx, dy in D[y % 2]:           
            ny, nx = y + dy, x + dx
            if 0 <= ny < n and 0 <= nx < m:
                q.append((ny, nx, step + 1))
    return cover
 
def solve():
    scover = [func(pos[1] - 1, pos[0] - 1) for pos in spos]
    min_cover = [[min(sc[y][x] for sc in scover) for x in xrange(m)] for y in xrange(n)]
    def count(cover):
        ret = 0
        for y in xrange(n):
            for x in xrange(m):
                if cover[y][x] < min_cover[y][x]:
                    ret += 1
        return ret
    return max(count(func(pos[1] - 1, pos[0] - 1)) for pos in tpos)

while True:
    data = raw_input()
    m, n = map(int, data.split())
    if m == 0:
        break
    s = input()
    spos = [map(int, raw_input().split()) for _ in xrange(s)]
    t = input()
    tpos = [map(int, raw_input().split()) for _ in xrange(t)]
    print solve()
num = raw_input()

for i in range(int(num)):
    a = raw_input()
    num_list.append(int(a))

min_ans = num_list[0]
max_ans = float("-inf")
for item in num_list[1:]:
    if i - min_ans > max_ans:
        max_ans = i - min_ans
    if i < min_ans:
        min_ans = i

print max_ans

### FIXED CODE ###

num = raw_input()
num_list = []
for i in range(int(num)):
    a = raw_input()
    num_list.append(int(a))

min_ans = num_list[0]
max_ans = float("-inf")
for i in num_list[1:]:
    if i - min_ans > max_ans:
        max_ans = i - min_ans
    if i < min_ans:
        min_ans = i

print max_ans
def xor(A,B):
    ruijo=[]
    now=1
    for j in range(51):
        ruijo.append(now)
        now*=2
    Astr=bin(A)[2:]
    Bstr=bin(B)[2:]
    Astr='0'*(len(Bstr)-len(Astr))+Astr
    ans=0
    for i in range(1,len(Astr)+1):
        if Astr[-1*i]!=Bstr[-1*i]:
            ans+=ruijo[i-1]
    return ans
def fun(x):
    if x%2==0:res=x+1
    elif x%2==1:res=x-1
    ans=[x,1,res,0]
    return ans[x%4]
A,B=map(int,input().split())
if A==B:print(A)
elif A==0:print(fun(B))
else:
    print(xor(fun(A-1),fun(B)))

### FIXED CODE ###

def xor(A,B):
    ruijo=[]
    now=1
    for j in range(51):
        ruijo.append(now)
        now*=2
    Astr=bin(A)[2:]
    Bstr=bin(B)[2:]
    Astr='0'*(max(len(Astr),len(Bstr))-len(Astr))+Astr
    Bstr='0'*(max(len(Astr),len(Bstr))-len(Bstr))+Bstr
    ans=0
    for i in range(1,len(Astr)+1):
        if Astr[-1*i]!=Bstr[-1*i]:
            ans+=ruijo[i-1]
    return ans
def fun(x):
    if x%2==0:res=x+1
    elif x%2==1:res=x-1
    ans=[x,1,res,0]
    return ans[x%4]
A,B=map(int,input().split())
if A==B:print(A)
elif A==0:print(fun(B))
else:
    print(xor(fun(A-1),fun(B)))
a=int(input().split())
for i in range(4):
 if a[i]==0:
  print(i)
 else
  pass

### FIXED CODE ###

a=[]
a=input().split()
for i in range(5):
 if a[i]=='0':
   print(str(i+1))
 else:
   pass
import fractions

A, B = map(int, input().split())

g = fractions.gcd(A, B)

C = []

for j in range(2, i+1):
    i = g
    while True:
        if i%j == 0:
            i //= j
            C.append(j)
        else:
            break

print(len(set(C))+1)

### FIXED CODE ###

import fractions

A, B = map(int, input().split())

x = fractions.gcd(A, B)

C = []

def cal(i):
    for j in range(2, int(-(-i**0.5//1))+1):
        while True:
            if i%j == 0:
                i //= j
                C.append(j)
            else:
                break
    if i != 1:
        C.append(i)
        
    return set(C)

print(1+len(cal(x)))
from sys import stdin
#n = int(stdin.readline().rstrip())
n,k = map(int, stdin.readline().rstrip().split())
#S = [list(map(int, stdin.readline().rstrip().split())) for _ in range(h)]#hの定義を忘れずに
p = list(map(int, stdin.readline().rstrip().split()))

l = []
for i in range(n):
    s = 0
    d = p[i]
    for j in range(d):
        s += 1+j
    l.append(s/d)

ans = 0
for i in range(k):
    sums = [l[i+j] for j in range(k)]
    ans = max(sum(sums), ans)
print(ans)


### FIXED CODE ###

from sys import stdin
#n = int(stdin.readline().rstrip())
#l = list(map(int, stdin.readline().rstrip().split()))
N,K = map(int, stdin.readline().rstrip().split())
P = list(map(int, stdin.readline().rstrip().split()))

Q = [(p+1)/2 for p in P]
c = [0]
for q in Q:
    c.append(c[-1] + q)

ans = 0
for i in range(K,N+1):
    ans = max(ans, c[i] - c[i-K])
print(ans)
import factorial from math
n,a,b = map(int,input().split())

mod = 10**9+7
def modinv(a, mod=10**9+7):
    return pow(a, mod-2, mod)


c = pow(2,n,mod)
c -= 1
c -= ( factorial(n) * modinv(factorial(a)) )%mod * modinv(factorial(n-a)) % mod
c -= ( factorial(n) * modinv(factorial(b)) )%mod * modinv(factorial(n-b)) % mod
print(c%mod)

### FIXED CODE ###

n,a,b = map(int,input().split())

mod = 10**9+7
def modinv(a, mod=10**9+7):
    return pow(a, mod-2, mod)

def com(n,k,mod=10**9+7):
    u = 1
    s = 1
    for i in range(n,n-k,-1):
        u = u*i % mod
    for i in range(k,0,-1):
        s = s*i % mod
    return u * modinv(s)

c = pow(2,n,mod)
c -= 1
c -= com(n,a)
c -= com(n,b)
print(c%mod)
# -*- coding: utf-8 -*-
x,k,d=map(int,input().split())
m=abs(x)
if x<0:
  for i in range(k):
    x+=d
    if abs(x)<m:
      m=abs(x)
    else:
      n=k-i
      break
  if n%2==0:
    print(m)
  else:
    print(abs(x))
else:
  for i in range(k):
    x-=d
    if abs(x)<m:
      m=abs(x)
    else:
      n=k-i
      break
  if n%2==0:
    print(m)
  else:
    print(abs(x))

### FIXED CODE ###

# -*- coding: utf-8 -*-
x,k,d=map(int,input().split())
m=abs(x)
n=m//d
j=k-n
if j>0:
  if x<0:
    if j%2==0:
      x+=d*n
    else:
      x+=d*(n+1)
  else:
    if j%2==0:
      x-=d*n
    else:
      x-=d*(n+1)
else:
  if x<0:
    x+=d*k
  else:
    x-=d*k
print(abs(x))
import numpy as np
N = int(input())
h = list(map(int,input().split()))

memo = np.zeros(N) - 1
memo[0] = 0
memo[1] = abs(h[1] - h[0])

def search(i):
  if memo[i] != -1:
    return memo[i]
  
  c1 = search(i-1) + abs(h[i]-h[i-1])
  c2 = search(i-2) + abs(h[i]-h[i-2])
  memo[i] = min(c1,c2)
  return min(c1,c2)

print(int(search(N-1)))

### FIXED CODE ###

import numpy as np
import sys
sys.setrecursionlimit(10**6)

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

memo = np.zeros(N) - 1

def search(i):
  if i == 0:
    return 0
  elif i == 1:
    return abs(h[i] - h[i-1])
  if memo[i] != -1:
    return memo[i]
  
  c1 = search(i-1) + abs(h[i]-h[i-1])
  c2 = search(i-2) + abs(h[i]-h[i-2])
  memo[i] = min(c1,c2)
  return min(c1,c2)

print(int(search(N-1)))
import numpy as np

temp=list(map(int, input().split()))
N=temp[0]
Q=temp[1]

matrix=np.zeros((N, N), dtype=int)
for i in range(N):
  matrix[i, i]=1

for i in range(N-1):
  temp=list(map(int, input().split()))
  matrix[int(temp[0]-0.5), int(temp[1]-0.5)]=1
  
index=int(N-0.5)
while index>=0:
  matrix[index, :]+=np.sum(matrix*matrix[index, :].reshape(-1, 1), axis=0)
  index=int(index-0.5)
  
matrix[matrix>0]=1

counter=np.zeros(N, dtype=int)
for i in range(Q):
  temp=list(map(int, input().split()))
  counter+=matrix[int(temp[0]-0.5), :]*temp[1]
  
print(' '.join(map(str, map(int, counter.tolist()))))

### FIXED CODE ###

import sys
sys.setrecursionlimit(10**6)

def input():
  return sys.stdin.readline()[:-1]

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

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

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

counter=[0]*(N+1)
for i in range(Q):
  counter[px[i][0]]+=px[i][1]
  
def f(num, prenum=-1, p=0):
  counter[num]+=p
  for postnum in link[num]:
    if postnum==prenum:
      continue
    f(postnum, num, counter[num])
    
f(1)

print(*counter[1:])
n, x = map(int, input().split())
l = [int(x) for x in input().split()]

c = 1
d = 0
for i in range(n+1):
    d = d + l[i]
    if d > x:
        break
    c += 1
print(c)

### FIXED CODE ###

n, x = map(int, input().split())
l = [int(x) for x in input().split()]

c = 1
d = 0
for i in range(n):
    d = d + l[i]
    if d > x:
        break
    c += 1
print(c)
N,M,X=list(map(int,input().split()))
lines = []

for i in range(N):
	lines.append(list(map(int,input().split())))
pricemin = 1500000
for i in range(2**N):
	price = 0
	count = 0
	A = [0]*M
	for j in range(N):
		if ((i >> j) & 1):
			for k in range(M):
				A[k] += lines[j][k+1]
			price += lines[j][0]
	for j in range(M):
		if A[j] >= X:
			count += 1
	if count == M and pricemin > price:
		pricemin = price
if pricemin == 1500000:
	print('-1')
else:
	print(pricemin)
			
	



### FIXED CODE ###

S = input()
T = input()
N = len(T)
T2 = T[0:N-1]
if S == T2:
	print('Yes')
else:
	print('No')
n=int(input())
A=list(map(int,input().split()))
ans=10**15
for i in[-1,1]:
    ansi,sum=0,0
    for a in A:
        sum+=a
        if sum*i<=0:;ansi+=abs(sum-i);sum=i
        i*=-1
    ans=min(ans,ansi)
print(ans)

### FIXED CODE ###

n=int(input())
A=list(map(int,input().split()))
ans=10**15
for i in[-1,1]:
    ansi,sum=0,0
    for a in A:
        sum+=a
        if sum*i<=0:ansi+=abs(sum-i);sum=i
        i*=-1
    ans=min(ans,ansi)
print(ans)
n = int(input)
a = list(map(int, input().split()))
b = list(map(int, input().split()))
for i in range(n):
  if a[i] > b[i]:
    print('No')
    sys.exit(0)
print('Yes')

### FIXED CODE ###

n = int(input())
a = list(map(int, input().split()))
b = list(map(int, input().split()))
c = 0
d = 0
for i in range(n):
  if b[i] > a[i]:
    c += (b[i] - a[i]) // 2
  else:
    d += a[i] - b[i]
print(['Yes', 'No'][c < d])
da = list(map(int,input().split()))

k = [[0 for i in range(2)]for j in range(10001)]

i = 0

su = 0

j = 0

while da[0] != 0 and da[1] != 0:

	i = 0
	su = 0
	j = 0
	for i in range(da[0]):
		k[i][0],k[i][1] = list(map(int,input().split()))
		su += k[i][0] * k[i][1]


	sorted(k,key = lambda x: x[1],reverse = True)
	while da[1] != 0 or j != i:
		if da[1] >= k[j][0]:
			su -= k[j][0] * k[j][1]
			da[1] -= k[j][0]
			j += 1

		elif da[1] < k[j][0]:
			su -= da[1] * k[j][1]
			da[1] = 0

	print(su)

	da = list(map(int,input().split()))
	if da[0] == 0 and da[1] == 0:
		break
	k = [[0 for i in range(2)]for j in range(10001)]



### FIXED CODE ###

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

k = [[0 for i in range(2)]for j in range(10001)]
i = 0
su = 0
j = 0

while da[0] + da[1] != 0:
	i = 0
	su = 0
	j = 0
	for i in range(da[0]):
		k[i][0],k[i][1] = map(int,input().split())


	k = sorted(k,key = lambda x: x[1],reverse = True)

	while j != i + 1:
		if da[1] > k[j][0]:
			da[1] -= k[j][0]
			j += 1
		elif da[1] <= k[j][0] and da[1] > 0:
			su += (k[j][0] - da[1]) * k[j][1]
			da[1] = 0
			j += 1
		else:
			su += k[j][0] * k[j][1]
			j += 1

	print(su)

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

	k = [[0 for i in range(2)]for j in range(10001)]
from collections import Counter

n = int(input())
s = [input() for _ in range(n)]
m = int(input())
t = [input() for _ in range(m)]

s_c = Counter(s)
t_c = Counter(t)

keys,values = zip(*(s_c-t_c).most_common())

print(values[0])


### FIXED CODE ###

n = int(input())
s = [input() for _ in range(n)]
m = int(input())
t = [input() for _ in range(m)]

ans = 0
for i in range(n):
  ans = max(ans, max(0, s.count(s[i]) - t.count(s[i])))
print(ans)
import sympy
n,p = map(int,input().split())
cnt = sympy.factorint(p)
ans = 1

for i in cnt:
    while cnt[i] >= n:
        ans *= i
        cnt[i] -= n
print(ans)

### FIXED CODE ###

from collections import Counter,defaultdict
import sys,heapq,bisect,math,itertools,string,queue
mod = 10**9+7
def inp(): return int(sys.stdin.readline())
def inpl(): return list(map(int, sys.stdin.readline().split()))
def inpl_str(): return list(sys.stdin.readline().split())
#素因数分解
def prime_factorize(n):
    a = []
    while n % 2 == 0:
        a.append(2)
        n //= 2
    f = 3
    while f * f <= n:
        if n % f == 0:
            a.append(f)
            n //= f
        else:
            f += 2
    if n != 1:
        a.append(n)
    return a

n,p = inpl()
soin = prime_factorize(p)
cnt = Counter(soin)
res = 1
for key in cnt.keys():
    if cnt[key] >= n:
        res *= key ** (cnt[key]//n)
print(res)
from functools import lru_cache
import sys

sys.setrecursionlimit(10**8)

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

@lru_cache(maxsize=None)
def dp(s):
    print(s.count("ABC"))
print(dp(S))



### FIXED CODE ###

from functools import lru_cache
import sys

sys.setrecursionlimit(10**8)

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

@lru_cache(maxsize=None)
def dp(k,x):
    if k*500 < x:
        result = 'No'
    else:
        result = 'Yes'
    return result
print(dp(K,X))
a,b,c,k=(int(x) for x in input().split())

if(k<=a):
  print(a*len(k))
else:
  sum=a*len(k)
  t=k-a
  if(t<=b):
    print(sum+b*len(t))
  else:
    sum+=b*len(t)
    t2=t-c
    print(sum+c*len(t2))

### FIXED CODE ###


#a,b=(int(x) for x in input().split()) #数値の時




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

if(k<=a):
  print(k)
else:
  sum=a
  t=k-a
  if(t<=b):
    print(sum)
    
  else:
    t-=b
    
    
    print(sum-t)
def gcd(n1,n2):
    if n1 > n2:
        n1,n2 = n2,n1
    if n2 % n1 == 0:return n1
    else: return gcd(n2%n1,n1)
n = int(input())
t = [int(input()) for i in range(n)]
check = t[0]*t[1]/gcd(t[0],t[1])
for i in range(n-2):
    check = check*t[i+2]/gcd(check,t[i+2])
print(int(check))

### FIXED CODE ###

import sys
sys.setrecursionlimit(10000)
def gcd(n1,n2):
    if n1 > n2:
        n1,n2 = n2,n1
    if n2 % n1 == 0:return n1
    else: return gcd(n2%n1,n1)
n = int(input())
if n == 1:
    print(int(input()))
    sys.exit()
t = [int(input()) for i in range(n)]
check = t[0]*t[1]//gcd(t[0],t[1])
for i in range(n-2):
    check = (check*t[i+2])//gcd(check,t[i+2])
print(int(check))
import math from gcd
k=input()

ans=0
i=0

for a in range(k+1):
  for b in range(k+1):
    i==gcd(a,B)
    for c in range(k+1):
      ans+=gcd(i,c)
      
print(ans)

### FIXED CODE ###

n=input()

a=n.count('7')

if a==0:
  print('No')
else:
  print('Yes')
s = input()
t = input()

S = ''join(sorted(list(s)))
T = ''join(sorted(list(t),reverse=True))

print('Yes' if S<T else 'No')

### FIXED CODE ###

s = input()
t = input()

S = ''.join(sorted(list(s)))
T = ''.join(sorted(list(t),reverse=True))

print('Yes' if S<T else 'No')
def gcd(a, b):
    while b > 0:
        tmp = a
        a = b
        b = tmp % b
    return a


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


n = int(input())
t = [0 for i in range(n)]
for i in range(n):
    t[i] = int(input())
t = sorted(t)
sum = t[0]
for i in range(1, n):
    # print("sum:{} t:{} lcm:{}".format(sum, t, lcm(sum, t)))
    sum = lcm(sum, t[i])
    # print(sum)
print(sum)


### FIXED CODE ###

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


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


n = int(input())
t = [0 for i in range(n)]
for i in range(n):
    t[i] = int(input())
t = sorted(t)
_sum = t[0]
for i in range(1, n):
    # print("sum:{} t:{} lcm:{}".format(sum, t, lcm(sum, t)))
    _sum = lcm(_sum, t[i])
    # print(sum)
print(_sum)
N,K = map(int, input().split())
h = [int(input()) for i in range(N)]
h.sort()
ans = min(h[i+K-1] - h[i] for i in range(N-k+1))
print(ans)


### FIXED CODE ###

N,K = map(int, input().split())
h = [int(input()) for i in range(N)]
h.sort()
ans = min(h[i+K-1] - h[i] for i in range(N-K+1))
print(ans)