Harryxun/sft_time huggingface dataset:
### BUGGY CODE ###

import numpy as np
n = input()
a = np.array([int(i) for i in input().split()])

a_unique = np.unique(a)

out = 0
for i in a_unique:
    count = np.sum(a==i)
    if(count==i):
        out += 0
    elif(count < i):
        out += count
    else:
        out += count - i

print(out)

### FIXED CODE ###

import numpy as np
from collections import Counter

n = input()
a = np.array([int(i) for i in input().split()])

x = Counter(a)
out = 0
for i in x:
    if(x[i] < i):
        out += x[i]
    else:
        out += x[i] - i

print(out)
### BUGGY CODE ###

import sys
input=sys.stdin.readline

N = int(input())
# ボトルネックとなる制限人数を取得
mini = min([int(input()) for _ in range(5)])
# 都市2 以降で要する合計移動時間で初期化
time = 4

while N > 0:
    N -= mini
    time += 1

print(time)

### FIXED CODE ###

import math
import sys
input=sys.stdin.readline

N = int(input())
# ボトルネックとなる制限人数を取得
mini = min([int(input()) for _ in range(5)])

print(math.ceil(N/mini)+4)
### BUGGY CODE ###

N, K = map(int, input().split())
P = list(map(int, input().split()))
max_total = 0
ans = 0

for i in range(N-K+1):
    total = sum(P[i:i+K])
    if total > max_total:
        max_total = total
        ans = sum(map(lambda x: (x + 1) / 2, P[i:i+K]))

print(ans)

### FIXED CODE ###

from itertools import accumulate

N, K = map(int, input().split())
P = map(int, input().split())
acc_P = list(accumulate(P))
ans = (acc_P[K-1] + K) / 2

for i in range(N-K):
    ans = max(ans, (acc_P[i+K] - acc_P[i] + K) / 2)

print(ans)
### BUGGY CODE ###

n, q = map(int, input().split())
s = input()
lr = [list(map(int, input().split())) for _ in range(q)]

t = [0] * n

for i in range(1, n):
    if s[i] == "C":
        if s[i-1] == "A":
            t[i-1] = 1

for i in range(q):
    l, r = lr[i][0]-1, lr[i][1]-1
    print(sum(t[l:r]))


### FIXED CODE ###

n, q = map(int, input().split())
s = input()
lr = [list(map(int, input().split())) for _ in range(q)]

t = [0] * (n+1)

for i in range(n):
    t[i+1] = t[i] + (1 if s[i:i+2] == "AC" else 0)

for i in range(q):
    l, r = lr[i][0]-1, lr[i][1]-1
    print(t[r] - t[l])
### BUGGY CODE ###

s = input()
q = int(input())
for i in range(q):
    ls = list(map(str, input().split()))
    
    if len(ls) == 1:
        s = s[::-1]
    else:
        if ls[1] == '1':
            s = ls[2] + s
        else:
            s = s + ls[2]
print(s)

### FIXED CODE ###

from collections import deque
s = deque(list(input()))
q = int(input())
cur = 0
for i in range(q):
    ls = list(map(str, input().split()))
    if len(ls) == 1:
        cur += 1
    else:
        if ls[1] == '1':
            if cur%2 == 0:
                s.appendleft(ls[2])
            else:
                s.append(ls[2])
        else:
            if cur%2 == 0:
                s.append(ls[2])
            else:
                s.appendleft(ls[2])
if cur%2 == 0:
    print(*s, sep='')
else:
    print(*list(s)[::-1], sep='')
### BUGGY CODE ###

N, M = map(int, input().split())
ab = [tuple(map(lambda x:int(x)-1, input().split())) for _ in range(M)]


class UnionFind():
    def __init__(self,size):
        self.table = [-1 for _ in range(size)]

    def find(self,x):
        while self.table[x] >= 0:
            x = self.table[x]
        return x

    def union(self,x,y):
        s1 = self.find(x)
        s2 = self.find(y)
        if s1 == s2:
            return
        if self.table[s1] >= self.table[s2]:
            self.table[s1] += self.table[s2]
            self.table[s2] = s1
        else:
            self.table[s2] += self.table[s1]
            self.table[s1] = s2


def func1(x, y):
    global uf
    px = uf.find(x)
    py = uf.find(y)
    if px == py:
        return 0
    r = uf.table[px] * uf.table[py]
    uf.union(px, py)
    return r


def main():
    ans = []
    p = 0
    for x, y in reversed(ab):
        p += func1(x, y)
        ans.append(p)

    nall = N * (N - 1) // 2
    for a in reversed(ans[:-1]):
        print(nall - a)
    print(nall)


uf = UnionFind(N)
main()

### FIXED CODE ###

N, M = map(int, input().split())
ab = [tuple(map(lambda x:int(x)-1, input().split())) for _ in range(M)]


class UnionFind:
    def __init__(self,size):
        self.rank = [-1 for _ in range(size)]
        self.number = [1 for _ in range(size)]

    def find(self,x):
        while self.rank[x] >= 0:
            x = self.rank[x]
        return x

    def union(self,x,y):
        s1 = self.find(x)
        s2 = self.find(y)
        if s1 == s2:
            return
        if self.rank[s1] == self.rank[s2]:
            self.rank[s1] -= 1
            self.rank[s2] = s1
            self.number[s1] += self.number[s2]
        elif self.rank[s1] < self.rank[s2]:
            self.rank[s2] = s1
            self.number[s1] += self.number[s2]
        else:
            self.rank[s1] = s2
            self.number[s2] += self.number[s1]


def main():
    uf = UnionFind(N)
    p = N * (N - 1) // 2
    ans = [p]
    for x, y in reversed(ab):
        px = uf.find(x)
        py = uf.find(y)
        if px != py:
            p -= uf.number[px] * uf.number[py]
            uf.union(px, py)
        ans.append(p)

    for a in reversed(ans[:-1]):
        print(a)


main()
### BUGGY CODE ###

#from collections import deque

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

a = [0] * (n-1)
b = [0] * (n-1)
info = [[] for _ in range(n)]

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

p = [0] * q
x = [0] * q


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

plus = [0] * n

for j in range(q):
    plus[p[j]] += x[j]

state = [0] * n
state[0] = 1
cur = [0]

child = [[] for _ in range(n)]
par = [0] * n

ranklist = [[1]]

#print(cur)
#print(info)

while cur != []:
    cur2 = []
    ranklist.append([])
    for obj in cur:
        for obj2 in info[obj]:
            if state[obj2] == 0:
                state[obj2] = 1
                #child[obj].append(obj2)
                par[obj2] = obj
                cur2.append(obj2)
                ranklist[-1].append(obj2)
    cur = cur2[:]

ans = [0] * n
ans[0] = plus[0]

for l in ranklist:
    for t in l:
        ans[t] = ans[par[t]] + plus[t]

print(" ".join(map(str,ans)))

### FIXED CODE ###

n,q = map(int,input().split())
 
a = [0] * (n-1)
b = [0] * (n-1)
info = [[] for _ in range(n)]
 
for i in range(n-1):
    a[i],b[i] = map(int,input().split())
    a[i] -= 1
    b[i] -= 1
    info[a[i]].append(b[i])
    info[b[i]].append(a[i])
 
p = [0] * q
x = [0] * q
 
 
for j in range(q):
    p[j],x[j] = map(int,input().split())
    p[j] -= 1
 
plus = [0] * n
 
for j in range(q):
    plus[p[j]] += x[j]
 
state = [0] * n
state[0] = 1
cur = [0]
 
child = [[] for _ in range(n)]
par = [0] * n
 
ranklist = [[1]]
 
#print(cur)
#print(info)
 
while cur != []:
    cur2 = []
    ranklist.append([])
    for obj in cur:
        for obj2 in info[obj]:
            if state[obj2] == 0:
                state[obj2] = 1
                #child[obj].append(obj2)
                par[obj2] = obj
                cur2.append(obj2)
                ranklist[-1].append(obj2)
    cur = cur2[:]
 
ans = [0] * n
ans[0] = plus[0]
 
for l in ranklist:
    for t in l:
        ans[t] = ans[par[t]] + plus[t]
 
print(" ".join(map(str,ans)))
### BUGGY CODE ###

def main():
    from sys import stdin
    input = stdin.readline
    from collections import deque

    n, m, k = map(int, input().split())
    f = {i: set() for i in range(1, n+1)}
    BL = {i: set() for i in range(1, n+1)}
    ans = [0] * n
    for _ in range(m):
        a, b = map(int, input().split())
        f[a].add(b)
        f[b].add(a)
    for _ in range(k):
        c, d = map(int, input().split())
        BL[c].add(d)
        BL[d].add(c)
    for i in range(1, n+1):
        ff = f[i].copy()
        q = deque(f[i])
        while q:
            t = q.popleft()
            for x in f[t]:
                if x not in ff:
                    ff.add(x)
                    q.append(x)
        ans[i-1] = max(0, len(ff - f[i] - BL[i]) - 1)
    print(*ans)
main()


### FIXED CODE ###

def main():
    from sys import stdin
    input = stdin.readline

    n, m, k = map(int, input().split())
    f = [[] for i in range(n)]
    BL = [[] for i in range(n)]
    ans = [0] * n
    for _ in range(m):
        a, b = map(int, input().split())
        f[a-1].append(b-1)
        f[b-1].append(a-1)
    for _ in range(k):
        c, d = map(int, input().split())
        BL[c-1].append(d-1)
        BL[d-1].append(c-1)
    D = {}
    parent = [-1] * n
    visited = [False] * n
    for root in range(n):
        if visited[root]:
            continue
        D[root]  = set([root])
        stack = [root]
        while stack:
            x = stack.pop()
            visited[x] = True
            parent[x] = root
            for t in f[x]:
                if visited[t]:
                    continue
                D[root].add(t)
                stack.append(t)
    for i in range(n):
        grp = D[parent[i]]
        tans = len(grp) - len(f[i]) - 1
        for block in BL[i]:
            if block in grp:
                tans -= 1
        ans[i] = tans
    print(*ans)
main()
### BUGGY CODE ###

import sys
from collections import defaultdict
input = sys.stdin.readline
sys.setrecursionlimit(10**8)
 
def main():
    n = int(input())
    a = list(map(int, input().split()))
    dic = defaultdict(int)
    a.sort()
    ans = 0
    for i in range(n):
        x = a[i]
        if i < n-1 and a[i] == a[i+1]:
            dic[a[i]] = 1
            continue
        flag = 1
        for check in range(1,int(x**0.5)+1):
            if(x%check==0):
                if dic[check]:
                    flag = 0
                    break
                if dic[x//check]:
                    flag = 0
                    break
        if flag:
            ans += 1
        dic[a[i]] = 1
    print(ans)
    
if __name__ == "__main__":
    main()

### FIXED CODE ###

import sys
input = sys.stdin.readline
sys.setrecursionlimit(10**8)
 
def main():
    n = int(input())
    a = list(map(int, input().split()))
    a.sort()
    ans = 0
    N = max(a)+1
    tab = [1 for _ in range(N)]
    for i in range(n):
        x = a[i]
        if i < n-1 and a[i] == a[i+1]:
            tab[a[i]] = 0
        if tab[x]:
            ans += 1
        for i in range(N):
            if x*i >= N:
                break
            tab[x*i] = 0        
    print(ans)
    
if __name__ == "__main__":
    main()
### BUGGY CODE ###

import itertools

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

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

Alist=list(map(list,itertools.combinations(range(1,n+m),n)))

slist=[]
for i in range(len(Alist)):
    s=0
    for j in range(q):
        aj=lis[j][0]
        bj=lis[j][1]
        cj=lis[j][2]
        dj=lis[j][3]
        if (Alist[i][bj-1]-(bj-1))-(Alist[i][aj-1]-(aj-1))==cj:
            s+=dj
    slist.append(s)

print(max(slist))


### FIXED CODE ###

import itertools

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

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

M=0
for l in map(list,itertools.combinations(range(1,n+m),n)):
    s=0
    for j in range(q):
        aj=lis[j][0]
        bj=lis[j][1]
        cj=lis[j][2]
        dj=lis[j][3]
        if l[bj-1]-bj-l[aj-1]+aj==cj:
            s+=dj
    M=max(M,s)
print(M)
### BUGGY CODE ###

# -*- coding: utf-8 -*-
"""
Created on Sun Sep 13 02:42:27 2020

@author: liang
"""

N, M = map(int, input().split())
drinks = list()

for i in range(N):
    a, b = map(int,input().split())
    for j in range(b):
        drinks.append(a)

drinks.sort()

ans = sum(drinks[:M])

print(ans)

### FIXED CODE ###

# -*- coding: utf-8 -*-
"""
Created on Sun Sep 13 02:42:27 2020

@author: liang
"""

N, M = map(int, input().split())
drinks = list()

for i in range(N):
    a, b = map(int,input().split())
    drinks.append((a,b))

drinks.sort(key = lambda x: x[0])
#print(drinks)
ans = 0
while M > 0:
    a, b = drinks.pop(0)
    if M <= b:
        ans += a*M
        M = 0
    else:
        ans += a*b
        M -= b
    #print(ans,M)
print(ans)
### BUGGY CODE ###

S = input()
P = tuple(map(int, input().split()))

def add(p, d):
    return (p[0] + d[0], p[1] + d[1])

now = {((0, 0), (1, 0))} # (X, Y), dir
for s in S:
    ne = set()
    for p, d in now:

        #Fのとき
        if s == "F":
            ne = ne | {(add(p, d), d)}
        
        #Tのとき
        elif s == "T":
            ne = ne | {(p, (d[1], -d[0])), (p, (-d[1], d[0])) }

    now = ne

for p,d in now:
    if p == P:
        print("Yes")
        break
else:
    print("No")

### FIXED CODE ###

import bisect
import copy
import heapq
import sys
import itertools
import math
import queue
input = sys.stdin.readline
sys.setrecursionlimit(1000000)
mod = 10 ** 9 + 7

def read_values(): return map(int, input().split())
def read_index(): return map(lambda x: int(x) - 1, input().split())
def read_list(): return list(read_values())
def read_lists(N): return [read_list() for n in range(N)]
def init_dp1(init, N): return [init for _ in range(N)]
def init_dp2(init, N, M): return [[init for _ in range(M)] for _ in range(N)]


class V:
    def __init__(self, f, v=None):
        self.f = f
        self.v = v
 
    def __str__(self):
        return str(self.v)
 
    def ud(self, n):
        if n is None:
            return

        if self.v is None:
            self.v = n
            return
        self.v = self.f(self.v, n) 


def main():
    S = input().strip()
    X, Y = read_values()
    F = list(map(len, S.split("T")))

    S = {F[0]}
    if len(F) >= 2:
        for x in F[2::2]:
            SS = set()
            for s in S:
                SS.add(s + x)
                SS.add(s - x)
            S = SS

    if not X in S:
        print("No")
        return
    
    S = {0}
    if len(F) >= 1:
        for x in F[1::2]:
            SS = set()
            for s in S:
                SS.add(s + x)
                SS.add(s - x)
            S = SS
    
    if not Y in S:
        print("No")
        return 
    
    print("Yes")


if __name__ == "__main__":
    main()
### BUGGY CODE ###

from collections import deque
n = int(input())
d = deque()
for _ in range(n):
    x = input().split()
    if x[0][0] == 'i':
        d.appendleft(int(x[1]))
    elif x[0] == 'delete':
        try:
            d.remove(int(x[1]))
        except ValueError:
            pass
    elif x[0][6] == 'F':
        d.popleft()
    else:
        d.pop()
print(*d)




### FIXED CODE ###

from collections import deque
n = int(input())
a = deque()
for i in range(n):
    c = input()
    if c == "deleteFirst":
        a.popleft()
    elif c == "deleteLast":
        a.pop()
    else:
        c, v = c.split()
        if c == "insert":
            a.appendleft(v)
        else:
            try:
                a.remove(v)
            except:
                pass
print(" ".join(a))
### BUGGY CODE ###

import bisect
from collections import deque
x,y,a,b,c = map(int, input().split())
p = list(map(int, input().split()))
q = list(map(int, input().split()))
r = list(map(int, input().split()))
p.sort()
q.sort()
r.sort(reverse=True)
red_que = p[a-x:]
green_que = q[b-y:]
red_count = 0
green_count = 0
for i in range(c):
    if red_que[red_count] < green_que[green_count]:
        if red_que[red_count] < r[i]:
            red_que[red_count] = 0
            red_count += 1
            bisect.insort_left(red_que, r[i])
        else:
            break
    else:
        if green_que[green_count] < r[i]:
            green_que[green_count] = 0
            green_count += 1
            bisect.insort_left(green_que, r[i])
        else:
            break
print(sum(green_que) + sum(red_que))

### FIXED CODE ###

import heapq
from collections import deque
import sys
input = sys.stdin.readline
x,y,a,b,c = map(int, input().split())
p = list(map(int, input().split()))
q = list(map(int, input().split()))
r = list(map(int, input().split()))
p.sort()
q.sort()
r.sort(reverse=True)
red_que = p[a-x:]
heapq.heapify(red_que)
green_que = q[b-y:]
heapq.heapify(green_que)
for i in range(c):
    re_mi = heapq.heappop(red_que)
    gr_mi = heapq.heappop(green_que)
    if re_mi < gr_mi:
        if re_mi < r[i]:
            heapq.heappush(red_que,r[i])
            heapq.heappush(green_que,gr_mi)
        else:
            heapq.heappush(green_que,gr_mi)
            heapq.heappush(red_que,re_mi)
            break
    else:
        if gr_mi < r[i]:
            heapq.heappush(red_que,re_mi)
            heapq.heappush(green_que,r[i])
        else:
            heapq.heappush(green_que,gr_mi)
            heapq.heappush(red_que,re_mi)
            break
print(sum(green_que) + sum(red_que))
### BUGGY CODE ###

n = int(input())
s = input()

ans = 0
set2d = set()

for d1 in range(n-2):
  for d2 in range(d1+1,n-1):    
    if s[d1]+s[d2] not in set2d:      
      set2d.add(s[d1]+s[d2])      
      ans +=len(set(s[d2+1:]))

print(ans)      

### FIXED CODE ###

n = int(input())
s = input()

ans = 0
for i in range(1000):
  pin = '{:03d}'.format(i)
  p1 = s.find(pin[0])
  if p1>=0:    
    p2 = s[p1+1:].find(pin[1])     
    if p2>=0:
      p3 = s[p1+p2+2:].find(pin[2])      
      if p3>=0:
        ans+=1        
    
print(ans)
### BUGGY CODE ###

from sys import stdin
from collections import deque
H, W = [int(x) for x in stdin.readline().rstrip().split()]

data = []

for _ in range(H):
    data.append(list(input()))

searched = [[0]*(W+2)]

for _ in range(H):
    searched.append([0] + [1000000]*W + [0])
searched.append([0]*(W+2))

visit_p = deque()
for h,i in enumerate(data):
    for w, j in enumerate(i):
        if j == "#":
            searched[h+1][w+1] = 0
            visit_p.append((h+1, w+1, 0))
while visit_p:
    nh,nw,num = visit_p.popleft()
    if searched[nh][nw] < num:
        continue
    for dh,dw in [(0,1),(1,0),(0,-1),(-1,0)]:
        if searched[nh+dh][nw+dw] > num:
            searched[nh+dh][nw+dw] = num + 1
            visit_p.append((nh+dh,nw+dw,num+1))
print(max(map(max, searched)))

### FIXED CODE ###

from sys import stdin
from collections import deque
H, W = [int(x) for x in stdin.readline().rstrip().split()]

data = []

for _ in range(H):
    data.append(list(input()))

searched = [[0]*(W+2)]

for _ in range(H):
    searched.append([0] + [1000000]*W + [0])
searched.append([0]*(W+2))

visit_p = deque()
for h,i in enumerate(data):
    for w, j in enumerate(i):
        if j == "#":
            searched[h+1][w+1] = 0
            visit_p.append((h+1, w+1, 0))
while visit_p:
    nh,nw,num = visit_p.popleft()
    if searched[nh][nw] < num:
        continue
    for dh,dw in [(0,1),(1,0),(0,-1),(-1,0)]:
        if searched[nh+dh][nw+dw] > num + 1:
            searched[nh+dh][nw+dw] = num + 1
            visit_p.append((nh+dh,nw+dw,num+1))
print(max(map(max, searched)))
### BUGGY CODE ###

A,B,N = map(int, input().split())
ans = 0
for i in range(10**7):
    if i > N-1:
        break
    
    tmp = (A*(i+1))//B-A*((i+1)//B)
    if ans < tmp:
        ans = tmp
print(ans)

### FIXED CODE ###

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

x = min(B-1,N)

print((A*x)//B -A*(x//B))
### BUGGY CODE ###

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

RD = []
end = [False] * N

for i in range(N):

    RD.append([])

for i in range(M):

    L,R,D = map(int,input().split())
    RD[L-1].append([R-1,D])
    RD[R-1].append([L-1,-1 * D])
    end[L-1] = True
    end[R-1] = True
    
"""
    lp = wantp(L-1)
    rp = wantp(R-1)

    if lp != rp:

        if rank[lp] 
"""
    


endnum = 0
Q = []

cor = ["x"] * N
ans = "Yes"


for endp in range(N):

    if end[endp]:
        Q = [endp] 


        while len(Q) > 0:

            q = Q.pop(0)
            end[q] = False

            if cor[q] == "x":
                cor[q] = 0

            for r,d in RD[q]:

                if cor[r] == "x":
                    cor[r] = cor[q] + d
                    Q.append(r)

                elif cor[r] != cor[q] + d:
                    print ("No")
                    exit()


print ("Yes")

### FIXED CODE ###

from collections import deque

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

RD = [deque() for i in range(N)]
end = [False] * N

for i in range(M):

    L,R,D = map(int,input().split())
    RD[L-1].append([R-1,D])
    RD[R-1].append([L-1,-1 * D])
    end[L-1] = True
    end[R-1] = True
    
"""
    lp = wantp(L-1)
    rp = wantp(R-1)

    if lp != rp:

        if rank[lp] 
"""
    


endnum = 0
Q = deque()

cor = ["x"] * N
ans = "Yes"


for endp in range(N):

    if end[endp]:
        Q.append(endp)


        while len(Q) > 0:

            q = Q.pop()
            end[q] = False

            if cor[q] == "x":
                cor[q] = 0

            for r,d in RD[q]:

                if cor[r] == "x":
                    cor[r] = cor[q] + d
                    Q.append(r)

                elif cor[r] != cor[q] + d:
                    print ("No")
                    exit()


print ("Yes")
### BUGGY CODE ###

while 1:
    n,k=map(int,input().split())
    if n==0:break
    a=[int(input()) for _ in range(k)]
    m=sum(a)
    for i in range(n-k):
        a.append(int(input()))
        m=max(m,sum(a[-k:]))
    print(m)

### FIXED CODE ###

import queue
while 1:
    n,k=map(int,input().split())
    if n==0:break
    a=queue.deque(int(input()) for _ in range(k))
    m=b=sum(a)
    for i in range(n-k):
        c=a.popleft()
        d=int(input())
        a.append(d)
        b+=d-c
        m=max(b,m)        
    print(m)
### BUGGY CODE ###

h, w = map(int, input().split())
s = [list(input()) for _ in range(h)]

for i in range(h):
    count = 0
    start = 0
    end = 0
    for j in range(w):
        if s[i][j] != "#":  # 　#じゃなければおけ
            count += 1
        else:
            for z in range(start, end):
                s[i][z] = count
            start = end+1
            count = 0
        end += 1
    for z in range(start, end):
        s[i][z] = count
    # print(s[i])
ans = 0

for i in range(w):
    count = 0
    start = 0
    end = 0
    for j in range(h):
        if s[j][i] != "#":  # 　#じゃなければおけ
            count += 1
        else:
            for z in range(start, end):
                s[z][i] += count
            start = end+1
            count = 0
        end += 1
    for z in range(start, end):
        s[z][i] += count
# print()
for i in range(h):
    # print(s[i])
    for j in range(w):

        if s[i][j] != "#":
            ans = max(ans, s[i][j])
print(ans-1)


### FIXED CODE ###

h, w = map(int, input().split())
s = [list(input()) for _ in range(h)]

for i in range(h):
    count = 0
    start = 0
    end = 0
    for j in range(w):
        if s[i][j] != "#":  # 　#じゃなければおけ
            count += 1
        else:
            for z in range(start, end):
                s[i][z] = count
            start = end+1
            count = 0
        end += 1
    for z in range(start, end):
        s[i][z] = count
    # print(s[i])
ans = 0

for i in range(w):
    count = 0
    start = 0
    end = 0
    for j in range(h):
        if s[j][i] != "#":  # 　#じゃなければおけ
            count += 1
        else:
            for z in range(start, end):
                s[z][i] += count
            start = end+1
            count = 0
        end += 1
    for z in range(start, end):
        s[z][i] += count
# print()
for i in range(h):
    # print(s[i])
    for j in range(w):

        if s[i][j] != "#":
            ans = max(ans, s[i][j])
print(ans-1)
### BUGGY CODE ###

N,M=map(int,input().split())
friend=[[] for _ in range(N)]
for i in range(M):
    A,B=map(int,input().split())
    friend[A-1].append(B-1)
    friend[B-1].append(A-1)
ans=0
ischecked=[0]*N
for i in range(N):
    if ischecked[i]==1:
        continue
    group=1
    ischecked[i]=1
    ship=friend[i]
    while ship:
        nex=ship.pop(0)
        if ischecked[nex]==1:
            continue
        ischecked[nex]=1
        group+=1
        ship.extend(friend[nex])
    ans=max(ans,group)
print(ans)

### FIXED CODE ###

N,M=map(int,input().split())
friend=[[] for _ in range(N)]
for i in range(M):
    A,B=map(int,input().split())
    friend[A-1].append(B-1)
    friend[B-1].append(A-1)
ans=0
ischecked=[0]*N
for i in range(N):
    if ischecked[i]==1:
        continue
    group=1
    ischecked[i]=1
    ship=friend[i]
    while ship:
        nex=ship.pop()
        if ischecked[nex]==1:
            continue
        ischecked[nex]=1
        group+=1
        ship.extend(friend[nex])
    ans=max(ans,group)
print(ans)