CodeEff/ECCO huggingface dataset:
# Original solution
def sum(i):
  t=0
  while True:
    if i==0:
      return t
    else:
      t +=i%10
      i //=10
      
N,A,B = [int(i) for i in input().split()]
s = 0

for i in range(1, N+1):
  if sum(i) <=B and sum(i) >=A:
    s += i
print(s)

# Optimized solution
n, a, b = list(map(int, input().split()))

answer = 0
for i in range(1,n+1):
	sum = 0
	x = i
	while x > 0:
		sum += x % 10
		x = x // 10
	if a <= sum <= b:
		answer += i
print(answer)
# Original solution
# -*- coding: utf-8 -*-
n,a,b = list(map(int,input().split()))

ans = 0
for i in range(1, n + 1):
    tmp = i
    tmp2 = list(str(tmp))
    sum = 0
    for j in range(len(tmp2)):
        sum += int(tmp2[j])
    if a <= sum <= b:
        ans += i
print(ans)


# Optimized solution
# -*- coding: utf-8 -*-
n, a, b = list(map(int,input().split()))

ans = 0
for i in range(1, n + 1):
    tmp = str(i)
    su = 0
    for j in tmp:
        su += int(j)
    #print(i, su)
    if a <= su <= b:
        ans += i
print(ans)
# Original solution
n, a, b = list(map(int, input().split()))
data = []
for i in range(1, n+1):
    if a<= sum(list(map(int, list(str(i)))) )<=b:
        data.append(i)
print((sum(data)))

# Optimized solution
n, a, b = list(map(int, input().split()))
ans = 0
for i in range(1, n+1):
    if a<=sum([int(s) for s in str(i)])<=b:
    	ans += i
print(ans)
# Original solution
n,a,b = list(map(int,input().split()))
z = 0
for i in range(n+1):
    i = str(i)
    x = list(i)
    x = list(map(int,x))
    y = sum(x)
    if y >= a and y <= b:
        z += int(i)
print(z)

# Optimized solution
n,a,b = list(map(int,input().split()))
z = 0
for i in range(n+1):
    x = list(map(int,list(str(i))))
    y = sum(x)
    if y >= a and y <= b:
        z += int(i)
print(z)
# Original solution
n,a,b = list(map(int,input().split()))
z = 0
for i in range(n+1):
    x = list(map(int,list(str(i))))
    y = sum(x)
    if y >= a and y <= b:
        z += int(i)
print(z)

# Optimized solution
N, A, B = list(map(int, input().split()))

result = 0

for i in range(1, N+1):
    sum_digit = sum(list(map(int, str(i))))
    if A <= sum_digit and sum_digit <= B:
        result += i

print(result)
# Original solution
x = [int(x) for x in input().split()]
N = x[0]
A = x[1]
B = x[2]
ans = 0
for i in range(N):
  i = i+1
  to_int = [int(i) for i in list(str(i))]
  X = sum(to_int)
  if (X >= A) & (X <= B) :
    ans += i
print(ans)

# Optimized solution
x = [int(x) for x in input().split()]
N = x[0]
A = x[1]
B = x[2]
def check(x):
  ans = 0
  while x >= 10:
    ans += x%10
    x = x//10  
  ans += x
  return ans
ans1 = 0
for i in range(N):
  i = i+1
  if (check(i) >= A) & (check(i) <= B):
    ans1 += i

print(ans1)
# Original solution
n,a,b = [int(i) for i in input().split()]
ans = int(0)
#range(a,b,c)はstart:a,end:b-1,step:cである。注意。
for i in range(1,n+1):
    # h = i//100
    # l,m = divmod(i%100,10)
    # p = h+l+m
    p = sum(int(j) for j in str(i))
    if a <= p <= b:
        ans += i
print(ans)

# Optimized solution
n,a,b = [int(i) for i in input().split()]
ans = 0
#range(a,b,c)はstart:a,end:b-1,step:cである。注意。
for i in range(1,n+1):
    # h = i//100
    # l,m = divmod(i%100,10)
    # p = h+l+m
    p = sum(int(j) for j in str(i))
    if a <= p <= b:
        ans += i
print(ans)
# Original solution
n,a,b=input().split()
n,a,b=int(n),int(a),int(b)
m=len(str(n))
'''
c=0
if n==10**4 and A==1:
    c=1
k=len(str(n))
for i in range(k):
'''
c=0
for i in range(n):
    #map関数はクソ便利
     if a <= sum(list(map(int, str(i+1)))) <= b:
         c+=i+1

print(c)


# Optimized solution
n,a,b=list(map(int,input().split()))
ans=0
for i in range(1,n+1):
    s=0
    j=i
    while j!=0:
        s+=(j%10)
        j//=10
    if a<=s<=b:ans+=i
print(ans)
# Original solution
from collections import deque
from sys import stdin


def main():
    height, width = list(map(int, stdin.readline().split()))
    q = deque([])
    grid = []
    for i in range(height):
        now = list(stdin.readline())
        for j in range(width):
            if now[j] == "#":
                q.append([i, j, 0])
        grid.append(now)
    answer = 0

    def is_next_cell_white(ny, nx):
        return 0 <= ny < height and 0 <= nx < width and grid[ny][nx] == "."

    while q:
        y, x, time = q.popleft()
        answer = max(answer, time)
        if is_next_cell_white(y - 1, x):
            grid[y - 1][x] = "#"
            q.append([y - 1, x, time + 1])

        if is_next_cell_white(y + 1, x):
            grid[y + 1][x] = "#"
            q.append([y + 1, x, time + 1])

        if is_next_cell_white(y, x - 1):
            grid[y][x - 1] = "#"
            q.append([y, x - 1, time + 1])

        if is_next_cell_white(y, x + 1):
            grid[y][x + 1] = "#"
            q.append([y, x + 1, time + 1])

    print(answer)


if __name__ == '__main__':
    main()



# Optimized solution
from collections import deque
from sys import stdin


def main():
    height, width = list(map(int, stdin.readline().split()))
    q = deque([])
    grid = [stdin.readline() for _ in range(height)]
    distance = [[-1 for _ in range(width)] for _ in range(height)]
    for i in range(height):
        for j in range(width):
            if grid[i][j] == "#":
                q.append((i, j))
                distance[i][j] = 0
    answer = 0
    delta = ((0, 1), (1, 0), (0, -1), (-1, 0))
    while q:
        y, x = q.popleft()
        answer = distance[y][x]
        for dy, dx in delta:
            new_y = y + dy
            new_x = x + dx
            if 0 <= new_y < height and 0 <= new_x < width and distance[new_y][new_x] < 0:
                distance[new_y][new_x] = answer + 1
                q.append((new_y, new_x))
    print(answer)


if __name__ == '__main__':
    main()
# Original solution
from collections import deque

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

d = deque()
op = [[-1] * w for i in range(h)]

for i in range(h):
    s = input().rstrip()
    for j in range(len(s)):
        if s[j] == '#':
            d.append((i, j, 0))

while d:
    i, j, step = d.popleft()

    if op[i][j] != -1:
        continue
    else:
        op[i][j] = step

    if i > 0:
        d.append((i-1, j, step+1))
    if i < h-1:
        d.append((i+1, j, step+1))
    if j > 0:
        d.append((i, j-1, step+1))
    if j < w-1:
        d.append((i, j+1, step+1))

print((max([max(op[i]) for i in range(h)])))


# Optimized solution
from collections import deque

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

d = deque()
op = [[-1] * w for i in range(h)]

for i in range(h):
    s = input().rstrip()
    for j in range(len(s)):
        if s[j] == '#':
            d.append((i, j, 0))
            op[i][j] = 0

while d:
    i, j, step = d.popleft()

    for i2, j2 in [(i-1, j), (i+1, j), (i, j-1), (i, j+1)]:
        if 0 <= i2 < h and 0 <= j2 < w:
            if op[i2][j2] == -1:
                d.append((i2, j2, step+1))
                op[i2][j2] = step + 1

print((max([max(op[i]) for i in range(h)])))
# Original solution
def main():
  from collections import deque
  from array import array
  s,*c=open(0)
  h,w=list(map(int,s.split()))
  f=array('h',[-1]*h*w)
  q=deque()
  for i,c in enumerate(''.join(t[:w]for t in c)):
    if c=='#':
      q.append(i)
      f[i]=0
  while q:
    i=q.popleft()
    v=f[i]+1
    j,k,l,m=i+w,i-w,i+1,i-1
    if h*w>j and f[j]<0:
      q.append(j)
      f[j]=v
    if k>=0 and f[k]<0:
      q.append(k)
      f[k]=v
    if w>i%w+1and f[l]<0:
      q.append(l)
      f[l]=v
    if i%w and f[m]<0:
      q.append(m)
      f[m]=v
  print((v-1))
if __name__=='__main__':
  main()

# Optimized solution
def main():
  from collections import deque
  s,*c=open(0)
  h,w=list(map(int,s.split()))
  f=[-1]*h*w
  q=deque()
  for i,c in enumerate(''.join(t[:w]for t in c)):
    if c=='#':
      q.append(i)
      f[i]=0
  while q:
    i=q.popleft()
    v=f[i]+1
    j,k,l,m,u=i+w,i-w,i+1,i-1,i%w
    if h*w>j and f[j]<0:
      q.append(j)
      f[j]=v
    if k>=0 and f[k]<0:
      q.append(k)
      f[k]=v
    if w>u+1and f[l]<0:
      q.append(l)
      f[l]=v
    if u and f[m]<0:
      q.append(m)
      f[m]=v
  print((v-1))
if __name__=='__main__':
  main()
# Original solution
import sys
readline = sys.stdin.readline

H,W = list(map(int,readline().split()))

grid = [None] * H
dist = [[2000] * W for i in range(H)]
from collections import deque
q = deque([])
for i in range(H):
  grid[i] = readline().rstrip()
  for j in range(len(grid[i])):
    if grid[i][j] == "#":
      q.append((i,j,0))

cases = ((0,1),(0,-1),(1,0),(-1,0))
ans = 0
while q:
  y,x,d = q.popleft()
  if dist[y][x] <= d:
    continue
  dist[y][x] = d
  if ans < d:
    ans = d
  for c in cases:
    if 0 <= y + c[0] < H and 0 <= x + c[1] < W:
      q.append((y + c[0],x + c[1],d + 1))
print(ans)

# Optimized solution
import sys
readline = sys.stdin.readline

H,W = list(map(int,readline().split()))

grid = [None] * H
dist = [[2000] * W for i in range(H)]
from collections import deque
q = deque([])
for i in range(H):
  grid[i] = readline().rstrip()
  for j in range(len(grid[i])):
    if grid[i][j] == "#":
      q.append((i,j,0))

cases = ((0,1),(0,-1),(1,0),(-1,0))
ans = 0
seen = set()
while q:
  y,x,d = q.popleft()
  if dist[y][x] <= d:
    continue
  dist[y][x] = d
  seen.add((y,x))
  if ans < d:
    ans = d
  for c in cases:
    if 0 <= y + c[0] < H and 0 <= x + c[1] < W:
      if (y + c[0],x + c[1]) in seen:
        continue
      q.append((y + c[0],x + c[1],d + 1))
print(ans)
# Original solution
x = int(eval(input()))

print((0 if x == 1 else 1))

# Optimized solution
x = int(eval(input()))

print((1-x))
# Original solution
x = int(eval(input()))
print((1-x))

# Optimized solution
print((1-int(eval(input()))))
# Original solution
x = int(eval(input()))
if x == 1:
    print((0))
else:
    print((1)) 


# Optimized solution
if int(eval(input())):
  print((0))
else:
  print((1))
# Original solution
a = int(eval(input()))
print(("1" if(a == 0) else "0"))

# Optimized solution
print((1^int(eval(input()))))
# Original solution
import sys

sys.setrecursionlimit(10 ** 8)

input = sys.stdin.readline


def main():
    N = int(eval(input()))
    if N == 0:
        print((1))
    else:
        print((0))


if __name__ == '__main__':
    main()



# Optimized solution
n= int(eval(input()) )
print(( 1^ n ))
# Original solution
n=int(eval(input()))
if (n==1):
    print((0))
else:
    print((1))

# Optimized solution
print((1-int(eval(input()))))
# Original solution
import sys

sys.setrecursionlimit(10**7)
def I(): return int(sys.stdin.readline().rstrip())
def MI(): return list(map(int,sys.stdin.readline().rstrip().split()))
def LI(): return list(map(int,sys.stdin.readline().rstrip().split()))  #空白あり
def LI2(): return list(map(int,sys.stdin.readline().rstrip()))  #空白なし
def S(): return sys.stdin.readline().rstrip()
def LS(): return list(sys.stdin.readline().rstrip().split())  #空白あり
def LS2(): return list(sys.stdin.readline().rstrip())  #空白なし


print((1-I()))


# Optimized solution
import sys
def I(): return int(sys.stdin.readline().rstrip())


print((1-I()))
# Original solution
print((1-int(eval(input()))))

# Optimized solution
import math
print((1-math.ceil(math.sin(int(eval(input()))))))
# Original solution
x=int(eval(input()))
if(x==1):
  print((0))
elif(x==0):
  print((1))


# Optimized solution
print((int(not(int(eval(input()))))))
# Original solution
a = int(eval(input()))
print((1 if a == 0 else 0))

# Optimized solution
def _print():
  a = int(eval(input()))
  print((1 if a == 0 else 0))

if __name__ == '__main__':
  _print()
# Original solution
import sys

readline = sys.stdin.readline
MOD = 10 ** 9 + 7
INF = float('INF')
sys.setrecursionlimit(10 ** 5)


def main():
    x = int(readline())

    if x == 1:
        print((0))
    else:
        print((1))


if __name__ == '__main__':
    main()


# Optimized solution
x = int(eval(input()))

if x == 1:
    print((0))
else:
    print((1))
# Original solution
# -*- coding: utf-8 -*-
# 標準入力を取得
x = int(eval(input()))

# 求解処理
ans = int()
if x == 0:
    ans = 1
else:
    ans = 0

# 結果出力
print(ans)


# Optimized solution
# -*- coding: utf-8 -*-

def get_input() -> int:
    """
    標準入力を取得する.

    Returns:\n
        int: 標準入力
    """
    x = int(eval(input()))

    return x


def main(x: int) -> None:
    """
    メイン処理.

    Args:\n
        x (int): 整数(0 <= x <= 1)
    """
    # 求解処理
    ans = 1 - x

    # 結果出力
    print(ans)


if __name__ == "__main__":
    # 標準入力を取得
    x = get_input()

    # メイン処理
    main(x)
# Original solution
x = int(eval(input()))
if x == 0:
  print((1))
else:
  print((0))

# Optimized solution
x = int(eval(input()))
print((x^1))
# Original solution
print(('10'[int(eval(input()))]))

# Optimized solution
import sys
print(('10'[int(sys.stdin.buffer.readline())]))
# Original solution
def ii(): return int(eval(input()))


def mi(): return list(map(int, input().split()))


def li(): return list(map(int, input().split()))


x = ii()

print((0 if x == 1 else 1))


# Optimized solution
print((int(not int(eval(input())))))
# Original solution
a = int(eval(input()))
print((int(not a)))

# Optimized solution
print((int(not int(eval(input())))))
# Original solution
# AtCoder Beginner Contest 178
# A - Not

x=int(eval(input()))
if x==1:
    print((0))
else:
    print((1))

# Optimized solution
print((int(eval(input()))^1))
# Original solution
x = int(eval(input()))
print((1 - x))


# Optimized solution
x = int(eval(input()))
print((x ^ 1))
# Original solution
x = int(eval(input()))

if x == 1:
    print("0")
else:
    print("1")
    

# Optimized solution
x = int(eval(input()))
print((x^1))
# Original solution
x = int(eval(input()))
if x == 0:
    print('1')
else:
    print('0')


# Optimized solution
x = int(eval(input()))
print((x ^ 1))
# Original solution
import sys
stdin = sys.stdin
sys.setrecursionlimit(10**6)
ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))
nn = lambda: list(stdin.readline().split())
ns = lambda: stdin.readline().rstrip()

x = ni()

print((1 if x==0 else 0))

# Optimized solution
print((1-int(eval(input()))))
# Original solution
x = int(eval(input()))

if x == 0:
    print((1))
else:
    print((0))

# Optimized solution
print((1-int(eval(input()))))
# Original solution
x=int(eval(input()))
if x==1:
  print("0")
elif x==0:
  print("1")

# Optimized solution
x=int(eval(input()))
if x==1:
    print((0))
else:
    print((1))
# Original solution
x = int(eval(input()))
if x == 1:
  print("0")
elif x == 0:
  print("1")

# Optimized solution
N = int(eval(input("")))
print((1-N))
# Original solution
x = int(eval(input()))
ans = 1 if x == 0 else 0
print(ans)


# Optimized solution
print((1 if int(eval(input())) == 0 else 0))
# Original solution
x = int(eval(input()))
print(([1, 0][x]))

# Optimized solution
print((int(eval(input()))^1))
# Original solution
x=int(eval(input()))
if x==0:
  print("1")
else:
  print("0")

# Optimized solution
x=int(eval(input()))
if x==1:
  print("0")
else:
  print("1")
# Original solution
ans = [1, 0]
print((ans[int(eval(input()))]))

# Optimized solution
print((0 if bool(int(eval(input()))) else 1))
# Original solution
n = int(input())
S = []
for _ in range(n):
    S += [list(input())]

t = list('abcdefghijklmnopqrstuvwxyz')
count = []
x = 0
for i in t:
    x += 1
    # print (i, x)
    tmp = 50
    for j in S:
        tmp = min(tmp, j.count(i))
    count += [tmp]
# print (count)
for k in range(26):
    for l in range(count[k]):
        print (t[k], end = '')

print ()


# Optimized solution
import sys
# input = sys.stdin.readline
sys.setrecursionlimit(10 ** 9)
MOD = 10 ** 9 + 7


N = int(input())
lst = [50] * 26
for _ in range(N):
    S = list(input())
    tmp = [0] * 26
    for s in S:
        tmp[ord(s) - ord('a')] += 1
    for i in range(26):
        lst[i] = min(lst[i], tmp[i])

for i in range(26):
    if lst[i] > 0:
        s = chr(ord('a') + i) * lst[i]
        print (s, end = '')

print ()
# Original solution
n = int(eval(input()))
G = []
for _ in range(n):
    S = list(input().strip())
    C = {}
    for i in range(len(S)):
        x = S[i]
        if x not in C:
            C[x] = 0
        C[x] += 1
    G.append(C)
A = {}
for i in range(97,123):
    flag = 0
    cmin = 50
    for C in G:
        if chr(i) not in C:
            flag = 1
            break
        cmin = min(cmin,C[chr(i)])
    if flag==0:
        A[chr(i)] = cmin
A = sorted(list(A.items()),key=lambda x:x[0])
x = ""
for y in A:
    a,k = y[0],y[1]
    x += a*k
print(x)

# Optimized solution
n = int(eval(input()))
S = [input().strip() for _ in range(n)]
C = {chr(i):0 for i in range(97,123)}
for i in range(len(S[0])):
    C[S[0][i]] += 1
for j in range(1,n):
    C1 = {chr(i):0 for i in range(97,123)}
    for i in range(len(S[j])):
        C1[S[j][i]] += 1
    for i in range(97,123):
        C[chr(i)] = min(C[chr(i)],C1[chr(i)])
        
A = []
for i in range(97,123):
    A.append(chr(i)*C[chr(i)])
print(("".join(sorted(A))))
# Original solution
import sys
def 解():
    iN = int(eval(input()))
    aS = [_.rstrip() for _ in sys.stdin.readlines()]
    def buildDic(s):
        d = {}
        aABC = sorted(set(list(s)))
        for es in aABC:
            d[es]= s.count(es)
        return d
    d0 = buildDic(aS[0])
    for s in aS[1:]:
        aABC = sorted(set(list(s)))
        for ts in set(d0.keys()) - set(aABC):
            del d0[ts]
        for ts in aABC:
            if ts in d0:
                i = min(d0[ts],s.count(ts))
                if i :
                    d0[ts] = i
                else:
                    del d0[ts]
            if len(d0) == 0:
                print("")
                exit()
    aNS = sorted(d0.keys())
    sR = ""
    for ts in aNS:
        sR += ts * d0[ts]
    print(sR)
解()


# Optimized solution
import sys
def 解():
    iN = int(eval(input()))
    aS = [_.rstrip() for _ in sys.stdin.readlines()]

    sABC = "abcdefghijklmnopqrstuvwxyz"
    iL = len(sABC)
    aC = [0]*iL
    for i in range(iL):
        aC[i] = aS[0].count(sABC[i])
    for s in aS[1:]:
        b0 = True
        for i in range(iL):
            if aC[i]:
                iC = s.count(sABC[i])
                if iC :
                    b0 = False
                aC[i] = min(aC[i] ,iC)

        if b0:
            print("")
            exit()

    sR = ""
    for i in range(iL):
        if aC[i]:
            sR += sABC[i] * aC[i]
    print(sR)
解()
# Original solution
import copy
n=int(input())
ans=[]
mins=55
a=[list(input()) for _ in range(n)]
for i in a:
  if mins > len(i):
    mins=min(mins,len(i))
    m=copy.copy(i)
for i in m:
  flg=0
  for j in a:
    if i not in j:
      flg=1
  if flg==0:
    ans.append(i)
    for j in a:
      j.remove(i)
ans.sort()
print(*ans,sep='')


# Optimized solution
n=int(input())
ans=[]
mins=55
a=[list(input()) for _ in range(n)]
for i in a:
  if mins > len(i):
    mins=min(mins,len(i))
    m=list(i)
for i in m:
  flg=0
  for j in a:
    if i not in j:
      flg=1
  if flg==0:
    ans.append(i)
    for j in a:
      j.remove(i)
ans.sort()
print(*ans,sep='')
# Original solution
s=list(map(int,input().split()))
if len(s)==2:c=s[0];d=s[1]
else:c=s[0];d=int(eval(input()))
a=list(map(int,input().split()))
b=list(map(int,input().split()))
e=0;i=0
while i<d-e:
    p=i;q=0
    for j in range(c):
        if a[j]==b[p]:q+=1;p+=1
    e=max(e,q)
    i+=1
print(e)

# Optimized solution
s=list(map(int,input().split()))
if len(s)>1:c=s[0];d=s[1]
else:c=s[0];d=int(eval(input()))
a=list(map(int,input().split()))
b=list(map(int,input().split()))
e=0;i=0
while i<d-e:
    p=i;q=0
    for j in range(c):
        if a[j]==b[p]:q+=1;p+=1
    e=max(e,q)
    i+=1
print(e)
# Original solution
import itertools
p, q, r = list(map(int, input().split()))
mn = 10 ** 9
for v in itertools.combinations([p, q, r], 2):
    mn = min(mn, v[0]+v[1])
print(mn)


# Optimized solution
l = list(map(int, input().split()))
l.sort()
print((l[0]+l[1]))
# Original solution
a,b,c = list(map(int,input().split()))
A = a+b
B = b+c
C = c+a
lm = [A,B,C]
print((min(lm)))

# Optimized solution
lm = list(map(int,input().split()))
lm.sort()
print((lm[0]+lm[1]))
# Original solution
P,Q,R = list(map(int,input().split()))

sum = P + Q
if sum > P + R:
    sum = P + R
if sum > Q + R:
    sum = Q + R

print(sum)

# Optimized solution
P,Q,R = list(map(int,input().split()))
dis = [P,Q,R]
dis.sort()
print((dis[0]+dis[1]))
# Original solution
P, Q, R = list(map(int, input().split()))

print((min(P+Q, Q+R, R+P)))

# Optimized solution
P, Q, R = list(map(int, input().split()))
 
print((P + Q + R - max(P, Q, R)))
# Original solution
t = list(map(int, input().split()))
print((sum(t) - max(t)))

# Optimized solution
p, q, r = list(map(int, input().split()))
print((p + q + r - max(p, q, r)))
# Original solution
#!/home/ryo/.pyenv/versions/anaconda3-2019.03/envs/hoge/bin/python
import time
time.sleep(2)
P,Q,R = list(map(int,input().split()))
print((min(P+Q,min(Q+R,R+P))))

# Optimized solution
#!/home/ryo/.pyenv/versions/anaconda3-2019.03/envs/hoge/bin/python

P,Q,R = list(map(int,input().split()))
print((min(P+Q,min(Q+R,R+P))))
# Original solution
def main():
    A = sorted(list(map(int, input().split())))
    print((A[0] + A[1]))


if __name__ == '__main__':
    main()

# Optimized solution
def main():
    A = sorted(list(map(int, input().split())))
    print((sum(A[:2])))


if __name__ == '__main__':
    main()
# Original solution
a = input().split()
a.sort()
print((int(a[0]) + int(a[1])))

# Optimized solution
P,Q,R=list(map(int,input().split()))
a=[P+Q,Q+R,R+P]
print((min(a)))
# Original solution
p, q, r = list(map(int, input().split()))
print((p + q+ r - max(p, q, r)))

# Optimized solution
a, b, c= list(map(int, input().split()))
print(( a+b+c- max(a, b, c)))
# Original solution
A = list(map(int, input().split()))
print((sum(sorted(A)[:2])))

# Optimized solution
P, Q, R = list(map(int, input().split()))

ans = min((P + Q, Q + R, R + P))
print(ans)
# Original solution
import heapq
l = list(map(int,input().split()))

heapq.heapify(l)
print((heapq.heappop(l) + heapq.heappop(l)))


# Optimized solution
ans = list(map(int,input().split()))

ans.sort()

print((ans[0]+ans[1]))
# Original solution
pqr = list(map(int, input().split()))
pqr.sort()

print((sum(pqr[:2])))


# Optimized solution
nums = list(map(int, input().split()))
nums.sort()
print((sum(nums[:2])))
# Original solution
p,q,r=list(map(int,input().split()))
sum=min(p+q,q+r,p+r)
print(sum)





# Optimized solution

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

a.sort()

print((a[0] + a[1]))
# Original solution
num = list(map(int,input().split()))
num.sort()
print((num[0]+num[1]))



# Optimized solution
p,q,r = list(map(int,input().split()))

print((min(p+q,q+r,r+p)))
# Original solution
P , Q , R = list(map(int, input().split()))

if P >= Q and P >= R:
    print((Q + R))
elif Q >= P and Q >= R:
    print((P + R))
else:
    print((P + Q))

# Optimized solution
P , Q , R = list(map( int , input().split()))

distance = [P+Q , Q+R , R+P]

print((min(distance)))
# Original solution
def main():
    N = int(eval(input()))
    A = list(map(int, input().split()))

    c = [0] * (100000 + 1)
    for ai in A:
        c[ai] += 1

    ans = 0
    for i in range(len(c) - 2):
        ans = max(ans, c[i] + c[i+1] + c[i+2])
    print(ans)

if __name__ == "__main__":
    main()

# Optimized solution
def main():
    N = int(eval(input()))
    A = list(map(int, input().split()))

    c = [0] * (100000 + 2)
    for ai in A:
        c[ai+1] += 1
        c[ai] += 1
        c[ai+2] += 1

    print((max(c)))

if __name__ == "__main__":
    main()
# Original solution
N = int(eval(input()))

def dec(a):
    return a-1

def inc(a):
    return a+1

a = list(map(int,input().split()))
b = list(map(dec,a))
c = list(map(inc,a))

count = a+b+c

set_c = list(set(count))

c = {}
for i in range(len(set_c)):
    c[set_c[i]] = count.count(set_c[i])

print((max(c.values())))

# Optimized solution
N = int(eval(input()))

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

x = {}

for i in range(N):

    ai = a[i]

    temp = x.get(ai-1, 0)
    temp += 1
    x[ai-1] = temp

    temp = x.get(ai, 0)
    temp += 1
    x[ai] = temp

    temp = x.get(ai+1, 0)
    temp += 1
    x[ai+1] = temp

X = max(x.values())
print(X)