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

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

def function(N):
    if N == 0:
        return(2)
    elif N == 1:
        return(1)
    else:
        return(function(N-1)+function(N-2))

if __name__ == '__main__':
    N = input()
    print(function(N))


### FIXED CODE ###

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

if __name__ == '__main__':
    N = input()
    n0 = 2
    n1 = 1
    if N == 1:
        print(1)
    else:    
        now = 1
        while now != N:
            n = n0 + n1
            n0 = n1
            n1 = n
            now += 1
        print(n)
### BUGGY CODE ###

import math

x = int(input())

prms = []
n = 2
while True:
    is_prm = True
    for prm in prms:
        if n % prm == 0:
            is_prm = False
            break
    if is_prm:
        prms.append(n)
        if n >= x:
            break
    n += 1

print(n)


### FIXED CODE ###

import math

x = int(input())

prm_dict = {i: True for i in range(2, 100004)}
for n in range(2, 100004):
    if prm_dict[n]:
        if n >= x:
            break
        for nk in range(n * 2, 100004, n):
            prm_dict[nk] = False
print(n)
### BUGGY CODE ###

import sys
sys.setrecursionlimit(10**6)
N,M = map(int,input().split())

class Union_Find():

    def __init__(self,n):
        self.n = n
        self.root = [-1]*(n+1)
        self.rank = [0]*(n+1)

    #xの木の根を返す関数
    def find_root(self,x):
        if self.root[x]<0:
            return x
        else:
            self.root[x] = self.find_root(self.root[x])
            return self.root[x]

    #xの木とyの木を統合する関数
    def unite(self,x,y):
        x = self.find_root(x)
        y = self.find_root(y)

        if x==y:
            return
        else:
            if self.root[x]<self.root[y]:
                x,y=y,x
            self.root[x]+=self.root[y]
            self.root[y]=x 
        """
        elif self.rank[x]>self.rank[y]:
            self.root[x]+=self.root[y]
            self.root[y]=x
        else:
            self.root[y]+=self.root[x]
            self.root[x]=y

            if self.rank[x]==self.rank[y]:
                self.rank[y]+=1
        """



    #xとyの木の根が同じならTrueを返す関数
    def same(self,x,y):
        return self.find_root(x)==self.find_root(y)

    #xの木の要素数を返す関数
    def cnt(self,x):
        return -self.root[self.find_root(x)]

G=Union_Find(N)
ans=0
for i in range(M):
    a,b=map(int,input().split())
    G.unite(a,b)

for i in range(1,N+1):
    ans = max(ans,G.cnt(i))
print(ans)

### FIXED CODE ###

import sys
sys.setrecursionlimit(10**6)
N,M = map(int,input().split())

class Union_Find():

    def __init__(self,n):
        self.n = n
        self.root = [-1]*(n+1)
        self.rank = [0]*(n+1)

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

    def unite(self,x,y):
        x = self.find_root(x)
        y = self.find_root(y)

        if x==y:
            return
        elif self.rank[x]>self.rank[y]:
            self.root[x]+=self.root[y]
            self.root[y]=x
        else:
            self.root[y]+=self.root[x]
            self.root[x]=y

            if self.rank[x]==self.rank[y]:
                self.rank[y]+=1

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

    def cnt(self,x):
        return -self.root[self.find_root(x)]

G=Union_Find(N)
ans=0
for i in range(M):
    a,b=map(int,input().split())
    G.unite(a,b)

for i in range(1,N+1):
    ans = max(ans,G.cnt(i))
print(ans)
### BUGGY CODE ###

import numpy as np

n = int(input())
p = list(map(int,input().split()))
q = [(v,i) for i,v in enumerate(p)]
q.sort(reverse=True)
# print(q)
flg = [-1,-1,n,n]
ans = 0

for v,i in q:
    # print("(v,i)=({},{})".format(v,i))
    if not flg:
        flg.append(i)
        # print(flg)
        continue
    else:
        flg_arr = np.array(flg)
        flg_low = flg_arr[flg_arr<i]
        # print("flg_low:{}".format(flg_low))
        flg_upp = flg_arr[flg_arr>i]
        # print("flg_upp:{}".format(flg_upp))

        # if (flg_low.size >= 2) and (flg_upp.size >= 2):
        ans += v*(  (flg_low[-1]-flg_low[-2])*(flg_upp[0]-i)+
                    (flg_upp[1]-flg_upp[0])*(i-flg_low[-1]))
        # elif flg_low.size >= 2 and

        flg = list(flg_arr)
        flg.append(i)
        flg.sort()
        # print(flg)
print(ans)


### FIXED CODE ###

#!/usr/bin/env python3
N=int(input())
p=list(map(int,input().split()))
LL = [0] + [i for i in range(N+1)]
RR = [i+1 for i in range(N+1)] + [N+1]
E = [(v, i+1) for i, v in enumerate(p)]
E.sort()
ans=0
for v, i in E:
  r0 = RR[i]
  r1 = RR[r0]
  l0 = LL[i]
  l1 = LL[l0]
  RR[l0] = r0
  LL[r0] = l0

  ans += ((r1 - r0)*(i-l0)+(r0-i)*(l0 - l1))*v

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

s = list(input().strip())
n = len(s)

count = 0

if n >= 3:
  while True:
    i = n - 3
    changed = False
    while i >= 0:
      if s[i] == 'A' and s[i + 1] == 'B' and s[i + 2] == 'C':
        s[i] = 'B'
        s[i + 1] = 'C'
        s[i + 2] = 'A'
        count = count + 1
        changed = True
      i = i - 1

    if not changed:
      break

print(count)

### FIXED CODE ###

s = input().strip().replace('BC', 'D')
n = len(s)

count = 0
a_count = 0
for i in range(n):
  if s[i] == 'A':
    a_count += 1
  elif a_count > 0 and s[i] == 'D':
    count += a_count
  else:
    a_count = 0

print(count)
### BUGGY CODE ###

n,m=map(int,input().split())
a=list(int(input()) for _ in range(m))
mod=10**9+7
pattern=[0]*(n+1)
pattern[0]=pattern[1]=1
if 1 in a:
    pattern[1]=0
for i in range(2,n+1):
    if i in a:
        pattern[i]=0
    else:
        pattern[i]=(pattern[i-1]+pattern[i-2])%mod
print(pattern[n]%mod)

### FIXED CODE ###

import sys
input=sys.stdin.readline
def main():
  n,m=map(int,input().split())
  a=tuple(int(input()) for _ in range(m))
  a=set(a)
  mod=10**9+7
  pattern=[0]*(n+1)
  pattern[0]=pattern[1]=1
  if 1 in a:
      pattern[1]=0
  for i in range(2,n+1):
      if i in a:
          pattern[i]=0
      else:
          pattern[i]=(pattern[i-1]+pattern[i-2])%mod
  print(pattern[n])
main()
### BUGGY CODE ###

import sys
input=sys.stdin.readline

N = int(input())
s = []
for _ in range(N):
    s_array = sorted(input())
    x = ""
    for i in s_array:
        x += i
    s.append(x)


count = 0
for x in range(N):
    for y in range(x + 1, N):
        if s[x] == s[y]:
            count += 1
print(count)

### FIXED CODE ###

import sys
input=sys.stdin.readline

N = int(input())
hash = {}
count = 0
for _ in range(N):
    x = "".join(sorted(input()))
    if x in hash:
        count += hash[x]
    else:
        hash[x] = 0
    hash[x] += 1

print(count)
### BUGGY CODE ###

N = int(input())

nums = []
for n in range(1,N+1):
    nums.append(int(N/n))
# print(nums)

sum = 0
ro = 1
for num in nums:
    for j in range(1,num+1):
        sum += ro*j
    ro += 1
print(sum)

### FIXED CODE ###

N = int(input())
 
sum = 0
ro = 1
for n in range(1,N+1):
    num = int(N/n)
    if num == 1:
        record = n
        break
    s = int(((1+num)*num)/2)
    sum += ro*s
    ro += 1


sum += int(((record+N)*(N-record+1))/2)
print(sum)
### BUGGY CODE ###

import sys, bisect, math, itertools, string, queue, copy
import numpy as np
# import scipy
from collections import Counter,defaultdict,deque
from itertools import permutations, combinations
from heapq import heappop, heappush
from fractions import gcd
input = sys.stdin.readline
sys.setrecursionlimit(10**8)
mod = 10**9+7
def inp(): return int(input())
def inpm(): return map(int,input().split())
def inpl(): return list(map(int, input().split()))
def inpls(): return list(input().split())
def inplm(n): return list(int(input()) for _ in range(n))
def inplL(n): return [list(input()) for _ in range(n)]
def inplT(n): return [tuple(input()) for _ in range(n)]
def inpll(n): return [list(map(int, input().split())) for _ in range(n)]
def inplls(n): return sorted([list(map(int, input().split())) for _ in range(n)])

n,m = inpm()
way = [[] for _ in range(n+1)]
for i in range(m):
    a,b = inpm()
    way[a].append(b)
    way[b].append(a)

ans = [0 for i in range(n+1)]
q = queue.Queue()
q.put((1,0))
while not q.empty():
    room,sign = q.get()
    if ans[room] != 0:
        continue
    ans[room] = sign

    for i in way[room]:
        q.put((i,room))

print('Yes')
for i in range(2,n+1):
    print(ans[i])

### FIXED CODE ###

import sys, bisect, math, itertools, string, queue, copy
# import numpy as np
# import scipy
# from collections import Counter,defaultdict,deque
# from itertools import permutations, combinations
# from heapq import heappop, heappush
# from fractions import gcd
# input = sys.stdin.readline
sys.setrecursionlimit(10**8)
mod = 10**9+7
def inp(): return int(input())
def inpm(): return map(int,input().split())
def inpl(): return list(map(int, input().split()))
def inpls(): return list(input().split())
def inplm(n): return list(int(input()) for _ in range(n))
def inplL(n): return [list(input()) for _ in range(n)]
def inplT(n): return [tuple(input()) for _ in range(n)]
def inpll(n): return [list(map(int, input().split())) for _ in range(n)]
def inplls(n): return sorted([list(map(int, input().split())) for _ in range(n)])

n,m = inpm()
way = [[] for _ in range(n+1)]
for i in range(m):
    a,b = inpm()
    way[a].append(b)
    way[b].append(a)

ans = [0 for i in range(n+1)]
q = queue.Queue()
q.put((1,0))
while not q.empty():
    room,sign = q.get()
    if ans[room] != 0:
        continue
    ans[room] = sign

    for i in way[room]:
        q.put((i,room))

print('Yes')
for i in range(2,n+1):
    print(ans[i])
### BUGGY CODE ###

from collections import deque
import sys
def main():
    H,W = list(map(int,sys.stdin.readline().split()))
    A = [sys.stdin.readline().split() for i in range(H)]
    place_h = [0,-1,0,1]
    place_w = [1,0,-1,0]
    black = 0
    q = []
    dist = []
    for i in range(H):
        A[i] = list(A[i][0])
        dist_sub = []
        for j in range(W):
            if A[i][j] == "#":
                black += 1
                q.append(deque([[i,j]]))
                dist_sub.append(0)
            else:
                dist_sub.append(-1)
        dist.append(dist_sub)

    ans = 0
    count=0
    while count < black:
        for i in range(black):
            if len(q[i]) == 0:
                count += 1
                q[i].append(-1)
                continue
            if q[i][0] == -1:
                continue
            vh,vw = q[i].popleft()
            for m in range(4):
                nvh = vh+place_h[m]
                nvw = vw+place_w[m]
                if 0<=nvh<H and 0<=nvw<W and dist[nvh][nvw] == -1:
                    q[i].append([nvh,nvw])
                    dist[nvh][nvw] = dist[vh][vw]+1
                    if ans < dist[nvh][nvw]:
                        ans = dist[nvh][nvw]

    print(ans)

if __name__ == "__main__":
    main()




### FIXED CODE ###

from collections import deque
import sys
def main():
    H,W = list(map(int,sys.stdin.readline().split()))
    place_h = [0,-1,0,1]
    place_w = [1,0,-1,0]
    black = 0
    q = deque([])
    dist = []
    A = []
    for i in range(H):
        a = sys.stdin.readline().split()
        a = list(a[0])
        dist_sub = []
        for j in range(W):
            if a[j] == "#":
                black += 1
                q.append([i,j])
                dist_sub.append(0)
            else:
                dist_sub.append(-1)
        A.append(a)
        dist.append(dist_sub)

    ans = 0
    
    while len(q) > 0:
        vh,vw = q.popleft()
        for m in range(4):
            nvh = vh+place_h[m]
            nvw = vw+place_w[m]
            if 0<=nvh<H and 0<=nvw<W and dist[nvh][nvw] == -1:
                q.append([nvh,nvw])
                dist[nvh][nvw] = dist[vh][vw]+1
                if ans < dist[nvh][nvw]:
                    ans = dist[nvh][nvw]

    print(ans)

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

N = int(input())
a = [int(i) for i in input().split()]

b = list(set(a))

ans = 0
for i in b:
    if a.count(i) < i:
        ans += a.count(i)
    else:
        ans += a.count(i) - i

print(ans)


### FIXED CODE ###

from collections import Counter as ct

N = int(input())
a = [int(i) for i in input().split()]
c = ct(a)

ans = 0
for i, j in c.items():
    if i <= j:
        ans += j - i
    else:
        ans += j

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

n=int(input())
a=list(map(int,input().split()))
q=int(input())
for i in range(q):
    b,c=map(int,input().split())
    for j in range(len(a)):
        if a[j] == b:
            a[j]=c
    print(sum(a))

### FIXED CODE ###

n=int(input())
a=list(map(int,input().split()))
import collections
coll=collections.Counter(a)
q=int(input())
suma=sum(a)
lis=[0]*(10**5+1)
for i in a:
    lis[i-1]=coll[i] #lisの「番め」の数字が、aに何個あるか

for i in range(q):
    ans=0
    b,c=map(int,input().split())
    sa=c-b
    lis[c-1]+=lis[b-1]
    ans+=sa*lis[b-1]
    lis[b-1]=0
    suma+=ans
    print(suma)
### BUGGY CODE ###

N = int(input())
input_line = [input() for _ in range(N)]
temp = 0
result = []
for x in list(set(input_line)):
    if temp < input_line.count(x):
        temp = input_line.count(x)
        result = []
        result.append(x)
    elif temp == input_line.count(x):
        temp = input_line.count(x)
        result.append(x)
for x in sorted(result):
    print(x)

### FIXED CODE ###

N = int(input())
input_line = [input() for _ in range(N)]
count = {}
for w in input_line:
    if w in count:
        count[w] += 1
    else:
        count[w] = 1
max_values = max(count.values())
keys = [k for k, v in count.items() if v == max_values]
for w in sorted(keys):
    print(w)
### BUGGY CODE ###

N=int(input())
S=input()
# 15:00~
# N=4
# S="RRGB"
# j-i!=k-j
# i,j,kで文字が違う。
# print(S[1])

ans=0
for i in range(N):
    for j in range(N):
        for k in range(N):
            if (j-i)!=(k-j):
                if S[i]!=S[j] and S[j]!=S[k] and S[i]!=S[k]:
                    if i<=j and j<=k:
                        # print("i,j,k=",i,j,k,S[i],S[j],S[k])
                        ans+=1
print(ans)


### FIXED CODE ###

N=int(input())
S=input()
r,g,b=0,0,0
for i in range(N):
    if S[i]=="R":
        r+=1
    elif S[i]=="G":
        g+=1
    elif S[i]=="B":
        b+=1
# j-i=k-j  2j-i-k=0 k=i-2j について調べるもしRGBなら、それをrgbからマイナスする
tmp=0
for i in range(N):
    for j in range(i+1,N):
        k=2*j-i
        if k<N and k>=0:
            if S[i]!=S[j] and S[i]!=S[k] and S[j]!=S[k]:
                tmp+=1
# print("rgb",r*g*b)
# print("tmp",tmp)
print(r*g*b-tmp)
### BUGGY CODE ###

from sys import exit
N = int(input())
A = list(map(int,input().split()))
ans = 1
if 0 in A: print(0)
else:
    for i in A:
        ans *= i
    if ans > 10 ** 18:
        print(-1)
    else:         
        print(ans)        


### FIXED CODE ###

from sys import exit
N = int(input())
A = list(map(int,input().split()))
ans = 1
if 0 in A: print(0)
else:
    for i in A:
        ans *= i
        if ans > 10 ** 18:
            print(-1)
            exit()
    print(ans)
### BUGGY CODE ###

N, K = map(int, input().split())
A =list(map(int, input().split()))
k = bin(K)[2:]

def add_zero(text):
    if len(text) < len(k):
        mozi = ""
        for i in range(len(k) - len(text)):
            mozi += "0"
        return mozi + text
    else:
        return text

B = [bin(i)[2:] for i in A ]
B = list(map(add_zero, B))

ans_li = []
for index, i in enumerate(k):
    if i == "1":
        str = ""
        for j in range(len(k)-index-1):
            count = 0
            for l in B:
                if l[-j-1] == "1":
                    count += 1
            if count > len(B) - count:
                str = "0" + str
            else:
                str = "1" + str
        ans_li.append(k[:index] + "0" + str)

ans_li.append(k)
ans_li2 = [int("0b"+i, 2) for i in ans_li]
max_score = 0
for i in ans_li2:
    score = 0
    for j in A:
        score += i^j
    max_score = max(score, max_score)

print(max_score)

### FIXED CODE ###

N, K = map(int, input().split())
A =list(map(int, input().split()))
k = bin(K)[2:]

def add_zero(text):
    if len(text) < len(k):
        mozi = ""
        for i in range(len(k) - len(text)):
            mozi += "0"
        return mozi + text
    else:
        return text

B = [bin(i)[2:] for i in A ]
B = list(map(add_zero, B))

ans_li = []
for index, i in enumerate(k):
    if i == "1":
        str = ""
        for j in range(len(k)-index-1):
            count = 0
            for l in B:
                if l[-j-1] == "1":
                    count += 1
            if count > len(B) - count:
                str = "0" + str
            else:
                str = "1" + str
        ans_li.append(k[:index] + "0" + str)

ans_li.append(k)
ans_li2 = [int("0b"+i, 2) for i in ans_li]
max_score = 0
for i in ans_li2:
    score = 0
    for j in A:
        score += i^j
    max_score = max(score, max_score)

print(max_score)
### BUGGY CODE ###

N = int(input())
A =[int(input()) for _ in range(N)]
M = max(A)

for i in range(N):
  if A[i] != M:
    print(M)
  else:
    a = A[:i] + A[i+1:]
    print(max(a))

### FIXED CODE ###

N = int(input())
A = [int(input()) for _ in range(N)]
a = sorted(set(A))
max_count = A.count(a[-1])

for i in range(N):
  if len(a) > 1:
    if A[i] != a[-1]:
      print(a[-1])
    else:
      if max_count > 1:
        print(a[-1])
      else:
        print(a[-2])
  else:
    print(a[-1])
### BUGGY CODE ###

N = int(input())
A = [int(i) for i in input().split()]

for i in range(N):
    num = 0
    pos = 0
    for ai, av in enumerate(A):
        if ai == i:
            continue
        num += abs(pos - av)
        pos = av
    num += abs(pos - 0)
    print(num)

### FIXED CODE ###

N = int(input())
A = [0] * (N + 2)
for i, v in enumerate(input().split()):
    A[i+1] = int(v)
num = sum([abs(A[i] - A[i+1]) for i in range(N+1)])
for i in range(1,N+1):
    ret = num + abs(A[i-1] - A[i+1]) - (abs(A[i-1] - A[i]) + abs(A[i] - A[i+1]))
    print(ret)
### BUGGY CODE ###

c=0
n=int(input())
for _ in range(n):
 x=int(input())
 if x!=2 and x%2==0:c+=1;continue
 for i in range(3,x,2):
  if x%i==0:c+=1;break
print(n-c)


### FIXED CODE ###

import sys
input()
def s():print(sum(2 in[x,pow(2,x,x)]for x in map(int,sys.stdin.readlines())))
if'__main__'==__name__:s()
### BUGGY CODE ###

N = int(input())
S = list(input())
Q = int(input())
set_dic = {}

for i, s in enumerate(S):
    if s not in set_dic.keys():
        set_dic[s] = {i+1}
    else:
        set_dic[s].add(i+1)

anslist = []
count = 0

for _ in range(Q):
    query1,query2,query3 = input().split()
    if query1 == "1":
        i = int(query2)
        c = query3
        for l in set_dic.values():
            l.discard(i)
        if c not in set_dic.keys():
            set_dic[c] = {i}
        else:
            set_dic[c].add(i)
    else:
        l = int(query2)
        r = int(query3)
        ansset = set()
        for i in range(l, r + 1):
            for key, eachset in set_dic.items():
                if i in eachset:
                    ansset.add(key)
                    break
        ans = len(ansset)
        anslist.append(ans)
        count += 1

for i in anslist:
    print(i)

### FIXED CODE ###

import bisect
import sys
input = sys.stdin.readline

def solve():
    N = int(input())
    S = list(input())
    Q = int(input())
    set_dic = {}

    for i, s in enumerate(S):
        if s not in set_dic:
            set_dic[s] = [i+1]
        else:
            bisect.insort_left(set_dic[s], i+1)

    anslist = []

    for _ in range(Q):
        query1, query2, query3 = input().split()
        if query1 == "1":
            i = int(query2)
            c = query3
            cap = S[i-1]
            if cap == c:
                continue
            set_dic[cap].remove(i)
            if c not in set_dic:
                set_dic[c] = [i]
            else:
                bisect.insort_left(set_dic[c], i)
            S[i-1] = c
        else:
            l = int(query2)
            r = int(query3)
            ansset = set()
            ans = 0
            for eachlist in set_dic.values():
                li = bisect.bisect_left(eachlist, l)
                ri = bisect.bisect_right(eachlist, r)
                if li != ri:
                    ans += 1
            anslist.append(ans)

    for i in anslist:
        print(i)

if __name__ == '__main__':
    solve()
### BUGGY CODE ###

l,r = [int(i) for i in input().split()]
dr = r//2019
lr = l//2019
r=r%2019
r+=2019*(dr-lr)
l=l%2019
m=10**10
for i in range(l,r):
  for j in range(i+1,r+1):
    m=min(m,(i*j)%2019)
print(m)
    

### FIXED CODE ###

l,r = [int(i) for i in input().split()]
if(r//2019>l//2019):print(0)
else:
  r=r%2019
  l=l%2019
  if(r<=l):
    print(0)
  else:
    m=10**10
    for i in range(l,r):
      for j in range(i+1,r+1):
        m=min(m,(i*j)%2019)
    print(m)
### BUGGY CODE ###

n,k=map(int,input().split())
a=list(map(int,input().split()))
s=set()
for i in range(n):
     for j in range(i,n):
          s.add(bin(sum(a[i:j+1]))[2:].zfill(40))
s=list(s)
d={i:set() for i in range(40)}
for i in range(len(s)):
     for j in range(40):
          if s[i][39-j]=='1':
               d[j].add(i)
f=True
for i in range(40):
     s_=d[39-i]
     if len(s_)>=k:
          if f:
               se=s_
               f=False
          else:
               if len(se&s_)>k:
                    se&=s_
               elif len(se&s_)==k:
                    se&=s_
                    break
se=list(se)
ans=int(s[se[0]],base=2)
for i in range(1,k):
     ans&=int(s[se[i]],base=2)
print(ans)

### FIXED CODE ###

n,k=map(int,input().split())
a=list(map(int,input().split()))
s=set()
for i in range(n):
     su=0
     for j in range(i,n):
          su+=a[j]
          s.add(su)
s=list(s)
x=0
for i in range(40):
     x_=x+2**(39-i)
     cnt=0
     for a in s:
          if x_&a==x_:
               cnt+=1
     if cnt>=k:
          x=x_
print(x)
### BUGGY CODE ###

K,S=map(int,input().split())
ans=0
for x in range(K+1):
  for y in range(K+1):
    for z in range(K+1):
      if x+y+z==S:
        ans+=1
print(ans)


### FIXED CODE ###

K,S=map(int,input().split())
a=0

for x in range(K+1):
  if K<S-x<=2*K:
    a+=2*K-S+x+1
  elif 0<=S-x<=K:
    a+=S-x+1
  else:
    a+=0

print(a)
### BUGGY CODE ###

def cmb(n, r, mod):
    if (r < 0 or r > n):
        return 0
    r = min(r, n - r)
    return g1[n] * g2[r] * g2[n - r] % mod


mod = 10 ** 9 + 7  # 出力の制限
N = 10 ** 9
g1 = [1, 1]  # 元テーブル
g2 = [1, 1]  # 逆元テーブル
inverse = [0, 1]  # 逆元テーブル計算用テーブル

for i in range(2, N + 1):
    g1.append((g1[-1] * i) % mod)
    inverse.append((-inverse[mod % i] * (mod // i)) % mod)
    g2.append((g2[-1] * inverse[-1]) % mod)

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

# mod = 10 ** 9 + 7
ans = (2 ** n - 1) - (cmb(n, a, mod) + cmb(n, b, mod))
print(ans)


### FIXED CODE ###

n, a, b = map(int, input().split())
mod = 10 ** 9 + 7
#2 ** n はだめ
n_max = pow(2, n, mod) - 1


def comb_mod(n, r, mod):
    num = 1
    den = 1
    for i in range(r):
        num = (num * (n - i)) % mod
        den = (den * (i + 1)) % mod
    den_r = pow(den, mod - 2, mod)
    return (num * den_r) % mod


ans = (n_max - comb_mod(n, a, mod) - comb_mod(n, b, mod)) % mod
print(ans)
### BUGGY CODE ###

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


l = 0
r = 10 ** 20
while r - l > 1:
    m = (r + l) // 2
    N = m
    for a in A:
        N -= max(N % a, 0)
    if N > 2:
        r = m
    else:
        l = m
upper = l


l = 0
r = 10 ** 20
while r - l > 1:
    m = (r + l) // 2
    N = m
    for a in A:
        N -= max(N % a, 0)

    if N < 2:
        l = m
    else:
        r = m
lower = r

if lower > upper:
    print(-1)
else:
    print(lower, upper)


### FIXED CODE ###

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

l, r = 1, 10 ** 18
while r - l > 1:
    m = (l + r) // 2
    M = m
    for a in A:
        M = (M // a) * a

    if M <= 2:
        l = m
    else:
        r = m
ans_max = l

l, r = 1, 10 ** 18
while r - l > 1:
    m = (l + r) // 2
    M = m
    for a in A:
        M = (M // a) * a

    if M >= 2:
        r = m
    else:
        l = m
ans_min = r

if ans_min > ans_max:
    print(-1)
else:
    print(ans_min, ans_max)