peterverebics/CodeNet_Python_428 huggingface dataset:
# Judge status: Accepted
a,b,c,d = input()
for i in range(2**3):
  ls = ["+","+","+"]
  for j in range(len(ls)):
    if (i>>j) & 1:
      ls[j]="-"
  if eval(a+ls[0]+b+ls[1]+c+ls[2]+d) == 7:
        print(a+ls[0]+b+ls[1]+c+ls[2]+d+"=7")
        break
# Judge status: Wrong Answer
S = list(input())
L = len(S)
Slist = set()
for i in range(L):
    Slist.add(ord(S[i]))
Slist = list(Slist)
Slist.sort()
ans = "None"
j = 0
L = len(Slist)
for i in range(97, 123):
    if Slist[j] == i:
        j += 1
        if j >= L:
            ans = chr(i+1)
            break
        continue
    ans = chr(i)
    break
print(ans)
# Judge status: Accepted
n = int(input())
num = [int(i) for i in input().split()]

count = 1
vertexCount = 0
rem = sum(num)
for m in num:
    vertexCount += count
    count -= m
    rem -= m
    if count < 0:
        vertexCount = -1
        break
    count = min(count*2, rem)

print(vertexCount)
# Judge status: Wrong Answer
import sys
input=sys.stdin.readline
import math

A,B = (int(x) for x in input().rstrip('\n').split())
c = math.gcd(A,B)
if c==1:
  print(1)
else:
  res = 1
  ps=[]
  d = math.floor(math.sqrt(c))
  for i in range(2,d+2):
    if c%i==0:
      if all(i%x!=0 for x in ps):
        res += 1
        ps.append(i)
  if res == 1:
    res += 1
  print(res)
# Judge status: Wrong Answer
n,k=map(int,input().split())
h=list(map(int,input().split()))
cost=[float("inf")]*n
cost[0]=0
cost[1]=abs(h[1]-h[0])

for i in range(1,n-1):
    for j in range(1,k+1):
        if i+j>n-1:
            continue
        else:
            cost[i+j]=min(abs(h[i+j]-h[i])+cost[i] ,cost[i+j])

print(cost[n-1])
# Judge status: Wrong Answer


def main():
    N, K = map(int, input().split())
    H = list(map(int, input().split()))
    H = sorted(H, reverse=True)
    count = 0
    if K >= N:
        print(0)
    elif K == 0:
        print(sum(H))
    else:
        for i in range(K):
            H[i] = 0
            print(sum(H))


if __name__ == "__main__":
    main()
# Judge status: Wrong Answer
N, K = list(map(int, input().split()))
P = list(map(int, input().split()))
P = sorted(P)
print(P)
P = P[0:K]
print(sum(P))
# Judge status: Accepted
# A - A+...+B Problem
# https://atcoder.jp/contests/agc015/tasks/agc015_a

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

ans = (b * (n - 1) + a) - (a * (n - 1) + b) + 1
print(max(ans, 0))
# Judge status: Accepted
import sys

S = input()
T = input()

if len(S) == len(T):
    changeCounter = 0
    for j in range(len(S)):
        if not S[j] == T[j]:
            changeCounter += 1
    print(changeCounter)
    sys.exit()

minChangeCounter = 1000000
for i in range(len(S) - len(T)):
    substr = S[i:i + len(T)]
    changeCounter = 0
    for j in range(len(T)):
        if not substr[j] == T[j]:
            changeCounter += 1
    if changeCounter < minChangeCounter: minChangeCounter = changeCounter
print(minChangeCounter)
# Judge status: Wrong Answer
n = int(input())
As = sorted(list(map(int,input().split())))

ans = As[0]
for a_i in As[1:]:
    tmp = a_i % ans
    if tmp != 0 and tmp < ans:
        ans = tmp
    if ans == 1:
        break
print(ans)
# Judge status: Wrong Answer
from math import log

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

ans = 0

for i in range(n):
    if (i+1)<k:
        ans += (1/n) * 0.5**((log(k/(i+1), 2)//1)+1)
    else:
        ans += (1/n)
    
print(ans)
# Judge status: Accepted
N=int(input())
# 1011: -9
# 101  1 + 4 =5
# 10: -2
# 1

def calc(x):
    ans=""
    
    while True:

        if x%2==0:
            ans="0"+ans
        else:
            ans="1"+ans
            x-=1
        if x==0:
            break

        x = x//(-2)
    return ans

a=calc(N)

print(a)
# Judge status: Accepted
N, K = map(int, input().split())
print(min(-N%K, N%K))
# Judge status: Wrong Answer
N=int(input())
S=list(map(int,input().split()))

D=[0]*9
for s in S:
    s//=400
    if(s>=8):
        s=8
    D[s]+=1
c=0
for i in range(8):
    if(D[i]==0):
        c+=1
print(max(8-c,min(D[8],1)),min(8-c+min(c,D[8]),8))
# Judge status: Accepted
import sys
input = sys.stdin.readline

n = int(input())
A = list(map(int,input().split()))
mod = 10**9 + 7

B = [A[0]]
for i in range(1, n):
    B.append((B[-1] + A[i]) % mod)

ans = 0
for i in range(n-1,0,-1):
    ans = (ans + B[i-1] * A[i])
print(ans%mod)
# Judge status: Accepted
#098_C
n=int(input())
s=input()

sw=[0 for i in range(n)]
for i in range(n):
    if i==0:
        sw[0]+=(s[i]=='W')
    else:
        sw[i]=sw[i-1]+(s[i]=='W')
        
ans=10**6
for i in range(n):
    res=(n-i-1)-(sw[-1]-sw[i])
    if i>0:
        res+=sw[i-1]
    ans=min(ans,res)
print(ans)
# Judge status: Accepted
w,h,x,y = map(int,input().split())
s=0
ans=0
if w==2*x and h==2*y:
    ans=1
s=(w*h)/2
print(s,ans)
# Judge status: Accepted
from collections import defaultdict
n = int(input())

counter = defaultdict(int)
for x in map(str, range(1, n+1)):
    head = x[0]
    tail = x[-1]
    counter[(head, tail)] += 1

ans = 0
items = list(counter.items())
for (head,tail), cnt in items:
    ans += cnt * counter[(tail,head)]
print(ans)
# Judge status: Accepted
n = int(input())
s = [input() for _ in range(n)]
new_s = []
cnt = {}
ans = 0

for i in s:
    new_s.append(str(sorted(i)))

for i in new_s:
    if i in cnt.keys():
        cnt[i] += 1
    else:
        cnt[i] = 1
for v in cnt.values():
    ans += v * (v-1) // 2

print(ans)
# Judge status: Accepted
N = int(input())

def dfs(s, mx):
    if (len(s) == N):
        print(s)
        return
    for i in range(mx + 1):
        dfs(s + chr(97 + i), mx + (i == mx))

dfs('', 0)
# Judge status: Accepted
n,k = map(int,input().split())
dic = {}
for i in range(n):
  a,b = map(int,input().split())
  if a in dic:
    dic[a] += b
  else:
    dic[a] = b
dic2 = sorted(dic.items()) 
count = 0
for i in range(len(dic2)):
  count += dic2[i][1]
  if count >= k:
    print(dic2[i][0])
    break
# Judge status: Accepted
N = int(input())
a = [0] + list(map(int, input().split()))
cnt = 0
for i in range(1, N+1):
    ai = a[i]
    if i%2 == 1 and ai%2 == 1:
        cnt += 1
print(cnt)
# Judge status: Accepted
import sys
input = sys.stdin.readline

n = int(input())
l = [0] * 87
l[0] = 2
l[1] = 1
for i in range(2, 87):
    l[i] = l[i - 1] + l[i - 2]
print(l[n])
# Judge status: Wrong Answer
n=int(input())
a=list(map(int,input().split()))
ans=[0]*n
for i in range(n):
    num1=n-i
    num2=0
    for j in range((n//num1)-1):
        num2+=ans[num1*(j+2)-1]
    num2%=2
    ans[-1-i]=(num2+a[-1-i])%2
print(ans.count(1))
print(*ans)
# Judge status: Wrong Answer
S, T = input().split()
A, B = map(int, input().split())
U = input()
print((A-1, B) if S==U else (A, B-1))
# Judge status: Accepted
from bisect import bisect
from itertools import accumulate
N = int(input())
A = sorted(map(int, input().split()))
B = sorted(map(int, input().split()))
C = sorted(map(int, input().split()))
D = list(accumulate(N - bisect(C, b) for b in reversed(B))) + [0]
print(sum(D[N - bisect(B, a) - 1] for a in A))
# Judge status: Accepted
#48b
a,b,x = map(int, input().split())

down = a//x
if down*x == a:
  down -= 1

up = b//x
#print(up,down)
print(up - down)
# Judge status: Accepted
n,l = map(int,input().split())

r = []
for i in range(n):
    r.append(i+l)
    
r.sort()

if r[0]>0:
    print(sum(r[1:]))
elif r[-1]<0:
    print(sum(r[:-1]))
else:
    print(sum(r))
# Judge status: Wrong Answer
a, b, c = map(int,input().split())
if a == b:
    if a == c:
        print("No")
    else:
        print("Yes")
elif a == c:
    print("Yes") 
else:
    print("No")
# Judge status: Accepted
n=int(input())
ans=float('inf')
for i in range(1,int(n**0.5)+2):
  if n%i==0:
    ans=min(ans,n//i-1+i-1)
print(ans)
# Judge status: Wrong Answer
from operator import mul
def plus(n):
    return n+1


rows = int(input())
c = list(map(int, input().split()))
s = [[int(j) for j in input().split()] for i in range(rows)]

for i in range(rows):
    print(i)
# Judge status: Wrong Answer
K,S= map(int,input().split())

ans = 0
for X in range(K+1):
    T = S-X
    if T <= K:
        ans += T+1
    else:
        ans += max(2*K-T+1,0)
print(ans)
# Judge status: Accepted
sa = [i for i in input()]
sb = [i for i in input()]
sc = [i for i in input()]
ck = sa[0]
sa.pop(0)
while True:
  if ck == "a":
    if len(sa)== 0:
      print("A")
      exit()
    ck = sa.pop(0)
  elif ck == "b":
    if len(sb)== 0:
      print("B")
      exit()
    ck = sb.pop(0)
  elif ck == "c":
    if len(sc)== 0:
      print("C")
      exit()
    ck = sc.pop(0)
# Judge status: Wrong Answer
import math
N = int(input())
A = list(map(int, input().split()))
C = 1
m = A[0]
M = A[0]
money = 1000;
for i in range(1,N):
  if C == 1 and M <= A[i]:
    M = A[i]
  elif C == 1 and M > A[i]:
    money = (money % m) + math.floor(money / m)*M
    C = 0
    m = A[i]
    print(money)
  elif C == 0 and m >= A[i]:
    m = A[i]
  elif C == 0 and m < A[i]:
    M = A[i]
    C = 1
if C == 1:
  money = (money % m) + math.floor(money / m)*M
  print(money)
# Judge status: Accepted
a, b, c = map(int, input().split())
print(max(b + c - a, 0))
# Judge status: Accepted
N=int(input())
A=list(map(int,input().split()))
zero=False
minus=0
for i in range(N):
    if A[i]<0:
        A[i]*=-1
        minus=1-minus
    elif A[i]==0:
        zero=True

A.sort(reverse=True)
if zero==True:
    print(sum(A))
else:
    if minus==0:
        print(sum(A))
    else:
        print(sum(A[0:N-1])-A[-1])
# Judge status: Accepted
from math import sqrt


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

ans = 1
for i in range(1, int(sqrt(M)) + 1):
    if M % i == 0:
        j = M // i
        if M / N >= j:
            ans = max(ans, j)
        elif M / N >= i:
            ans = max(ans, i)

print(ans)
# Judge status: Accepted
import re
a=0
for m in re.findall('(<*)(>*)',input()):u,v=map(len,m);a-=(u*~u+v*~v)//2+min(u,v)
print(a)
# Judge status: Accepted
n = int(input())
a,b=[],[]

for i in range(n):
    x,y = map(int,input().split())
    a.append(x)
    b.append(y)

a=list(reversed(a))
b=list(reversed(b))

OK=0
for i in range(n):
    A=a[i]+OK
    ok=-(-A//b[i])*b[i]-A
    OK+=ok

print(OK)
# Judge status: Wrong Answer
#500円通貨1枚につき1000
#5円通貨1枚につき5
#高橋君はx円持ってる
#利用できる通貨は500円,100円,10円,5円,1円
#入力 1024

x=input()
x1=int(x) 

#まず入力を500で何回われるかを数えその回数で割り,残った値を変数に格納
r=x1/500
x2=x1%500

#同じ操作を5でおこなう
r1=x2/5
x3=x2%5

sam=(r*1000)+(r1*5)

print("sam")
# Judge status: Wrong Answer
# = int(input())
# = map(int, input().split())
# = list(map(int, input().split()))
# = list(input())
# = [tuple(map(int, input().split())) for _ in range(n)]

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

if n == m:
    print('AC')
else:
    print('WA')
# Judge status: Wrong Answer
N, K, Q = list(map(lambda n: int(n), input().split(" ")))
point = [K - Q] * N
for i in range(Q):
  c = int(input())
  point[c - 1] += 1

print("\n".join(["YES" if p > 0 else "NO" for p in point]))
# Judge status: Accepted
# -*- coding: utf-8 -*-
"""
Created on Wed Sep 23 20:22:31 2020

@author: liang
"""

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

A.sort(reverse=True)

ans = list()
i = 0
while i < N-1:
    if A[i] == A[i+1]:
       # print("A")
        ans.append(A[i])
        i += 1
    if len(ans) == 2:
        break
    i += 1

import numpy as np
#print(ans)
if len(ans) < 2:
    print(0)
else:
    print(np.prod(ans))
# Judge status: Accepted
a=int(input())
b=int(input())
c=int(input())
d=int(input())
e=int(input())
k=int(input())

if e-a <= k:
    print("Yay!")
else:
    print(":(")
# Judge status: Accepted
def f(s):

	return tuple([(0<int(s[2*i:2*i+2]) <= 12)	for i in range(2)])
		
print {(0,0):'NA', (0,1): 'YYMM', (1,0): 'MMYY', (1,1):'AMBIGUOUS'}[tuple(map(int,list(f(raw_input()))))]
# Judge status: Accepted
n,k = map(int,input().split())
s = input()
compressed = []
prev = ""
for i in s:
    if i != prev:
        compressed.append(i)
        prev=i
happy=len(compressed)-1
print(n-1-max(0,happy-2*k))
# Judge status: Accepted
s, w = [int(x) for x in input().split()]

if w >= s:
    print('unsafe')
else:
    print('safe')
# Judge status: Accepted
ans = int(input()) % 1000
if ans == 0:
    print(0)
    exit(0)
print(1000 - ans)
# Judge status: Accepted
# solution
data=int(input())
strs=(data*(data-1))//2
print(strs)
# Judge status: Accepted
n, q = map(int, input().split())
s = list(input())
dp = [0]*(n+10)
for i in range(n):
  if i == 0:
    continue
  else:
    if s[i]=='C' and s[i-1]=='A':
      dp[i+1] = dp[i] + 1
    else:
      dp[i+1] = dp[i]
for i in range(q):
  l, r = map(int, input().split())
  if l == 1:
    print(dp[r])
  else:
    if s[l-1]=='C' and s[l-2]=='A':
      print(dp[r]-dp[l-1]-1)
    else:
      print(dp[r]-dp[l-1])
# Judge status: Accepted
n = int(input())
s = input()
m = -1
for i in range(n):
    l = set(s[:i])
    r = set(s[i:])
    m = max(len(l.intersection(r)), m)
print(m)
# Judge status: Accepted
x=int(input())
print(abs(1-x))
# Judge status: Accepted
A = int(input())
B = int(input())
print(6 - (A + B))
# Judge status: Wrong Answer
n = int(input())
l = list(map(int, input().split()))
ogya = list()

for i in range (0, n):
	if i%2==0:
		ogya.append(l[i])
	else:
		ogya.insert(0, l[i])

if n%2==0:
	print(ogya, sep=" ")
else:
	ogya.reverse()
	print(ogya, sep=" ")
# Judge status: Accepted
import sys

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

if B-A<=2:
    print(K+1)
    sys.exit()

S=A
K-=A-1
S+=(B-A)*(K//2)
if K%2:
    S+=1
print(S)
# Judge status: Accepted
A1 = 0
B1, B2, B3 = map(int, input().split())
C1, C2, C3 = map(int, input().split())
D1, D2, D3 = map(int, input().split())
flag = 0
if not( C2-B2 == C1-B1 and C3-B3 == C1-B1 and C2-B2 == C3-B3):
    flag = 1
if not( D2-B2 == D1-B1 and D3-B3 == D1-B1 and D2-B2 == D3-B3):
    flag = 1
print("Yes" if flag == 0 else "No")
# Judge status: Accepted
import math
x,y = map(int ,input().split())
m = math.ceil(math.log(x, y))
if m == 0 :m=m+1
print(m)
# Judge status: Wrong Answer
n = int(input())
s = input()
li_s = list(s)

import collections
c = collections.Counter(li_s)
cci = c.items()
tmp = 1
for cc in cci:
    #print(cc[1])
    tmp *= (cc[1]+1)
print(tmp-1)
# Judge status: Accepted
s=list(input())
for i in range(len(s)):
    if s[i]=='?':
        s[i]='D'
print(''.join(s))
# Judge status: Accepted
N = int(input())
S_tuple =[]
for i in range(N):
	S = str(input())
	S_tuple.append(S)

import collections

S_count= collections.Counter(S_tuple)
print(len(S_count.keys()))
# Judge status: Accepted
AB, BC, CA = map(int, input().split())

area = int((AB * BC) / 2)

print(area)
# Judge status: Accepted
S,W = map(int,input().split())


if S > W:
    print("safe")
else:
    print("unsafe")
# Judge status: Wrong Answer
import sys
n,k=map(int, input().split()) #a1 a2 a3

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

bcnt=icnt=0

for ab in com:
  icnt+=1
  if icnt==n:
    print(ab[1])
    sys.exit(0)

  if bcnt+ab[1]<k:
    bcnt+=ab[1]
    preab=ab[0]
  else:
    print(preab)
    sys.exit(0)
# Judge status: Wrong Answer
n = int(input())
if n % 2 ==0:
  print(n / 2)
else:
  print(n // 2 + 1)
# Judge status: Accepted
N = int(input())
A = list(map(int,input().split()))
B = list(map(int,input().split()))
ans = 0
for i in range(N):
	if A[i] >= B[i]:
		ans += B[i]
	else:
		ans += A[i]
		ch = B[i] - A[i]
		if ch > A[i+1]:
			ans += A[i+1]
			A[i+1] = 0
		else:
			ans += ch
			A[i+1]-=ch
print(ans)
# Judge status: Accepted
from sys import exit

w = list(input())

w_set = list(set(w))

for i in range(len(w_set)):
  if w.count(w_set[i]) % 2 != 0:
    print("No")
    exit()
  else:
    if i == len(w_set)-1: print("Yes")
# Judge status: Accepted
input()
*p,=map(int,input().split())
print('YNEOS'[2<sum(1 for i,j in zip(p,sorted(p)) if i!=j)::2])
# Judge status: Accepted

S = list(map(int, list(input())))
N = len(S)
P = 673

cnt = [[0,0,0]  for i in range(P)]
cnt[0][0] = 1
rem1 = 0
rem2 = 0
ans = 0


for i in range(N):
    rem1 = (int(S[-i - 1]) * pow(10, i, P) + rem1) % P
    rem2 = (int(S[-i - 1]) * pow(10, i, 3) + rem2) % 3
    ans += cnt[rem1][rem2]
    cnt[rem1][rem2] += 1

print(ans)
# Judge status: Accepted
def main(N):
    print("Yes" if N >= 30 else "No")


N = int(input())
main(N)
# Judge status: Accepted
import sys
def main():
    S=sys.stdin.readline().strip()
    T=list(sys.stdin.readline().strip())
    T=''.join(T[:-1])
    print('Yes') if S==T else print('No')
if __name__=='__main__':main()
# Judge status: Accepted
N = list(input())
if N[0] == "7" or N[1] == "7" or N[2] == "7":
  print("Yes")
else:
  print("No")
# Judge status: Accepted
s=list(input())
k=int(input())
n=len(s)

for i in range(n-1):
    t=s[i]
    order=ord(t)-97
    if order==0:
        continue
    elif k>=26-order:
        s[i]='a'
        k-=26-order
    else:
        continue
s[n-1]=chr(97+(ord(s[n-1])-97+k)%26)

print(''.join(s))
# Judge status: Wrong Answer
# -*- coding: utf-8 -*-
x = int(input())

if 100 <= x and 0 <= x % 10 <= 5:
    print(1)
else:
    print(0)
# Judge status: Accepted
a=list(map(int,input().split()))
b=[]
b.append(a[2])
b.append(a[0])
b.append(a[1])
for i in range(len(b)):
    print(str(b[i])+' ',end='')
print()
# Judge status: Accepted
#!/usr/bin/env python3
n=int(input())
s=input()
ans = 0
for i in range(1,n):
    a = {j for j in s[:i]}
    b = {j for j in s[i:]}
    ans = max(ans, len(a & b))
print(ans)
# Judge status: Wrong Answer
line = input()
X, Y = [int(n) for n in line.split()]

value = "TLE"
route_cost = []
for i in range(X):
    line = input()
    cost, time = [int(n) for n in line.split()]
    route_cost.append([cost, time, i])

route_cost.sort(key=lambda x: x[0])
for cost, time, i in route_cost:
    if time > Y:
        continue
    else:
        value = i
    print(value)
# Judge status: Accepted
n = int(input())
a = list(map(int, input().split()))
total = 1

if 0 in a:
  total = 0
else:
  for i in a:
    total *= i
    if total > 10 ** 18:
      total = -1
      break
print(total)
# Judge status: Accepted
import fractions
from functools import reduce

N = int(input())
T = list(int(input()) for _ in range(N))


def lcm_base(x, y):
    return (x * y) // fractions.gcd(x, y)

def lcm(*numbers):
    return reduce(lcm_base, numbers, 1)

def lcm_list(numbers):
    return reduce(lcm_base, numbers, 1)

print(lcm_list(T))
# Judge status: Wrong Answer
N=int(input())
List=list(map(int,input().split()))

res=1
for x in range(0, N):
  if x<N-1 and List[x]>List[x+1]:
    res+=1
print(res)
# Judge status: Wrong Answer
S = input()
print("Yes" if S == "AAA" or S == "BBB" else "No")
# Judge status: Wrong Answer
import sys

def I(): return int(sys.stdin.readline().rstrip())
def LI(): return list(map(int,sys.stdin.readline().rstrip().split()))
def S(): return sys.stdin.readline().rstrip()
def LS(): return list(sys.stdin.readline().rstrip().split())

N = I()
a = LI()
ans = 0
for i, A in enumerate(a):
    if i % 2 == 1:
        if A % 2 == 1:
            ans += 1
print(ans)
# Judge status: Wrong Answer
A, B, C = map(int, input().split())
print(max(C, B // A))
# Judge status: Wrong Answer
S = input()
k = "keyence"
n = len(S)-7

for i in range(len(S)-n+1):
    print(S[:i]+S[i+n:])
    if S[:i]+S[i+n:] == k:
        print("YES")
        break
else:
    print("NO")
# Judge status: Accepted
n = int(input())

cnt = 0
for a in range(1, n):
    cnt += (n - 1) // a
print(cnt)
# Judge status: Accepted
N = int(input())
L = [10**10]*4
for _ in range(N):
  x,y = [int(i) for i in input().split()]
  L[0] = min(L[0],x+y)
  L[1] = min(L[1],x-y+10**9)
  L[2] = min(L[2],-x+y+10**9)
  L[3] = min(L[3],-x-y+2*(10**9))
print(max(2*(10**9)-L[0]-L[3],2*(10**9)-L[1]-L[2]))
# Judge status: Wrong Answer
a,b=input().split()
ab=int(a+b)
print(ab)
a=0
for i in range (4,317):
    if ab%(i*i) == 0:
        print('Yes')
        a=1
        break
if a==0:
    print('No')
# Judge status: Accepted
N = int(input())
A = [int(input()) for i in range(N)]

ans = 0
for i in range(N):
    if A[i] >= 2:
        ans += A[i]//2
        A[i] -= (A[i]//2)*2
    if i != N-1:
        if A[i] == 1 and A[i+1] >= 1:
            A[i] = 0
            A[i+1] -= 1
            ans += 1
print(ans)
# Judge status: Accepted
a,b,t = map(int,input().split())
t += 0.5
b_num = 0
i = 1
while t >= a * i:
    b_num += b
    i += 1
print(b_num)
# Judge status: Accepted
n,m=map(int,input().split())
a=set()
for i in range(m):
  a.add(int(input()))
mod=10**9+7
dp=[0]*(n+1)
dp[0]=1
if 1 in a:
  dp[1]=0
else:
  dp[1]=1
if n==1:
  print(dp[1])
  exit()
if 2 in a:
  dp[2]=0
else:
  dp[2]=dp[1]+1
for i in range(3,n+1):
  if i in a:
    dp[i]=0
  else:
    dp[i]=(dp[i-1]+dp[i-2])%mod
print(dp[n])
# Judge status: Accepted
s=input()[::-1]
n=len(s)
b=[0]
m=0
d=1
for i in range(n):
  m+=int(s[i])*d
  m%=2019
  d*=10
  d%=2019
  b.append(m)
from collections import Counter
c=Counter(b)
ans=0
for i in range(2020):ans+=c[i]*(c[i]-1)//2
print(ans)
# Judge status: Wrong Answer
W,H,x,y = map(int,input().split())
a = min(H*x,H*(W-x))
b = min(W*y,W*(H-y))
if a==b:
    print(a,1)
else:
    print(max(a,b),0)
# Judge status: Accepted
from fractions import gcd
N,X = map(int, input().split())
x = list(map(int, input().split()))
x.sort()
b = [abs(X-x[i]) for i in range(N)]
ans = b[0]
for i in range(N-1):
  ans = gcd(ans,b[i+1])
print(ans)
# Judge status: Accepted
def b_robot_arms():
    from operator import itemgetter
    N = int(input())
    Robots = [[int(i) for i in input().split()] for j in range(N)]

    robot_arms = sorted([[x - l, x + l] for x, l in Robots], key=itemgetter(1))
    current = -float('inf')
    ans = 0
    for left, right in robot_arms:
        if current <= left:
            ans += 1
            current = right
    return ans

print(b_robot_arms())
# Judge status: Accepted
N,M = list(map(int, input().split()))

ans = set(list(map(int, input().split()))[1:])
for _ in range(N-1):
  ans = ans & set(list(map(int, input().split()))[1:])
print(len(ans))
# Judge status: Accepted
c1 = list(map(int, input().split()))
c2 = list(map(int, input().split()))
c3 = list(map(int, input().split()))
b = [0]*3
b[0] = c1[0]
b[1] = c1[1]
b[2] = c1[2]
C = c1+c2+c3

a = [0]*3

a[0] = 0
a[1] = C[3] - b[0]
a[2] = C[6] - b[0]



z = 0
for x in a:
    for y in b:
        if C[z] != x + y:
            print("No")
            exit()
        z += 1

print("Yes")
# Judge status: Wrong Answer
import sys
import heapq

def input():
    return sys.stdin.readline().rstrip()


def main():
    N = int(input())
    C = list(input())

    Wcount=0
    Rcount =0
    rr =C.count("R")
    ww =C.count("W")


    for j in range(ww):
        if C[j]=="W":
            Rcount+=1

    for i in range(rr):
        if C[-1-i]=="R":
            Wcount+=1

    print(max(Rcount,Wcount))






if __name__ == "__main__":
    main()
# Judge status: Wrong Answer
x,y=map(int,input().split())
a=(2*x-y)/3
b=(-x+2*y)/3
if (2*x-y)%3!=0:
    print(0)
    exit()
a=int(a)
b=int(b)
mod=10**9+7
def comb(x,y):
    s=x
    t=1
    for i  in range(1,y):
        s=(s*(x-i))%mod
    for j  in range(1,y+1):
        t=(t*j)%mod
    return (s*pow(t,mod-2,mod))%mod
print(comb(a+b,min(a,b)))
# Judge status: Accepted
S, W = map( int, input().split() )
if W >= S :
    print( 'unsafe' )
else :
    print( 'safe' )
# Judge status: Accepted
N = int(input())
t = [0] * N
for i in range(N):
    t[i] = list(map(int, input().split()))

t = sorted(t, key = lambda x: x[1])

n = 0
d = 0
f = 0
for i in range(N):
    n += t[i][0]
    if n > t[i][1]:
        f = 1
        break

if f == 0:
    print("Yes")
else:
    print("No")
# Judge status: Wrong Answer
x=int(input())
ans = x//11
ans *=2
ans+=1
if x%11>5:
  ans +=1
print(ans)
# Judge status: Accepted
d = int(input())
ans = 'Christmas'
for _ in range(25 - d):
    ans += ' Eve'
print(ans)
# Judge status: Accepted
s = input()
 
if(s[2] == s[3] and s[4] == s[5]):
  print("Yes")
else:
  print("No")
# Judge status: Wrong Answer
x, y = map(int, input().split())
count = abs(abs(x) - abs(y))
if x * y < 0:
    count += 1
elif x > y:
    count += 2
print(count)
# Judge status: Wrong Answer
s = input().split("hi")


if len(set(s)) == 1:
  print("Yes")
else:
  print("No")
# Judge status: Wrong Answer
sx, sy, tx, ty  = map(int, input().split())

ans = ''
ans += 'L'*(tx-sx)+'U'*(ty-sy)
ans += 'R'*(tx-sx)+'D'*(ty-sy)

ans += 'D'+'L'*(tx-sx+1)+'U'*(ty-sy+1)+'R'
ans += 'U'+'R'*(tx-sx+1)+'D'*(ty-sy+1)+'L'

print(ans)
# Judge status: Accepted
N = int(input())
count = 0
for i in range(1, N + 1):
    count += i
print(count)