Harryxun/stf_run huggingface dataset:
N = int(input())
S = input()
sint = [0]
si = 0
prev = S[0]

for s in S:
    if prev == s:
        sint[si] = sint[si] + 1
    else:
        prev = s
        si = si + 1
        sint.append(1)
if si % 2 == 0:
    if S[0] == '#':
        sint = [0] + sint
    else:
        sint.append(0)
    si = si + 1
elif S[0] == '#':
    sint = [0] + sint + [0]
    si = si + 2
#print(sint)

def count2(_numSB,_numSW):
    if len(sint) == 0:
        return 0
    sint.pop(0)
    sint.pop()
    if len(sint) == 0:
        return 0
    #この状態で偶数番号は黒、奇数番号は白(ゼロスタート)
    # numSB = 0
    # numSW = 0
    # for i,v in enumerate(sint):
        
    #     if i % 2 == 0:
    #         numSB = numSB + v
    #     else:
    #         numSW = numSW + v
    b = sint.pop(0)
    w = sint.pop()
    
    numSB = _numSB 
    numSW = _numSW 
    numSR =  b + w
    #print(numSB,numSW,numSR)
    if numSB <= numSW and numSB <= numSR:
        return numSB
    elif numSW <= numSB and numSW <= numSR:
        return numSW
    else:
        return numSR + count2(numSB-b,numSW-w)
    
    

def count(_S,_numSW,_numSB):
    _S = _S.lstrip('.').rstrip('#')
    if len(_S) == 0 :
        return 0
    numSW = _S.count('.')
    numSB = _S.count('#')
    SR = _S.lstrip('#').rstrip('.')
    numSR = len(_S) - len(SR)
    if numSW <= numSB and numSW <= numSR:
        return numSW
    elif numSB <= numSW and numSB <= numSR:
        return numSB
    else:
        return numSR + count(SR)


numSB = 0
numSW = 0
for i,v in enumerate(sint):
    if i % 2 == 1:
        numSB = numSB + v
    else:
        numSW = numSW + v
#print(sint,numSB,numSW)
print(count2(numSB,numSW))
'''
#####.....####..###...
'''
# #intS = []
# def xor(A,B):
#     #print(A)
#     #print(B)
#     num = 0
#     for i in range(len(A)):
        
#         if A[i]!=B[i] :
#             num = num + 1
#     return num
# # for s in S :
# #     intS.append(0 if s=='.' else 1)
# minC = N

# mask = ['#' for j in range(len(S) + 1)]
# for i in range(len(S) + 1):
#     mask[i] = '.'
#     c = xor(mask[1::],S)
#     if c < minC:
#         minC = c

# print(minC)
# # def dl(_S):


# #     l = '.'
# #     r = '#'
    
# #     _S = _S.lstrip(l).rstrip(r)
# #     print(_S)
# #     if len(_S) == 0:
# #         return 0
# #     _S2W = _S.lstrip(r)
# #     _S2B = _S.rstrip(l)
# #     _S2 =  _S2W if len(_S2W) <= len(_S2B) else _S2B
# #     return len(_S) - len(_S2) + dl(_S2)
# # print(dl(S))






### FIXED CODE ###

_ = input()
S = input()
numc = S.count('.')
numcmin = numc
for s in S:
    if s == '#':
        numc = numc + 1
    else:
        numc = numc -1
        if numc < numcmin:
            numcmin = numc
print(numcmin)
a, b, c = input().split()
if a / c <= b:
  print("Yes")
else:
  print("No")


### FIXED CODE ###

d,t,s=map(int,input().split())
if d<=t*s:
    print("Yes")
else:
    print("No")
N, K = input().split()
N = int(N)
K = int(K)
temp = N
while N>0:
    if temp > K:
        N = N-K
        if N <= 0:
            print(abs(N))
    else:
        print(abs(N))


### FIXED CODE ###

X, Y, Z = input().split()
A = X
B = Y
C = Z
temp = A
A = B
B = temp
temp = A
A = C
C = temp

print(A, B, C);
import collections

n = int(input())
s = [input() for i in range(n)]

c = collections.Counter(s).most_common()
ans = [k for k, v in c if c[0][1] == v]
ans.sort()

for i in ans:
    print(i)

### FIXED CODE ###

a, b, c = input().split()
a = int(a)
b = int(b)
c = int(c)

if a == b and a != c:
    print("Yes")
elif a == c and a != b:
    print("Yes")
elif b == c and b != a:
    print("Yes")
else:
    print("No")
n, m = list(map(int, input().split()))
tmps = [[] for _ in range(n)]
pyxs = []

for i in range(m):
    p, y = list(map(int, input().split()))
    pyxs.append([p, y, i])

pyxs.sort(key = lambda x: x[1])

num = [0] * (n+1)
ans = []*m

for p, y, x in pyxs:
    ans[i] = '{:06}'.format(p) + '{:06}'.format(num[p]+1)
    num[p] += 1

for s in ans:
    print(s)

### FIXED CODE ###

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

for i in range(m):
    p, y = list(map(int, input().split()))
    pyxs.append([p, y, i])

pyxs.sort(key = lambda x: x[1])

num = [0] * (n+1)
ans = [None]*m

for p, y, x in pyxs:
    ans[x] = '{:06}'.format(p) + '{:06}'.format(num[p]+1)
    num[p] += 1

for s in ans:
    print(s)
import numpy as np
n, m = [int(i) for i in input().split()]
a =[]
d = 1000000007

for i in range(m):
    a1=int(input())
    a.append(a1)

a.append(n+1)
a = np.array(a)
#print(a)

if 1 in a[1:]-a[:-1]:
    print(0)

else:
    dp = [0]*(n+1)
    dp[1]=1
    dp[2]=1
    for i in range(3,len(dp)):
        dp[i]=dp[i-1]+dp[i-2]
        dp[i]=dp[i]%d

    ans = []
    pre = 0
    for i in range(len(a)):
        if i == 0:
            ans.append(a[i]-pre)
        else:
            ans.append(a[i]-pre-1)
        pre = a[i]

    #print(ans)

    if m == 0:
        print(dp[n])
    else:
        x = 1
        for i in ans:
            x = x*dp[i]%d
        print(x)

### FIXED CODE ###

import numpy as np
n, m = [int(i) for i in input().split()]
a =[]
d = 1000000007

for i in range(m):
    a1=int(input())
    a.append(a1)

a.append(n+1)
a = np.array(a)
#print(a)

if 1 in a[1:]-a[:-1]:
    print(0)

else:
    dp = [0]*110000
    dp[1]=1
    dp[2]=1
    for i in range(3,len(dp)):
        dp[i]=dp[i-1]+dp[i-2]
        dp[i]=dp[i]%d

    ans = []
    pre = 0
    for i in range(len(a)):
        if i == 0:
            ans.append(a[i]-pre)
        else:
            ans.append(a[i]-pre-1)
        pre = a[i]

    #print(ans)

    if m == 0:
        print(dp[n+1])
    else:
        x = 1
        for i in ans:
            x = x*dp[i]%d
        print(x)
import math

r = int(input())

s = math.pi * (r ** 2)

p = 2 * math.pi * r

print(s,p)


### FIXED CODE ###

from math import pi

r = float(input())

s = pi * (r ** 2)

p = 2 * pi * r

print(s,p)
N = int(input())
ns = input().split()

dic = {}

for i in range(N):
    if(ns[i] in dic.keys() and dic[ns[i]]<=2):
        dic[ns[i]] += 1
    elif(ns[i] not in dic.keys()):
        dic[ns[i]] = 1

a,b,c = 0,0,0
for key in dic.keys():
    if(dic[key] == 1):
        a += 1
    elif(dic[key] == 2):
        b += 1
    elif(dic[key] == 3):
        c += 1

unique = a+b+c
sum_ = 0

sum_ += c
sum_ += (b+c)*(unique-1)

key_list = list(dic.keys())
n = len(key_list)
for p in range(n-2):
    for q in range(n-1):
        if(p<q):
            for r in range(n):
                if(q<r):
                    x,y,z = int(key_list[p]),int(key_list[q]),int(key_list[r])
                    if(x+y>z):
                        sum_ += unique-(r+1-1)
                            break

print(int(sum_))

### FIXED CODE ###

a,b = input().split()
a,b = int(a),int(b)
print(max(a-2*b,0))
N = int(input())
times = map(int, input().split())
M = int(input())
sum_t = sum(times)
for _ in range(M):
  dist, time = map(int, input().split())
  if times[dist-1] >= time:
    print(sum_t-(times[dist-1]-time))
  else:
    print(sum_t+(time-times[dist-1]))

### FIXED CODE ###

N = int(input())
times = list(map(int, input().split()))
M = int(input())
sum_t = sum(times)
for _ in range(M):
  dist, time = map(int, input().split())
  if times[dist-1] >= time:
    print(sum_t-(times[dist-1]-time))
  else:
    print(sum_t+(time-times[dist-1]))
A, B, C = [int(_) for _ in input().split()]
if(A+B<C-1){
  print(B+C)
else{
  print(A+2*B+1)

### FIXED CODE ###

i=input()
i_s=i.split(" ")
a=int(i_s[0])
b=int(i_s[1])
c=int(i_s[2])
if(a+b>c-1):
  print(c+b)
else:
  print(b+(a+b+1))
# D - Sum of Divisors
from numba import njit


@njit
def solve(N):
    res = 0
    for a in range(1, N + 1):
        for b in range(1, N // a + 1):
            res += a * b
    return res


def main():
    N = int(input())
    print(solve(N))


if __name__ == "__main__":
    main()


### FIXED CODE ###

# C - Tsundoku
from bisect import bisect
from itertools import accumulate


def main():
    N, M, K, *AB = map(int, open(0).read().split())
    cum_A, cum_B = tuple(accumulate(AB[:N])), tuple(accumulate(AB[N:]))
    candidates = []
    for cum_x, cum_y in ((cum_A, cum_B), (cum_B, cum_A)):
        for i, x_time in enumerate(cum_x, 1):
            if x_time > K:
                candidates.append(0)
                break
            y_time = K - x_time
            candidates.append(i + bisect(cum_y, y_time))
    print(max(candidates))


if __name__ == "__main__":
    main()
import sys
MOD=(10**9) + 7
x,y=map(int,input().split())

if((x+y)%3!=0):
    print(0)
    sys.exit()

n=((x+y)//3) + 1
k=y-(n-2)

m=max(n,k)
fac=[0 for _ in range(m)]   #n!
finv=[0 for _ in range(m)]  #1/n!
inv=[0 for _ in range(m)]   #

fac[0]=1
fac[1]=1
finv[0]=1
finv[1]=1
inv[1]=1

for i in range(2,m):
    fac[i]=fac[i-1]*i%MOD
    inv[i]=MOD - inv[MOD%i] * (MOD//i)%MOD
    finv[i]=finv[i-1]*inv[i]%MOD

print( fac[n-1] * (finv[k-1] * finv[n - k] % MOD) % MOD )

### FIXED CODE ###

import sys
MOD=(10**9) + 7
x,y=map(int,input().split())

if((x+y)%3!=0):
    print(0)
    sys.exit()

n=((x+y)//3) + 1
k=y-(n-2)

fac=[0 for _ in range(n)]   #n!
finv=[0 for _ in range(n)]  #1/n!
inv=[0 for _ in range(n)]   #

fac[0]=1
fac[1]=1
finv[0]=1
finv[1]=1
inv[1]=1

for i in range(2,n):
    fac[i]=fac[i-1]*i%MOD
    inv[i]=MOD - inv[MOD%i] * (MOD//i)%MOD
    finv[i]=finv[i-1]*inv[i]%MOD

def ncr(n,k):
    if(n < k):
        return 0
    elif(n < 0 or k < 0):
        return 0
    else:
        return fac[n] * (finv[k] * finv[n - k] % MOD) % MOD


print(ncr(n-1,k-1))
N,M,C=map(int,input().split())
B=list(map(int,input().split()))
cnt=0
for i in range(N):
    tmp=0
    A=list(map(int,input().split())
    for j in range(M):
        tmp+=A[j]*B[j]
    tmp+=C
    if tmp>0:
        cnt+=1
    else:
        cnt+=0
print(cnt)

### FIXED CODE ###

N,M,C=map(int,input().split())
B=list(map(int,input().split()))
cnt=0
for i in range(N):
    tmp=0
    A=list(map(int,input().split()))
    for j in range(M):
        tmp+=A[j]*B[j]
    tmp+=C
    if tmp>0:
        cnt+=1
    else:
        cnt+=0
print(cnt)
from collections import defaultdict
from itertools import permutations
def solve():
    n = int(input())
    XY = [list(map(int, input().split())) for _ in range(n)]
    m = defaultdict(int)
    for i, j in permutations(range(n), 2):
        m[(XY[i][0] - XY[j][0], XY[i][1] - XY[j][1])] += 1
    print(n - max(m.items(), key=lambda x: x[1])[1])
solve()


### FIXED CODE ###

from collections import defaultdict
from itertools import permutations
def solve():
    n = int(input())
    XY = [list(map(int, input().split())) for _ in range(n)]
    if n == 1:
        return 1
    m = defaultdict(int)
    for i, j in permutations(range(n), 2):
        m[(XY[i][0] - XY[j][0], XY[i][1] - XY[j][1])] += 1
    return n - max(m.items(), key=lambda x: x[1])[1]
print(solve())
n = int(input())
ans = 1 
a = list(map(int,input().split()))
for i in a:
  ans *= a[i]
if ans > 10**18:
  print("-1")
else:
  print(ans)

### FIXED CODE ###

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

ans = 1

if 0 in a:
    ans = 0
else:
    for i in a:
        ans *= i
        if(ans > 10**18):
            ans = -1
            break
print(ans)
import numpy as np


def func(x):
    if x == '.':
        return 2000
    else:
        return 0


H, W = map(int, input().split())
b = []
for _ in range(W):
    b.append(list(map(func, input())))
a = np.array(b)

for i in range(H - 1):
    a[1+i:, :] = np.minimum(a[1+i:, :], a[i:-1, :] + 1)
for i in range(H - 1):
    a[:-1-i, :] = np.minimum(a[:-1-i, :], a[1:H-i, :] + 1)
for j in range(W - 1):
    a[:, 1+j:] = np.minimum(a[:, 1+j:], a[:, j:-1] + 1)
for j in range(W - 1):
    a[:, :-1-j] = np.minimum(a[:, :-1-j], a[:, 1:W-j] + 1)

print(np.max(a))

### FIXED CODE ###

from collections import deque

H, W = map(int, input().split())
a = [[0] * W for _ in range(H)]
q = deque([])
for i in range(H):
    s = input()
    for j in range(W):
        if s[j] == '#':
            a[i][j] = 1
            q.appendleft((i, j, 0))

while True:
    try:
        i, j, val = q.pop()
        if i > 0 and a[i - 1][j] == 0:
            q.appendleft((i - 1, j, val + 1))
            a[i - 1][j] = 1
        if i < H - 1 and a[i + 1][j] == 0:
            q.appendleft((i + 1, j, val + 1))
            a[i + 1][j] = 1
        if j > 0 and a[i][j - 1] == 0:
            q.appendleft((i, j - 1, val + 1))
            a[i][j - 1] = 1
        if j < W - 1 and a[i][j + 1] == 0:
            q.appendleft((i, j + 1, val + 1))
            a[i][j + 1] = 1
    except:
        print(val)
        break
while(True)
  h,w=map(int,input().split())
  if h==0 and w==0:
    break
  rect=''
  for i in range(h):
    for j in range(w):
      if (i+j)%2  == 0:
        rect+='#'
      else:
        rect+='.'
    rect+='\n'
  print(rect)

### FIXED CODE ###

while(True):
  h,w=map(int,input().split())
  if h==0 and w==0:
    break
  rect=''
  for i in range(h):
    for j in range(w):
      if (i+j)%2  == 0:
        rect+='#'
      else:
        rect+='.'
    rect+='\n'
  print(rect)
n, m = [int(i) for i in input().split()]
ac = [0] * n
wa = [0] * n

for i in range(m):
    p, s = input().split()
    p = int(p)
    if ac[p-1] == 0:
        if s == "AC":
            ac[p-1] = 1
        elif s == "WA":
            wa[p-1] += 1

wa_sum = 0
for i in range(n):
    if ac[i] >= 1: wa_sum += wa[i]

print(sum(ac), sum_wa)

### FIXED CODE ###

n, m = [int(i) for i in input().split()]
ac = [0] * n
wa = [0] * n

for i in range(m):
    p, s = input().split()
    p = int(p)
    if ac[p-1] == 0:
        if s == "AC":
            ac[p-1] = 1
        elif s == "WA":
            wa[p-1] += 1

wa_sum = 0
for i in range(n):
    if ac[i] >= 1: wa_sum += wa[i]

print(sum(ac), wa_sum)
n,m,c = map(int,input().split())
B = map(int,input().split())
A = []
ans = 0
for i in range(m):
  a = map(int,input().split())
  A.append(a)

sum = c
for i in range(n):
    for j in range(m):
        sum += A[i][j]*B[j]
    if sum > 0:
        ans += 1
        sum = c
print(ans)

### FIXED CODE ###

n, m, c  = map(int, input().split())
b = list(map(int, input().split()))
s = 0
for i in range(n):
    a = list(map(int, input().split()))
    t = 0
    for j in range(m):
        t += a[j]*b[j]
    if t+c > 0:
        s += 1
print(s)
r = int(input())
a = map(int, raw_input().split())

a.reverse()
prnt = ""
for i in range(0, r-2):
    prnt += a[i]
    prnt += " "

prnt += a[r-1]
print prnt

### FIXED CODE ###

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

a.reverse()
print(" ".join(map(str, a)))
def rec(i, bs, ngs):
    if bs[i] is None:
        if ngs[i]:
            bs[i] = 0
        elif i == 0 or i == 1:
            bs[i] = 1
        else:
            bs[i] = (rec(i-1, bs, ngs) + rec(i-2, bs, ngs)) % 1000000007
    return bs[i]


N, M = map(int, input().split())
ngs = [False] * int(1e5+1)
for _ in range(M):
    ngs[int(input())] = True

bs = [None] * int(1e5+1)
ans = rec(N, bs, ngs)
print(ans)


### FIXED CODE ###

N, M = map(int, input().split())
ngs = [False] * (N+1)
for _ in range(M):
    ngs[int(input())] = True

bs = [1] * (N+1)
for i in range(1, N+1):
    if ngs[i]:
        bs[i] = 0
    elif i == 1:
        bs[i] = 1
    else:
        bs[i] = (bs[i-1] + bs[i-2]) % 1000000007

print(bs[N])
N, M = map(int, input().split())
a = set([int(input()) for i in range(M)])
n = [0] * N
n[0] = 1
n[1] = 2

#listの中をinで探すのはくっそ遅い
if N == 1:
    print(1)
    exit()
if 1 in a and 2 in a:
    print(0)
    exit()
if 1 in a:
    n[0] = 0
    n[1] = 1
if 2 in a:
    n[1] = 0

for i in range(2, N):
    if i + 1 in a:
        pass
    else:
        n[i] = (n[i - 1] + n[i - 2]) % 1000000007

print(n[N - 1])

### FIXED CODE ###

N, M = map(int, input().split())
a = set([int(input()) for i in range(M)])
n = [0] * (N + 1)
n[0] = 1
n[1] = 1

#listの中をinで探すのはくっそ遅い
if 1 in a:
    n[1] = 0

for i in range(2, N + 1):
    if i in a:
        continue
    else:
        n[i] = (n[i - 1] + n[i - 2]) % 1000000007

print(n[N])
h, w = 2, 3
c = []

for _ in range(h):
    c.append(input())

if c[0][0] == c[1][2] and c[0][1] == c[1][1] and c[0][2] == c[1][0]:
    print("YES")
else:
    print("NO")



### FIXED CODE ###

R = int(input())
G = int(input())
print(2*G-R)
2
1
2 0
1
1 n = int(input())

xy = [[] * n for _ in range(n)]
for i in range(n):
    a = int(input())
    for j in range(a):
        x, y = map(int, input().split())
        xy[i].append((x, y))

ans = 0
def judge(f):
    for i in range(n):
        if flag[i] == 1:
            for j in xy[i]:
                if f[j[0] - 1] != j[1]:
                    return False
        
    return True

for i in range(2 ** n):
    flag = [0] * n
    for j in range(n):
        if i >> j & 1:
            flag[j] = 1
    if judge(flag):
        ans = max(ans, sum(flag))
print(ans)

### FIXED CODE ###

n = int(input())

xy = [[] * n for _ in range(n)]
for i in range(n):
    a = int(input())
    for j in range(a):
        x, y = map(int, input().split())
        xy[i].append((x, y))

ans = 0
def judge(f):
    for i in range(n):
        if flag[i] == 1:
            for j in xy[i]:
                if f[j[0] - 1] != j[1]:
                    return False
        
    return True

for i in range(2 ** n):
    flag = [0] * n
    for j in range(n):
        if i >> j & 1:
            flag[j] = 1
    if judge(flag):
        ans = max(ans, sum(flag))
print(ans)
N, K, S = map(int,input().split())
A = []

if K == N:
    A.extend([S] * N)
else:
    if S == 1:
        A.extend([1] * K)
        A.extend([2] * (N - K))
    else:
        for i in range((K + 1) // 2):
            A.extend([1, S - 1])
        if N % 2 == 0:
            A.append(1)
        x = S + 1 if S != 10 ** 9 else S - 2
        A.extend([x] * (N - K - 1))

print(A[0], end = "")
for i in range(1,N):
    print(" " + str(A[i]), end = "")

### FIXED CODE ###

N, K, S = map(int,input().split())
A = [S] * K
if N > K:
    if S < 10 ** 9:
        A.extend([S + 1] * (N - K))
    else:
        A.extend([S - 1] * (N - K))

print(A[0], end = "")
for i in range(1,N):
    print(" ", end = "")
    print(A[i], end = "")
s = input()
a, b = s.split(' ')
print(int(a) * int(b), 2 * (int(a) + int(b)))

### FIXED CODE ###

s = raw_input()
a, b = s.split(' ')
print int(a) * int(b), 2 * (int(a) + int(b))
import math

def yes():
    print("Yes")
def no():
    print("No")

a,b,c,d,e,k = map(int,input().split())
if a-b > k or b-c > k or c-d > k or d-e > k:
    no()
else:
    yes()


### FIXED CODE ###

l = []
for i in range(6):
   l.append(int(input()))

if l[4]-l[0]>l[5]:
    print(":(")
else:
    print("Yay!")
import math
def main(A,B,C,D):
    allAB = B - A + 1
    divC = B // C - (A-1) // C
    divD = B // D - (A-1) // D
    lcmCD = lcm(C,D)
    divCD = B // (lcmCD) - (A-1) // (lcmCD)
    count = allAB - divC - divD + divCD
    return count

def lcm(x, y):
    return (x*y) // math.gcd(x,y)
    
    
A,B,C,D = map(int, input().split())
print(main(A,B,C,D))

### FIXED CODE ###

import fractions
def main(A,B,C,D):
    allAB = B - A + 1
    divC = B // C - (A-1) // C
    divD = B // D - (A-1) // D
    lcmCD = lcm(C,D)
    divCD = B // (lcmCD) - (A-1) // (lcmCD)
    count = allAB - divC - divD + divCD
    return count

def lcm(x, y):
    return (x*y) // fractions.gcd(x,y)
    
A,B,C,D = map(int, input().split())
print(main(A,B,C,D))
a,op,b = input().split()
if op == "+":
  print(a+b)
else:
  print(a-b)

### FIXED CODE ###

a,op,b = input().split()
if op == "+":
  print(int(a)+int(b))
else:
  print(int(a)-int(b))
from collections import Counter
N=int(input())
X=input()
value = int(X,2)
#print(value)
TFlist =[]
for i in range(N):
  if X[i] == '0':
  	TFlist.append(False)
  else:
    TFlist.append(True)
#print(TFlist)
p = sum(TFlist)


def count_ones_by_bin(num):
    bin_num = bin(num)[2:]
    count = 0
    for i in bin_num:
            count += int(i)
    return count
  
def popcount(n):
 # print("popcount",n)
  return (n  % count_ones_by_bin(n))

for i in range(N):
#  print("N", N)
  cnt = 0
  if TFlist[i]: tmp = (value % (p-1) - (pow(2,(N-i-1), (p-1)))) % (p-1)
  else: tmp = (value % (p+1) + ( pow(2,(N-i-1), (p+1) ) ) ) % (p+1)
 # print(tmp)
  cnt += 1
  while tmp != 0:
    cnt+= 1
    tmp = popcount(tmp)
  print(cnt)

### FIXED CODE ###

from collections import Counter
N=int(input())
X=input()

value = int(X,2)
#print(value)
TFlist =[]
for i in range(N):
  if X[i] == '0':
  	TFlist.append(False)
  else:
    TFlist.append(True)
#print(TFlist)
p = sum(TFlist)


def count_ones_by_bin(num):
    bin_num = bin(num)[2:]
    count = 0
    for i in bin_num:
            count += int(i)
    return count
  
def popcount(n):
 # print("popcount",n)
  return (n  % count_ones_by_bin(n))

for i in range(N):
#  print("N", N)
  cnt = 0
  tmp = 0
  if p != 1 or (not TFlist[i]):
    if TFlist[i]: tmp = (value % (p-1) - (pow(2,(N-i-1), (p-1)))) % (p-1)
    else: tmp = (value % (p+1) + (pow(2,(N-i-1) , (p+1) ) ) ) % (p+1)    
    cnt += 1
  while tmp != 0:
    cnt+= 1
    tmp = popcount(tmp)
  print(cnt)
a=input().split(" ")
b=int(a[0])
c=int(a[1])
if a>8 or b>8:
  print(":(")
else:
  print("Yay!")

### FIXED CODE ###

a=input().split(" ")
b=int(a[0])
c=int(a[1])
if c>8 or b>8:
  print(":(")
else:
  print("Yay!")
A, B, C, D = map(int, input().split())


def start(num: int) -> int:
    if A % num == 0:
        num_start = A + (A % num)
    else:
        num_start = A + (num - A % num)
    return num_start


def count_in_range(num_start: int, num: int) -> int:
    r = B - num_start
    return r // num + 1


def calc(num: int) -> int:
    return count_in_range(start(num), num)


def lcm(x, y):
    import math
    return (x * y) // math.gcd(x, y)


c = calc
print((B - A + 1) - (calc(C) + calc(D) - calc(lcm(C, D))))


### FIXED CODE ###

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


def start(num: int) -> int:
    if A % num == 0:
        num_start = A + (A % num)
    else:
        num_start = A + (num - A % num)
    return num_start


def count_in_range(num_start: int, num: int) -> int:
    r = B - num_start
    return r // num + 1


def calc(num: int) -> int:
    return count_in_range(start(num), num)


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


c = calc
print((B - A + 1) - (calc(C) + calc(D) - calc(lcm(C, D))))
import collections

n = int(input())
a = list(map(int,input().split()))
a1 = collections.Counter(a[0::2]).most_common()
a2 = collections.Counter(a[1::2]).most_common()
#a1.append((0,0))
#a2.append((0,0))
#print(a1)
#print(a2)

if a1[0] != a2[0]:
    print(n-a1[0][1]-a2[0][1])
else:
    print(min(n-a1[0][1]-a2[1][1],n-a1[1][1]-a2[0][1]))



### FIXED CODE ###

import collections

n = int(input())
a = list(map(int,input().split()))
a1 = collections.Counter(a[0::2]).most_common()
a2 = collections.Counter(a[1::2]).most_common()
a1.append((0,0))
a2.append((0,0))
#print(a1)
#print(a2)

if a1[0] != a2[0]:
    print(n-a1[0][1]-a2[0][1])
else:
    print(min(n-a1[0][1]-a2[1][1],n-a1[1][1]-a2[0][1]))
c = []
for _ in [0]*3:
  c += [list(map(int, input().split()))]

flag = True
for i in [0,1]:
  for j in [0,1]:
    if c[i][j] + c[i+1][j+1] != c[i+1][j] + c[i][j+1]:
      flag = False
print("Yes" if Flag else "No")

### FIXED CODE ###

c = []
for _ in [0]*3:
  c += [list(map(int, input().split()))]

flag = True
for i in [0,1]:
  for j in [0,1]:
    if c[i][j] + c[i+1][j+1] != c[i+1][j] + c[i][j+1]:
      flag = False
print("Yes" if flag else "No")
def gcd(x, y):
    if x < y:
        x, y = y, x
    if y == 1:
        return 1
    while x % y != 0:
        r = x % y
        x = y
        y = r
    return y

N = int(input())
a_list = list(map(int, input().split()))
MOD = 10 ** 9 + 7

div = gcd(a_list[0], a_list[1])
lcm = (a_list[0] * a_list[1]) // div

for i in range(2, N):
    div = gcd(lcm, a_list[i])
    lcm = (lcm * a_list[i]) // div
    
ans = 0
for i in range(N):
    ans = (ans + lcm//a_list[i]) % MOD

print(ans)

### FIXED CODE ###

from functools import reduce

def gcd(x, y):
    if x < y:
        x, y = y, x
    while x % y != 0:
        r = x % y
        x = y
        y = r
    return y

def inv(x):
    return pow(x, MOD-2, MOD)

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

def lcm_list(l:list):
    return reduce(lcm, l, 1)
  
N = int(input())
a_list = list(map(int, input().split()))
MOD = 10 ** 9 + 7

num = lcm_list(a_list) % MOD
ans = 0
for a in a_list:
    ans += (num * pow(a, MOD-2, MOD)) % MOD

print(ans%MOD)