Harryxun/stf_run huggingface dataset:
#encoding:utf-8

import math
import sympy

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

facters = sympy.factorint(P)

ans = 1
for key in facters.keys():
    if facters[key]/N >= 1:
        ans *= key**(facters[key]//N)

print(ans)


### FIXED CODE ###

#encoding:utf-8

import math

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

def factorint(N):
    table = {}
    while(N > 1):
        for i in range(2,N+1):
            if N%i == 0:
                while N%i == 0:
                    N = N//i
                    if i in table.keys():
                        table[i] += 1
                    else:
                        table[i] = 1
                break
    return table

ans = 1
if N == 1:
    ans = P
elif 1 < N < 40:
    for i in range(2,round(P**(1/N))+1):
        if P % i**N == 0:
            ans = i

else:
    pass

print(int(ans))
# print(type(ans))
N = int(input())
if 9 in N:
  print("Yes")
else:
  print("No")

### FIXED CODE ###

N = input()
print("Yes" if "9" in N else "No")
S = input()

count = 0
result = []

for i in range(len(S)):
  if (S[i] == "A") or (S[i] == "C") or (S[i] == "G") or (S[i] == "T"):
    count += 1
  else:
    result.append(count)
    count = 0

maxi = result[0]
    
for j in range(len(result)):
  if maxi < result[j]:
    maxi = result[j]

print(maxi)


### FIXED CODE ###

S = str(input())

count = 0
result = []

for i in range(len(S)):
  if (S[i] == "A") or (S[i] == "C") or (S[i] == "G") or (S[i] == "T"):
    count += 1
    if i == len(S) - 1:
      result.append(count)
  else:
    result.append(count)
    count = 0
    if i == len(S) - 1:
      result.append(count)

maxi = result[0]
    
for j in range(len(result)):
  if maxi < result[j]:
    maxi = result[j]

print(maxi)
d = [0]*10**5

a = set()
w = 0

for t in open(0):
    p, s = t.split
    p = int(p)
    if "AC" == s and p not in a:
        w += d[p]
        a.add(p)
    if "WA" == s:
        d[p] += 1

print(len(a), w)

### FIXED CODE ###

d = [0]*10**5

a = set()
w = 0

for t in open(0):
    p, s = t.split()
    p = int(p)
    if "AC" == s and p not in a:
        w += d[p]
        a.add(p)
    if "WA" == s:
        d[p] += 1

print(len(a), w)
N, M = map(int, input().split())
keys = []
 
for _ in range(M):
    cost, _ = map(int, input().split())
    mask = 0
    for i in map(int, input().split()):
        mask |= (1 << (i - 1))
    keys.append((cost, mask))

import collcetions
allstate = (1 << N) - 1
dp = collections.defaultdict(lambda:float('inf'))
dp[0] = 0
 
for cost, key_set in keys:
    ndp = dp.copy()
    for state, val in dp.items():
        ndp[state|key_set] = min(ndp[state|key_set], val + cost)
    dp = ndp
if allstate in dp:
    print(dp[allstate])
else:
    print(-1)

### FIXED CODE ###

N, M = map(int, input().split())
keys = []

for _ in range(M):
    cost, _ = map(int, input().split())
    mask = 0
    for i in map(int, input().split()):
        mask |= (1 << (i - 1))
    keys.append((cost, mask))


allstate = (1 << N) - 1
dp = [float('inf')] * (1<<N)
dp[0] = 0

for cost, key_set in keys:
    for state in range(1<<N):
        if dp[state] == float('inf'): continue
        nstate = state | key_set
        dp[nstate] = min(dp[nstate], dp[state] + cost)

print(dp[-1] if dp[-1] != float('inf') else -1)
#python3
from numpy import lcm
def main():
    a, b, c, d = map(int, input().split())
    p = b - ((b//c + b//d) - b//lcm(c, d))
    q = (a-1) - (((a-1)//c + (a-1)//d) - (a-1)//lcm(c, d))
    print(p-q)
main() 

### FIXED CODE ###

#python3
from fractions import gcd

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


def main():
    a, b, c, d = map(int, input().split())
    p = b - ((b//c + b//d) - b//lcm(c, d))
    q = (a-1) - (((a-1)//c + (a-1)//d) - (a-1)//lcm(c, d))
    print(p-q)
main()
input()
A = list(map(int, input().split))
count = 0

while all(a % 2 == 0 for a in A):
    A = [a/2 for a in A]
    count += 1
print(count)

### FIXED CODE ###

input()
A = list(map(int, input().split()))
count = 0
while all(a % 2 == 0 for a in A):
    A = [a/2 for a in A]
    count += 1
print(count)
i=lambda:map(int,input().split());i();t,a=i();c=[abs(t-0.006*b-a)for b in i()];print(c.index(min(c))+1)

### FIXED CODE ###

x, y = map(int, input().split(" "))

print(x + y//2)
W, H, x, y = map(float, input().split())

print(H*W/2)

if x = W/2 and y = H/2:
    print(1)
else:
    print(0)


### FIXED CODE ###

W, H, x, y = map(float, input().split())

print(H*W/2)

if x == W/2 and y == H/2:
    print(1)
else:
    print(0)
from operator import mul
from functools import reduce


def cmb(n, r):
    r = min(n - r, r)
    if r == 0:
        return 1
    over = reduce(mul, range(n, n - r, -1))
    under = reduce(mul, range(1, r + 1))
    return over // under


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

for i in range(1, K + 1):
    print((cmb(N - K + 1, i) * cmb(K - 1, i - 1)) % (10**9 + 7))


### FIXED CODE ###

from operator import mul
from functools import reduce


def cmb(n, r):
    r = min(n - r, r)
    if r == 0:
        return 1
    over = reduce(mul, range(n, n - r, -1))
    under = reduce(mul, range(1, r + 1))
    return over // under


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

for i in range(1, K + 1):
    if N - K + 1 < i:
        print(0)
    else:
        print((cmb(N - K + 1, i) * cmb(K - 1, i - 1)) % (10**9 + 7))
def gcd(*numbers):
    return reduce(math.gcd, numbers)

def gcd_list(numbers):
    return reduce(math.gcd, numbers)

line = int(input())

a = list(range(1,line + 1))
b = list(range(1,line + 1))
c = list(range(1,line + 1))

result = list(itertools.product(a,b,c))

all = 0

for i in result:
    tmp = gcd(i[0], i[1], i[2])
    all += tmp

print(all)

### FIXED CODE ###

from math import gcd

line = int(input())

ans = 0

for a in range(1, line + 1):
    for b in range(1, line + 1):
        c = gcd(a,b)
        for d in range(1, line + 1):
            ans += gcd(d,c)
print(ans)
while True:
    try:
        l = list(map(int, input().split(",")))
    except ValueError:
        break
    sum_l = sum(l[:10])
    M = sum_l*l[10]/(l[10] + l[11])
    for i in range(10):
        if M <= 0:
            print(i)
            break
        M -= l[i]




### FIXED CODE ###

while True:
    try:
        l = list(map(int, input().split(",")))
    except:
        break
    sum_l = sum(l[:10])
    M = sum_l*l[10]/(l[10] + l[11])
    for i in range(10):
        M -= l[i]
        if M <= 0:
            print(i+1)
            break
a,b = map(int,input().split())
if b<10:
    x=10*a+b
elif b<100:
    x=100*a+b
else:
    x=1000*a+b
for i in range(1000):
    if x==i*i:
        print("Yes")
        return 0
print("No")
return 0

### FIXED CODE ###

a,b = map(int,input().split())
if b<10:
    x=10*a+b
elif b<100:
    x=100*a+b
else:
    x=1000*a+b
c=0
for i in range(1000):
    if x==i*i:
        print("Yes")
        c=1
if c==0:      
    print("No")
import sys
from collections import defaultdict
finput=lambda:sys.stdin.readline().strip()

class Unionfind():
    def __init__(self,n):
        self.parents=[-1]*n
        self.ranks=[0]*n
    
    def find(self,x):
        if self.parents[x]<0:
            return x
        else:
            self.parents[x]=self.find(self.parents[x])
            return self.parents[x]
    
    def union(self,x,y):
        x=self.find(x)
        y=self.find(y)
        if x==y:
            return 
        if self.ranks[x]<self.ranks[y]:
            x,y=y,x
        self.parents[x]+=self.parents[y]
        self.parents[y]=x
        if self.ranks[x]==self.ranks[y]:
            self.ranks[x]+=1
    
    def size(self,x):
        return -self.parents[self.find(x)]
    
    def issametree(self,x,y):
        return self.find(x)==self.find(y)

def main():
    n=int(finput())
    xy=dict((tuple(map(int,finput().split())),i) for i in range(n))
    coor=sorted(list(iter(xy)),key=lambda e:e[0])
    cost = lambda e,f:min(abs(e[0]-f[0]),abs(e[1]-f[1]))
    ew=dict(((xy[coor[i]],xy[coor[i+1]]),cost(coor[i],coor[i+1]))for i in range(n-1))
    coor.sort(key=lambda e:e[1])
    ew.update(dict(((xy[coor[i]],xy[coor[i+1]]),cost(coor[i],coor[i+1]))for i in range(n-1)))
    edges=sorted(list(iter(ew)),key=lambda e:ew[e])
    v=Unionfind(n)
    totcost=0
    # print(ew)
    # print(edges)
    for edge in edges:
        if not v.issametree(edge[0],edge[1]):
            v.union(edge[0],edge[1])
            totcost+=ew[edge]
    print(totcost)
    
if __name__=='__main__':
    main()


### FIXED CODE ###

import sys
from collections import defaultdict
finput=lambda:sys.stdin.readline().strip()

class Unionfind():
    def __init__(self,n):
        self.parents=[-1]*n
        self.ranks=[0]*n
    
    def find(self,x):
        if self.parents[x]<0:
            return x
        else:
            self.parents[x]=self.find(self.parents[x])
            return self.parents[x]
    
    def union(self,x,y):
        x=self.find(x)
        y=self.find(y)
        if x==y:
            return 
        if self.ranks[x]<self.ranks[y]:
            x,y=y,x
        self.parents[x]+=self.parents[y]
        self.parents[y]=x
        if self.ranks[x]==self.ranks[y]:
            self.ranks[x]+=1
    
    def size(self,x):
        return -self.parents[self.find(x)]
    
    def issametree(self,x,y):
        return self.find(x)==self.find(y)

def main():
    n=int(finput())
    coor=[list(map(int,finput().split()))+[i] for i in range(n)]
    coor.sort(key=lambda e:e[0])
    cost = lambda e,f:min(abs(e[0]-f[0]),abs(e[1]-f[1]))
    ew=dict(((coor[i][2],coor[i+1][2]),cost(coor[i][:2],coor[i+1][:2])) for i in range(n-1))
    coor.sort(key=lambda e:e[1])
    ew.update(dict(((coor[i][2],coor[i+1][2]),cost(coor[i][:2],coor[i+1][:2])) for i in range(n-1)))
    edges=sorted(list(iter(ew)),key=lambda e:ew[e])
    v=Unionfind(n)
    totcost=0
    # print(ew)
    # print(edges)
    for edge in edges:
        if not v.issametree(edge[0],edge[1]):
            v.union(edge[0],edge[1])
            totcost+=ew[edge]
    print(totcost)
    
if __name__=='__main__':
    main()
s = str(input())
loop = ["Sunny","Cloudy","Rainy"]
i = loop.index(s)
print(loop((i+1)%3))

### FIXED CODE ###

s = str(input())
loop = ["Sunny","Cloudy","Rainy"]
i = loop.index(s)
print(loop[(i+1)%3])
import numpy as np
from bisect import bisect

n=int(input())
dic={ 'R':[], 'G':[], 'B':[] }

stri=list(input())
count=0
for i,v in enumerate(stri):
  #print(i,v)
  dic[v].append(i)
  
for name in dic:
  dic[name]=np.asarray(dic[name])
#print(dic)
for i in range(n):
  lib=['R','G','B']
  lib.remove(stri[i])
  #print(lib)
  for col in lib:
    for j in dic[col][dic[col]>i]:
      t=[i for i in lib if i != col].pop()
      skip_k=2*i-j
      idx=bisect(dic[t],skip_k)-1
      if dic[t][idx]==skip_k:
        count+=len(dic[t][dic[t]>j])-1
      else:
        count+=len(dic[t][dic[t]>j])
      
print(count)

### FIXED CODE ###

from collections import Counter
n=int(input())
stri=list(input())
cc=Counter(stri)

count=cc['R']*cc['G']*cc['B']


for i in range(n-2):
  for j in range(i+1,n-1):
    if stri[j]==stri[i]:continue
      
    lib=['R','G','B']
    lib.remove(stri[i])
    lib.remove(stri[j])
    t=lib.pop()
    
    skip_k=2*j-i
    #print(i,j,skip_k)
    if skip_k>n-1:continue
    if stri[skip_k]==t:
      count-=1
print(count)
H,W=map(int,input().split())
l=[""]*W
ll=[["" for i in range(W)] for j in range(H)] 
for i in range(H):
  l[i]=[i for i in input()] 
for h in range(H):
  for w in range(W):
    if l[h][w]=="#":
      ll[h][w]="#"
    else:  
      cnt=0
      for hh in [-1,0,1]:
        for ww in [-1,0,1]:
          if 0<=h+hh<H and 0<=w+ww<W:
            if l[h+hh][w+ww]=="#":
              cnt+=1
      ll[h][w]=str(cnt)   
for i in range(H):
  print("".join(ll[i]))

### FIXED CODE ###

h,w=map(int,input().split())
s=[]
for i in range(h):
  s.append([i for i in input()])
l=[["" for i in range(w)] for j in range(h)]
for hh in range(h):
  for ww in range(w):
    if s[hh][ww]=="#":
      l[hh][ww]="#"
    else:  
      cnt=0
      for hhh in [-1,0,1]:
        for www in [-1,0,1]:
          if 0<=hh+hhh<h and 0<=ww+www<w and s[hh+hhh][ww+www]=="#":
            cnt+=1
      l[hh][ww]=cnt
for i in l:
  for j in i:
    print(j,end="")
  print()
money1 = int(input())
money2 = money % 1000
print(money2)

### FIXED CODE ###

money1 = int(input())
if money1 % 1000 != 0:
    money2 = 1000 - (money1 % 1000)
    print(str(money2))
else:
    money2 = 0
    print(str(money2))
import sys
read=sys.stdin.read

def main():
  n,h,*ab=map(int,read().split())
  sord=max(ab[0::2])
  tlst=[b for b in ab[1::2] if b>sord]
  tlst.sort()
  for i,t in enumerate(tlst):
    h-=t
    if h<=0:
      h=0
      break
  print(h//sord+(h%sord>0)+i+1)

if __name__=='__main__':
  main()

### FIXED CODE ###

import sys
read=sys.stdin.read

def main():
  n,h,*ab=map(int,read().split())
  tops=max(ab[0::2])
  tlst=[b for b in ab[1::2] if b>tops]
  tlst.sort(reverse=True)
  i=-1
  t=0
  for i,t in enumerate(tlst):
    h-=t
    if h<=0:
      h=0
      break
  print(h//tops+(h%tops>0)+i+1)

if __name__=='__main__':
  main()
from math import *
N = int(input())


for i in range(1, N+1):
    if(floor(i*1.08) == N):
        print(i)
	exit()

print(':(')


### FIXED CODE ###

from math import *
N = int(input())

ans = 0
for i in range(1, N+1):
    if(floor(i*1.08) == N):
        ans = i

if ans == 0:
    print(":(")
else:
    print(ans)
# C - Otoshidama(https://atcoder.jp/contests/abc085/tasks/abc085_c)
import sys

n, y = map(int, input().split())
for i in range(n):
    if n < i:
        break
    for j in range(n):
        if n - i - j < 0:
            break
        if 100_00 * i + 5000 * j + 1000 * (n - i - j) == y:
            print(i, j, n - i - j)
            sys.exit()
print(-1, -1, -1)

### FIXED CODE ###

# C - Otoshidama(https://atcoder.jp/contests/abc085/tasks/abc085_c)
n, y = map(int, input().split())
end = 0
for i in range(n + 1):
    if n < i:
        break
    for j in range(n + 1):
        if n - i - j < 0:
            break
        if 10000 * i + 5000 * j + 1000 * (n - i - j) == y:
            print(i, j, n - i - j)
            end += 1
    if end:
        break
if end == 0:
    print(-1, -1, -1)
h,w = map(int,input().split())
aa = [list(map(int,input().split())) for _ in range(h)]

for hi in range(h):
  for wi in range(w-1):
    if aa[hi][wi] % 2 == 1:
      aa[hi][wi] -= 1
      aa[hi][wi+1] += 1
      print('{} {} {} {}'.format(hi+1,wi+1,hi+1,wi+2))
  if hi < h-1:
    if aa[hi][wi+1] % 2 ==1:
      aa[hi][wi+1] -=1
      aa[hi+1][wi+1] +=1
      print('{} {} {} {}'.format(hi+1,wi+1,hi+2,wi+1))   

### FIXED CODE ###

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

for hi in range(h):
  for wi in range(w-1):
    if aa[hi][wi] % 2 == 1:      
      aa[hi][wi] -= 1
      aa[hi][wi+1] += 1
      ans.append([hi+1,wi+1,hi+1,wi+2])
      
  if hi < h-1:
    if aa[hi][-1] % 2 ==1:      
      aa[hi][-1] -= 1
      aa[hi+1][-1] += 1
      ans.append([hi+1,w, hi+2, w])

print(len(ans))
for yp,xp,yn,xn in ans:
  print('{} {} {} {}'.format(yp,xp,yn,xn))
def f(a,b):
  digit_a = digit_b=0
  
  while a:
    digit_a+=1
    a//=10
    
  while b:
    digit_b+=1
    b//=10
    
  return max(digit_a, digit_b)

n = int(input())

ans = n
for i in range(1, int((n+1)**0.5)):
  for n%i==0:
    n = min(n, f(i, n//i))
    
print(ans)
    

### FIXED CODE ###

def f(a, b):
    digit_a = digit_b = 0

    while a:
        digit_a += 1
        a //= 10

    while b:
        digit_b += 1
        b //= 10

    return max(digit_a, digit_b)


n = int(input())

ans = n

for i in range(1, int(n ** 0.5) + 1):
    if n % i == 0:
        ans = min(ans, f(i, n // i))

print(ans)
n,r = map(int,input().split())
cnt = 0
while n >= 1:
    n /= k
    cnt += 1
print(cnt)

### FIXED CODE ###

n,k = map(int,input().split())
cnt = 0
while n >= 1:
    n /= k
    cnt += 1
print(cnt)
import sys
sys.setrecursionlimit(10**11)

N, WW = map(int, input().split())
l = [list(map(int, input().split())) for _ in range(N)]
W, V = zip(*l)
M = [[-1] * (WW + 1) for i in range(N + 1)]
def cal(i, w):
  if M[i][w] >= 0:
    return M[i][w]
  if i == N:
    v = 0
  elif w < W[i]:
    v = cal(i + 1, w)
  else:
    v = max(cal(i + 1, w), cal(i + 1, w - W[i]) + V[i])
  M[i][w] = v
  return v

print(cal(0, WW))

### FIXED CODE ###

import sys
sys.setrecursionlimit(10**9)

N, WW = map(int, input().split())
l = [list(map(int, input().split())) for _ in range(N)]
W, V = zip(*l)
M = [{} for i in range(N + 1)]
def cal(i, w):
  if w in M[i]:
    return M[i][w]
  if i == N:
    v = 0
  elif w < W[i]:
    v = cal(i + 1, w)
  else:
    v = max(cal(i + 1, w), cal(i + 1, w - W[i]) + V[i])
  M[i][w] = v
  return v

print(cal(0, WW))
A, B = map(int, input().split())

MON = 6
ANS =6-A-B
print(ANS)

### FIXED CODE ###

A = int(input())
B = int(input())

MON = 6
ANS = 6-A-B
print(ANS)
s = list(input())
ctn = 0
for i in s:
    if i in ['A', 'G', 'C', 'T']:
        ctn += 1
        m = max(m, ctn)
    else:
        ctn = 0
print(ctn)

### FIXED CODE ###

s = list(input())
ctn = 0
m = 0
for i in s:
    if i in ['A', 'C', 'G', 'T']:
        ctn += 1
        m = max(m, ctn)
    else:
        ctn = 0
print(m)
s = list(input())
K = int(input())
alphabet = "abcdefghijklmnopqrstuvwxyz"

need = 0
for i in range(len(s)):
    need += ord("z") - ord(s[i]) + 1

for i in range(len(s)):
    if K >= 26 or s[i] >= alphabet[-K]:
        K -= ord("z") - ord(s[i]) + 1
        s[i] = "a"

if K > 0:
    K %= 26
    s[-1] = chr(ord(s[-1]) + K)

print("".join(s))

### FIXED CODE ###

s = list(input())
k = int(input())

for i in range(len(s)):
    if s[i] == "a": continue

    diff = ord("z") - ord(s[i]) + 1

    if diff <= k:
        k -= diff
        s[i] = "a"

if k > 0:
    k %= 26
    s[i] = chr(ord(s[i]) + k)

print("".join(s))
x = []
for _ in range(5):
    x.append(int(input()))
t = 0
wt = []
for a in x:
    t += a
    m = a % 10
    if m > 0:
      wt.append(10-m)
wt.sort()
wt.pop()
for x in wt:
    t += x
print(t)

### FIXED CODE ###

x = []
for _ in range(5):
    x.append(int(input()))
t = 0
wt = []
for a in x:
    t += a
    m = a % 10
    if m > 0:
      wt.append(10-m)
if len(wt) > 1:
    wt.sort()
    wt.pop()
    for x in wt:
        t += x
print(t)
N, K = map(int, input().split())


if N < K:
    print(N)
else:
    N = abs(N - (N // K + 1) * K)
    if abs(N-K) <= N:
        print(abs(N-K))
    else:
        print(N)

### FIXED CODE ###

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

A, B = B, A
A, C = C, A

print(A,B,C)
n=int(input())
ds=[int(i) for i in input().split()]
ans=0
counts={}

if ds[0]!=0:
  ans=0
  
else:  
    for i in range(1,n):
      if ds[i] not in counts:
        counts[ds[i]]=1
      else:
        counts[ds[i]]+=1
    ans=1
    for i in range(1,len(counts)):
      x=(counts[i]**counts[i+1])%998244353
      ans*=x
      ans%998244353

print(ans%998244353)
  

### FIXED CODE ###

n=int(input())
ds=[int(i) for i in input().split()]
counts={}

if ds[0]!=0:
  ans=0

else:  
    for i in range(1,n):
      if ds[i] not in counts:
        counts[ds[i]]=1
      else:
        counts[ds[i]]+=1
    c=0
    for i in range(1,len(counts)+1):
      if i in counts:
        c+=1
    if c==len(counts):
      ans=1
      for i in range(1,len(counts)):
          x=(counts[i]**counts[i+1])%998244353
          ans*=x
          ans%998244353
    else:
      ans=0

print(ans%998244353)
n,k = map(int, input().split())
p = [float(e) for e in input().split()]

e = [(q+1.0)/2.0 for q in p]

max = 0
for i in range(n-k+1):
  s = e[i]+e[i+1]+e[i+2]
  if max < s:
    max = s
    
print(max)


### FIXED CODE ###

n,k = map(int, input().split())
p = [int(e) for e in input().split()]
s = sum(p[0:k])
max = s
for i in range(n-k):
  s = s - p[i] + p[i+k]
  if max < s:
    max = s
    
ex = (max+k)/2.0
print(ex)
N, M = map(int, input().split())
A = [int(input()) for i in range(M)]

mod = 10**9+7
dp = [0] * N
if 1 not in A:
    dp[0] = 1
    if 2 not in A:
        dp[1] = 2
elif 2 not in A:
    dp[1] = 1
else:
    dp[1] = 0

for i in range(2, N):
    if i+1 not in A:
        dp[i] = (dp[i-2] + dp[i-1]) % mod

print(dp[N-1])

### FIXED CODE ###

N, M = map(int, input().split())
#A = [int(input()) for i in range(M)]
flag = [0]*N
for i in range(M):
    flag[int(input())-1] = 1
#A = [i*3 for i in range(N//3)]
#for i in range(N//3):
    #flag[i] = 1

mod = 10**9+7

dp = [0] * N

if flag[0]==0:
#if 1 not in A:
    dp[0] = 1
    if N>1:
        if flag[1]==0:
    #if (2 not in A) and N > 1:
            dp[1] = 2
elif N > 1:
    if flag[1]==0:
    #if 2 not in A:
        dp[1] = 1
    else:
        dp[1] = 0

loop = []
'''
for i in range(2, N):
    if i not in A:
        loop.append(i)
'''
for i in range(2, N):
    if flag[i]==0:
        dp[i] = (dp[i-2] + dp[i-1]) % mod
        #dp[i] = (sum(dp[i-2:i])) % mod

print(dp[N-1])
#print(dp)
n = input().split()

x = n[0]
y = n[1]

if x < y:
    x, y = y, x
while y > 0:
    r = x % y
    x = y
    y = r

print(x)



### FIXED CODE ###

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

x = n[0]
y = n[1]

if x < y:
    x, y = y, x
while y > 0:
    r = x % y
    x = y
    y = r

print(x)
N, A, B = map(int, input().split())
sum = 0
for num in range(N + 1):
    if A <= sum([int(x) for x in str(num)]) <= B:
        sum += num
print(sum)

### FIXED CODE ###

N, A, B = map(int, input().split())
res = 0
for num in range(N + 1):
    if A <= sum([int(x) for x in str(num)]) <= B:
        res += num
print(res)
u = input()
for i in len(u):
    u[i]="x"
print(u)

### FIXED CODE ###

t=input()
u=list(t)
for i in range(len(u)):
    u[i]="x"
    i+=1
t=''.join(u)
print (t)
def index(n:int, a: int):
    if a % 2 == 0:
        i = n // 2 - a // 2
        j = (i + 1) * -1
        return (i, j) if i != n // 2 else (i,)
    else:
        i = (n // 2 - 1) - (a - 1) // 2
        j = (i + 1) * -1
        return (i, j)
 
n = int(input())
line = [0 for _ in range(n)]
for a in map(int, input().split()):
    for i in index(n, a):
        line[i] += 1
else:
    if n % 2 == 0 and set(line) == {2}:
        print(2 ** (n // 2) % (10 ** 9 + 7))
    elif n % 2 == 1 and set(line) == {1, 2} and line[n//2] == 1:
        print(2 ** ((n - 1) // 2) % (10 ** 9 + 7))
    else:
        print(0)
def index(n:int, a: int):
    if a % 2 == 0:
        i = n // 2 - a // 2
        j = (i + 1) * -1
        return (i, j) if i != n // 2 else (i,)
    else:
        i = (n // 2 - 1) - (a - 1) // 2
        j = (i + 1) * -1
        return (i, j)

n = int(input())
line = [0 for _ in range(n)]
for a in map(int, input().split()):
    for i in index(n, a):
        line[i] += 1
else:
    if n % 2 == 0 and set(line) == {2}:
        print(2 ** (n // 2) % (10 ** 9 + 7))
    elif n % 2 == 1 and set(line) == {1, 2} and line[n//2] == 1:
        print(2 ** ((n - 1) // 2) % (10 ** 9 + 7))
    elif n == 1 and line == [1]:
        print(1)
    else:
        print(0)

### FIXED CODE ###

n = int(input())
a = [int(x) for x in input().split()]
line = [abs(i - (n - i- 1)) for i in range(n)]
if sorted(a) == sorted(line):
    print((2 ** (n // 2)) %  (10 ** 9 + 7))
else:
    print(0)
S = input()

arr = [0 if s == "W" else 1 for s in S]

state = [arr[i] * i for i in range(len(S))]
final_state = [sorted(arr)[i] * i for i in range(len(S))]

print(final_state - state)

### FIXED CODE ###

S = input()
 
arr = [0 if s == "W" else 1 for s in S]
sorted_arr = sorted(arr)
  
state = sum([arr[i] * i for i in range(len(S))])
final_state = sum([sorted_arr[i] * i for i in range(len(S))])
 
print(final_state - state)
N = int(input())
S = list(input())
n_sharp = S.count("#")
n_period = S.count(".")
temp = [[], []]

for i in range(N - 1):
    if S[i] == "#" and S[i + 1] == ".":
        temp[0].append(S[:i + 1].count("#"))
        temp[1].append(S[i + 1:].count("."))
_ = len(temp[0])
ans = min(temp[0])
for i in range(_ -1):
    ans += min(abs(temp[0][i + 1] - temp[0][i]), abs(temp[1][i + 1] - temp[1][i]))
print(ans)

### FIXED CODE ###

N = int(input())
S = list(input())
S.insert(0,0)
# b = S.count("#")
w = S.count(".")
black = 0
white = w
ans = 2e5
for i in range(N+1):
    if S[i] == "#":
        black += 1
    elif S[i] == ".":
        white -= 1
    # print(black,white)
    ans = min(black + white, ans)
print(ans)