Harryxun/stf_run huggingface dataset:
n=int(input())
s=input()

i=0
for ss in s:
  if ss=="#":
    break
  i+=1

s=s[i:]  
  
cnt=0
while s[-1]=="#":
  s=s[:-1]
  
print(min(s.count("."),s.count("#")))

  

### FIXED CODE ###

n=int(input())
s=input()
s=s

ll=0 #左側の黒い数を保持
rr=s.count(".") #右側の白い数を保持

result=ll+rr
for item in s:
    if item=="#":
        ll+=1
    else:
        rr-=1
    
    result=min(result,ll+rr)

print(result)
n = int(input())
march = {'m': 0, 'a': 0, 'r': 0, 'c': 0, 'h': 0}
for i in range(n):
  s = input()[0]
  try:
    march[s] += 1
  except:
    pass
ans = 0

for key1 in march.keys():
  for key2 in march.keys():
    if key1 != key2:
      for key3 in march.keys():
        if key3 != key1 and key3 != key2:
          ans += key1 * key2 * key3
print(ans)

### FIXED CODE ###

n = int(input())
march = {'m': 0, 'a': 0, 'r': 0, 'c': 0, 'h': 0}
for i in range(n):
  s = input()[0].lower()
  try:
    march[s] += 1
  except:
    pass
ans = 0

for key1 in march.keys():
  for key2 in march.keys():
    if key1 != key2:
      for key3 in march.keys():
        if key3 != key1 and key3 != key2:
          ans += march[key1] * march[key2] * march[key3]
print(ans//6)
import functools
import operator

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

i = 2
res = []
if N == 1:
  print(P)
elif P == 1:
  print(1)
else:
  while i <= P**0.5:
    while P % i**N == 0:
      P /= i**N
      res.append(i)
    else:
      if i == 2:
        i += 1
      else:
        i += 2
  result = functools.reduce(operator.mul, res)
  print(result)

### FIXED CODE ###

N,P = map(int,input().split())
i = round(P**(1/N))
res = []
if N == 1:
  print(P)
elif P == 1:
  print(1)
else:
  for i in range(i,0,-1):
    if P%i**N==0:
      print(i)
      break
import math
a,b,x = map(int, input().split())

def xx(y):
  aHeight = a*math.sin(y)
  bHeight = b*math.sin(0.5*math.pi-y)
  if aHeight < bHeight:
    menseki = 0.5*a*b + (bHeight/aHeight*a-b)*math.sin(0.5*math.pi-y)*(a/math.cos(y))
  else:
    aD = bHeight/math.sin(y)
    menseki = 0.5*aD*b
  return menseki

minY = 0
maxY = 0.5*math.pi
while True:
  menseki = xx((minY+maxY)/2)
  if abs(x/a - menseki) < 0.1:
    print((minY+maxY)/2 * (180/math.pi))
    break
  elif menseki < x/a:
    maxY = (minY+maxY)/2
  else:
    minY = (minY+maxY)/2

### FIXED CODE ###

a,b = map(int, input().split())
if a <= 9 and b <= 9:
  print(a*b)
else:
  print(-1)
N, M = map(int,input().split())
A = [int(i) for i in input().split()]
sumA = [0 for i in range(N + 1)]
for i in range(1, N + 1):
    sumA[i] = (A[i] + A[i - 1]) % M
ans = 0

for j in range(N):
    ans += sumA[j:].count(sumA[j]) - 1

print(ans)

### FIXED CODE ###

from collections import defaultdict as dict
d = dict(int)
N, M = map(int,input().split())
A = [int(i) for i in input().split()]
sumA = [0 for i in range(N + 1)]
for i in range(N):
    sumA[i + 1] = (A[i] + sumA[i]) % M
ans = 0

for j in range(len(sumA)):
    ans += d[sumA[j]]
    d[sumA[j]] += 1

print(ans)
X=list(map(int.input().split()))
ans=""
if X[2]-X[0]>0:
    p=X[2]-X[0]
    U="U"
    D="D"
else:
    p=X[0]-X[2]
    U="D"
    D="U"

if X[3]-X[1]>0:
    q=X[3]-X[1]
    R="R"
    L="L"
else:
    q=X[1]-X[3]
    R="L"
    L="R"
    
print(U*p+R*(q+1)+D*(p+1)+L*(q+1)+U+L+U*(p+1)+R*(q+1)+D*(p+1)+L*q  

### FIXED CODE ###

sx, sy, tx, ty = map(int, input().split())

higth = ty - sy
width = tx - sx

ans = ''
ans += 'U' * higth
ans += 'R' * width
ans += 'D' * higth
ans += 'L' * width
ans += 'L' + 'U' * (higth + 1)
ans += 'R' * (width + 1) + 'D'
ans += 'R' + 'D' * (higth + 1)
ans += 'L' * (width + 1) + 'U'
print(ans)
K = '.,!? '
A = 'abc'
D = 'def'
G = 'ghi'
J = 'jkl'
M = 'mno'
P = 'pqrs'
T = 'tuv'
W = 'wxyz'
L = ['', K, A, D, G, J, M, P, T, W]


while 1:
	S = []
	n = input()
	if not '0' in n:
		print('')
	else:
		n = n.split('0')
		for ns in n:
			if ns == '':
				continue
			i = len(ns) % len(L[int(ns[0])])
			S += [[L[int(ns[0])], i-1]]
		for s in S:
			print(s[0][s[1]], end='')
		print('')


### FIXED CODE ###

import sys
K = '.,!? '
A = 'abc'
D = 'def'
G = 'ghi'
J = 'jkl'
M = 'mno'
P = 'pqrs'
T = 'tuv'
W = 'wxyz'
L = ['', K, A, D, G, J, M, P, T, W]
count = int(input())
while count:
	count -= 1
	S = []
	n = input()
	if not '0' in n:
		print('')
		continue
	else:
		n = n.split('0')
		for ns in n:
			if ns == '':
				continue
			i = len(ns) % len(L[int(ns[0])])
			S += [[L[int(ns[0])], i-1]]
		for s in S:
			print(s[0][s[1]], end='')
		print('')
		continue
n = int(input())
A = list(map(int,input().split()))
B = []
C = []
for num in A:
    if num in B: 
        C[B.index(num)] += 1
    else:
        B.append(num)
        C.append(1)

if len(B) > 2:
    print('No')
elif len(B) == 1:
    if N/B[0] >= 2:
        print('Yes')
    else:
        print('No')
elif B[0]  == (B[1]+1):
    k = C[1]
    m = B[1]
    if (n-k) % (m-k+1) == 0:
        print('Yes')
    else:
        print('No')
elif B[1] == (B[0]+1):
    k = C[0]
    m = B[0]
    if (n-k) % (m-k+1) == 0:
        print('Yes')
    else:
        print('No')
else:
    print('No')

### FIXED CODE ###

n = int(input())
A = list(map(int,input().split()))
B = []
C = []
for num in A:
    if len(B) >= 3:
        print("No")
        break
    elif num in B: 
        C[B.index(num)] += 1
    else:
        B.append(num)
        C.append(1)


if len(B) >= 3:
    pass
elif len(B) == 1:
    if n == B[0] +1:
        print('Yes')
    elif n//B[0] >= 2:
        print('Yes')
    else:
        print('No')
elif B[0]  == (B[1]+1):
    k = C[1]
    m = B[1]
    if m-k+1 <= 0:
        print('No')
    elif (n-k) % (m-k+1) == 0:
        print('Yes')
    else:
        print('No')
elif B[1] == (B[0]+1):
    k = C[0]
    m = B[0]
    if m-k+1 <= 0:
        print('No')
    elif (n-k) % (m-k+1) == 0:
        print('Yes')
    else:
        print('No')
else:
    print('No')
from sys import stdin
import math

# A = int(stdin.readline().rstrip())
A, B = [int(x) for x in stdin.readline().rstrip().split()]
# print(A, B)

print((A * B) // math.gcd(A, B))


### FIXED CODE ###

from sys import stdin
import fractions

A, B = [int(x) for x in stdin.readline().rstrip().split()]

print((A * B) // fractions.gcd(A, B))
s = input()
from dateutil.parser import parse
inputDate = parse(s)
heisei = parse('20190430')

if inputDate > heisei:
    print('TBD')
else:
    print('Heisei')

### FIXED CODE ###

from datetime import datetime
s = input()
inputDate = datetime.strptime(s,'%Y/%m/%d')
heiseiDate = datetime.strptime('20190430','%Y%m%d')

if inputDate > heiseiDate:
    print('TBD')
else:
    print('Heisei')
def gcd(a, b):
    if b == 0:
        return a
    else:
        return gcd(b, a % b)
def lcm(a, b):
    return a * b // gcd(a, b)

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

mod = 10 ** 9 + 7
N = n + 2

#逆元テーブル
inv_t = [0]+[1]
for i in range(2, N):
  inv_t += [inv_t[mod % i] * (mod - int(mod / i)) % mod]

base = a[0]
for ai in a:
    base = lcm(base, ai)
ans = 0
for ai in a:
    ans = (ans + base * inv_t[ai]) % mod
print(ans)


### FIXED CODE ###

def factorization(n):
    arr = []
    temp = n
    for i in range(2, int(-(-n**0.5//1))+1):
        if temp%i==0:
            cnt=0
            while temp%i==0:
                cnt+=1
                temp //= i
            arr.append([i, cnt])

    if temp!=1:
        arr.append([temp, 1])

    if arr==[]:
        arr.append([n, 1])

    return arr

#逆元テーブル
mod = 10 ** 9 + 7
N = 1000002
inv_t = [0]+[1]
for i in range(2, N):
  inv_t += [inv_t[mod % i] * (mod - int(mod / i)) % mod]

n = int(input())
a = list(map(int, input().split()))
d = [0 for i in range(1000001)]
for ai in a:
    arr = factorization(ai)
    for i, n in arr:
        d[i] = max(d[i], n)

base = 1
for i, n in enumerate(d):
    base = base * i ** n % mod
ans = 0
for ai in a:
    ans = (ans + base * inv_t[ai]) % mod
print(ans)
length = int(input())
list_p = list(map(int,input().split()))
#list_p.sort()
count = 0
for i in range(length):
  if list_p[i] != (i+1):
    count += 1
 
if count <= 2 :
  print ("YES")
else :
  print ("NO")

### FIXED CODE ###

A,B = map(int, input().split())
if (A + B) % 2 == 0 :
  print ((A + B) // 2)
else :
  print ("IMPOSSIBLE")
#! /usr/bin/env python3
# -*- coding:utf-8 -*-

def attackSurvival(n, k, q, a):
    ans = []
    import collections
    c = collections.Counter(a)
    for i in range(n):
        if c[i+1] > q - k: ans.append('Yes')
        else: ans.append('No')
    return ans

def main():
    n, k, q = filter(int, input().split())
    a = []
    for _ in range(q):
        a.append(int(input()))
    attackSurvival(n, k, q, a)

if __name__ == '__main__':
    main()


### FIXED CODE ###

#! /usr/bin/env python3
# -*- coding:utf-8 -*-

WEATHER = ["Sunny", "Cloudy", "Rainy"]

def next_weather(s):
    return WEATHER[(WEATHER.index(s)+1)%len(WEATHER)]

def main():
    s = input()
    print(next_weather(s))

if __name__ == "__main__":
    main()
# https://atcoder.jp/contests/abc138/tasks/abc138_d

from collections import defaultdict
import sys
sys.setrecursionlimit(100000)


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


def input_int():
    return int(input())


def input_int_list():
    return [int(i) for i in input().split()]


def main():
    n, q = input_int_list()
    cnt = [0] * (n + 1)  # 1-indexed
    tree = defaultdict(list)

    for _ in range(n - 1):
        a, b = input_int_list()
        tree[a].append(b)
        tree[b].append(a)

    # 遅延評価をする O(q)
    for _ in range(q):
        p, x = input_int_list()
        cnt[p] += x

    # 遅延評価（DFS）O(n)
    def tree_walk(root, add):
        cnt[root] += add
        for node in tree[root]:
            if node not in visited:
                visited.add(node)
                tree_walk(node, cnt[root])

    visited = set([1])
    # ルート(1)から結果を評価する
    tree_walk(1, 0)

    print(" ".join([str(i) for i in cnt[1:]]))
    return


if __name__ == "__main__":
    main()


### FIXED CODE ###

# https://atcoder.jp/contests/abc138/tasks/abc138_d

from collections import defaultdict
import sys
sys.setrecursionlimit(100000)


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


def input_int():
    return int(input())


def input_int_list():
    return [int(i) for i in input().split()]


def main():
    n, q = input_int_list()
    cnt = [0] * (n + 1)  # 1-indexed
    tree = defaultdict(list)

    for _ in range(n - 1):
        a, b = input_int_list()
        tree[a].append(b)
        tree[b].append(a)

    # 遅延評価をする O(q)
    for _ in range(q):
        p, x = input_int_list()
        cnt[p] += x

    # 遅延評価（DFS）O(n)
    stack = [(1, 0)]
    visited = set([1])
    while stack:
        e, add = stack.pop()
        cnt[e] += add
        for node in tree[e]:
            if node not in visited:
                visited.add(node)
                stack.append((node, cnt[e]))

    print(" ".join([str(i) for i in cnt[1:]]))
    return


if __name__ == "__main__":
    main()
S = input()
 
if S = 'Sunny':
  print('Cloudy')
elif S = 'Cloudy':
  print('Rainy')
else:
  print('Sunny')

### FIXED CODE ###

S = input()
 
if S == 'Sunny':
    print('Cloudy')
elif S == 'Cloudy':
    print('Rainy')
else:
    print('Sunny')
n,a,b = map(int, input().split())

shou = n // (a+b)
amari = n % (a+b)

ans = shou * a + a if amari >= a　else shou*a+amari

print(ans)

### FIXED CODE ###

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

shou = n // (a+b)
amari = n % (a+b)

if amari >= a:
    print(shou * a + a)

else: print(shou * a + amari)
def check2(x,y,p,t):
    for i in range(p,t,1):
        if x % i == 0 and y % i == 0 :
            return int(i)
    if (i+1) == t :
        return 1
A,B = map(int,input().split())
ans = 1
p = 2
while True :
    t = min(A, B)
    p = check2(A,B,p,t)
    if p ==  1  :
        break
    while True :
        if A % p == 0 and B % p == 0 :
            A = (A//p)
            B = (B//p)
        else :
            break
    ans += 1
print(ans)

### FIXED CODE ###

def gcd(x, y):
    if y == 0 :
        return x
    else:
        return gcd(y,x%y)
def prime(x):
    global  ans
    m = x ** (0.5)
    for i in range(2,int(m+1)):
        if x % i == 0 :
            while True:
                if x % i != 0 :
                    break
                else:
                    x = (x//i)
            ans +=1
    if x != 1 :
        ans += 1
    return ans
A,B = map(int,input().split())
t = gcd(A,B)
ans = 1
print(prime(t))
st = input().split("T")
x, y = map(int, input().split())
XL = []; YL = []; T = 3
for i in range(len(st)):
    if i % 2 == 0:
        XL.append(len(st[i]))
    else:
        YL.append(len(st[i]))
    T += len(st[i])

xx = [[False for j in range(2*T+1)] for i in range(len(XL)+1)]
yy = [[False for j in range(2*T+1)] for i in range(len(YL)+1)]
xx[0][T]=True
yy[0][T]=True
xx[1][T+XL[0]]=True
for i in range(2, len(XL)+1):
    for j in range(2*T+1):
        if j-XL[i-1] < 0:
            xx[i][j]=xx[i-1][j+XL[i-1]]
        elif j+XL[i-1] > 2*T:
            xx[i][j]=xx[i-1][j-XL[i-1]]
        else:
            xx[i][j]=xx[i-1][j-XL[i-1]] or xx[i-1][j+XL[i-1]]

for i in range(1,len(YL)+1):
    for j in range(2*T+1):
        if j-YL[i-1] < 0:
            yy[i][j]=yy[i-1][j+YL[i-1]]
        elif j+YL[i-1] > 2*T:
            yy[i][j]=yy[i-1][j-YL[i-1]]
        else:
            yy[i][j]=yy[i-1][j-YL[i-1]] or yy[i-1][j+YL[i-1]]

if xx[len(XL)][x+T] and yy[len(YL)][y+T]:
    print("Yes")
else:
    print("No")


### FIXED CODE ###

st = input().split("T")
x, y = map(int, input().split())
XL = []; YL = []; t = 0
for i in range(len(st)):
    if i % 2 == 0:
        XL.append(len(st[i]))
    else:
        YL.append(len(st[i]))
    t += len(st[i])
if abs(x) + abs(y) > t:
    print("No")
else:
    T = max([abs(x), abs(y), t])
    xx = [[False for j in range(2*T+1)] for i in range(len(XL)+1)]
    yy = [[False for j in range(2*T+1)] for i in range(len(YL)+1)]
    xx[0][T]=True
    yy[0][T]=True
    xx[1][T+XL[0]]=True
    for i in range(2, len(XL)+1):
        for j in range(2*T+1):
            if j-XL[i-1] < 0:
                xx[i][j]=xx[i-1][j+XL[i-1]]
            elif j+XL[i-1] > 2*T:
                xx[i][j]=xx[i-1][j-XL[i-1]]
            else:
                xx[i][j]=xx[i-1][j-XL[i-1]] or xx[i-1][j+XL[i-1]]
    
    for i in range(1,len(YL)+1):
        for j in range(2*T+1):
            if j-YL[i-1] < 0:
                yy[i][j]=yy[i-1][j+YL[i-1]]
            elif j+YL[i-1] > 2*T:
                yy[i][j]=yy[i-1][j-YL[i-1]]
            else:
                yy[i][j]=yy[i-1][j-YL[i-1]] or yy[i-1][j+YL[i-1]]

    if xx[len(XL)][x+T] and yy[len(YL)][y+T]:
        print("Yes")
    else:
        print("No")
_,s=open(0)
for c in s[:-1]:print(chr(65+(ord(c)-65+n)%26),end='')

### FIXED CODE ###

n=int(input())
print(''.join(chr((ord(c)+n-65)%26+65)for c in input()))
x=input()
y = 2*PI()*x
print(y)

### FIXED CODE ###

import math
r = int(input())
s = 2 * r * math.pi
print(s)
import math
X = int(input())
money = 100
y = 1
while X > money:
  money += moth.floor(money*0.01)
  y += 1
  
print(y)
  

### FIXED CODE ###

import math
X = int(input())
money = 100
y = 0

while X > money:
  money += math.floor(money*0.01)
  y += 1
print(y)
import heapq

def add(i,pj,T):
    if T[i]['p']!=i:
        add(T[i]['p'],pj,T)
    T[i]['p']=pj
    
def parent(i,T):
    if T[i]['p']!=i:
        T[i]['p']= parent(T[i]['p'],T)
        return T[i]['p']
    else:
        return i

N=int(input())
town=[]
for i in range(N):
    x,y=list(map(int,input().split()))
    town.append([i,x,y])
townX=sorted(town,key=lambda x:x[1])
townY=sorted(town,key=lambda x:x[2])
road=[]
for i in range(1,N):
    heapq.heappush(road,[townX[i][1]-townX[i-1][1],townX[i-1][0],townX[i][0]])
for i in range(1,N):
    heapq.heappush(road,[townY[i][2]-townY[i-1][2],townY[i-1][0],townY[i][0]])

vi=0
ans=0
tree={i:{'p':i,'h':0} for i in range(N)}
while vi<N-1:
    d,u,v = heapq.heappop(road)
    pu=parent(u,tree)
    pv=parent(v,tree)
    if pu == pv:
        continue
    elif tree[pu]['h']<tree[pv]['h']:
        add(u,pv,tree)
    elif tree[pu]['h']==tree[pv]['h']:
        add(u,pv,tree)
        tree[pu]['h']+=1
    else:
        add(v,pu,tree)
    vi+=1
    ans+=d
print(ans)

### FIXED CODE ###

import heapq
import sys

sys.setrecursionlimit(10**5)

def add(i,pj,T):
    if T[i]!=i:
        add(T[i],pj,T)
    T[i]=pj
    
def parent(i,T):
    if T[i]!=i:
        T[i]= parent(T[i],T)
        return T[i]
    else:
        return i

N=int(input())
town=[]
for i in range(N):
    x,y=list(map(int,input().split()))
    town.append([i,x,y])
townX=sorted(town,key=lambda x:x[1])
townY=sorted(town,key=lambda x:x[2])
road=[]
for i in range(1,N):
    heapq.heappush(road,[townX[i][1]-townX[i-1][1],townX[i-1][0],townX[i][0]])
for i in range(1,N):
    heapq.heappush(road,[townY[i][2]-townY[i-1][2],townY[i-1][0],townY[i][0]])

vi=0
ans=0
tree=[i for i in range(N)]
rank=[0 for i in range(N)]
while vi<N-1:
    d,u,v = heapq.heappop(road)
    pu=parent(u,tree)
    pv=parent(v,tree)
    ru=rank[pu]
    rv=rank[pv]
    if pu == pv:
        continue
    elif ru<rv:
        add(u,pv,tree)
    elif ru==rv:
        add(u,pv,tree)
        rank[pu]+=1
    else:
        add(v,pu,tree)
    vi+=1
    ans+=d
print(ans)
a, b = int(input().split())
s = a - 1
t = b-1
asn = (s + t -1) // s

### FIXED CODE ###

a, b = map(int, input().split())
print(((b - 1) + (a - 2)) // (a - 1))
x, y = map(int, raw_input.split())



while True:
  if x < y:
     print 'x y'
  if x > y :
     print 'y x'
  elif x == y:
     print 'x y'
  if x == y == 0:
     break

 

### FIXED CODE ###




while 1:
  x, y = map(int, raw_input().split())
  if x == y == 0:
     break


  if x < y:
     print '%d %d' %(x, y)
  elif x > y :
     print '%d %d' %(y, x)
  elif x == y:
     print '%d %d' %(x, y)
import math
a,b,c,d = map(int,input().split())
lg = b - a + 1

def div (n):
    rt = lg // n
    if lg % n != 0 and ((n- a%n) + (b%n) < n):
        rt += 1
    return(rt)

cm = c * d // math.gcd(c,d)
ans = lg - div(c) - div(d) + div(cm)
print(ans)

### FIXED CODE ###

import fractions
a,b,c,d = map(int,input().split())
lg = b - a + 1

def div (n):
    rt = lg // n
    if lg % n != 0 and ((n- a%n) + (b%n) < n):
        rt += 1
    return(rt)

cm = c * d // fractions.gcd(c,d)
ans = lg - div(c) - div(d) + div(cm)
print(ans)
import itertools as it

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

l=[n for n in range(1,N+1)]
for i,t in enumerate(it.permutations(l)):
    if t==P:
        a=i+1
    elif t==Q:
        b=i+1
ans=abs(b-a)

print(ans)

### FIXED CODE ###

import itertools as it

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

l=[n for n in range(1,N+1)]
for i,t in enumerate(it.permutations(l)):
    if t==P:
        a=i+1
    if t==Q:
        b=i+1
ans=abs(b-a)

print(ans)
s = str(input())
t = str(input())
s2 = ''.join(sorted(s))
t2 = ''.join(sorted(t,reverse=True))

if s2 < t2:
    print('Yes')
else:
    print('No')

### FIXED CODE ###

import math
a,b = map(int,input().split())
x = (a + b)/2
print(math.ceil(x))
x, y = int(input())

print(x + int(y / 2))


### FIXED CODE ###

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

print(x + int(y / 2))
# 等差数列

N = int(input())

# 1+2+3+4+...+(N-2)+(N-1)+N
# N+(N-1)+(N-2)+...+4+3+2+1
# 上と下を足し算して、２で割る

a = N+1
b = N

# print( a * b / 2 )

# TypeError: can only concatenate str (not "int")
# Nという文字と数字を連結できない??
print(math.floor(a * b / 2 )

### FIXED CODE ###

N = int(input())

# 1+2+3+4+...+(N-2)+(N-1)+N
# N+(N-1)+(N-2)+...+4+3+2+1
# 上と下を足し算して、２で割る

a = N+1
b = N

print(int( a * b * 0.5 ))
N,M=map(int, input().split())
A=list(map(int, input().split()))
A.index(max(A))
A.sort()
B=[A.pop()//2]
M-=1

while(M):
    if A[-1]>B[-1]:
        B.insert(0,A.pop()//2)
    else:
        b=B.pop()//2
        B.insert(0,b)
    M-=1
    
print(sum(A)+sum(B))

### FIXED CODE ###

import heapq

N,M = map(int, input().split())
A = list(-int(i) for i in input().split()) 

heapq.heapify(A)

for i in range(M):
    x=heapq.heappop(A)//(-2)
    heapq.heappush(A, -x)

print(-sum(A))
import argparse

def main(s: str):
    if s[0] == s[1] == s[2]:
        return "No"
    else:
        return "Yes"

if __name__ == "__main__":
    parser = argparse.ArgumentParser()
    parser.add_argument("s", type=str)
    args = parser.parse_args()
    print(main(args.s))

### FIXED CODE ###

import argparse

def main(s: str):
    if s[0] == s[1] == s[2]:
        return "No"
    else:
        return "Yes"

if __name__ == "__main__":
    s = input()
    print(main(s))
from collections import deque

H, W = map(int, input().split())
A = [list('#' * (W + 2))]
q = deque()
for _ in range(H):
    a = input()
    A.append(list('#' + a + '#'))
A.append(list('#' * (W + 2)))
dx = [-1, 0, 1, 0]
dy = [0, -1, 0, 1]

for i in range(1, H + 1):
    for j in range(1, W + 1):
        if A[i][j] == '#':
            q.append([i, j, 1])

ans = 1

while len(q) != 0:
    p = q.popleft()
    for k in range(4):
        y = p[1] + dy[k]
        x = p[0] + dx[k]
        c = p[2]
        ans = max(ans, c)
        if A[y][x] == '.':
            A[y][x] = '#'
            q.append([y, x, c + 1])

print(ans - 1)


### FIXED CODE ###

from collections import deque


H, W = map(int, input().split())
A = [list('#' * (W + 2))]
q = deque()
A_append = A.append
q_append = q.append
for _ in range(H):
    a = input()
    A_append(list('#' + a + '#'))
A.append(list('#' * (W + 2)))
dx = [-1, 0, 1, 0]
dy = [0, -1, 0, 1]

for i in range(1, H + 1):
    for j in range(1, W + 1):
        if A[i][j] == '#':
            q_append([i, j, 0])

ans = 0

while len(q) != 0:
    p = q.popleft()
    for k in range(4):
        y = p[0] + dy[k]
        x = p[1] + dx[k]
        c = p[2]
        ans = max(ans, c)
        if A[y][x] == '.':
            A[y][x] = '#'
            q_append([y, x, c + 1])

print(ans)
from operator import itemgetter
# スペース区切りの整数入力
N,M = map(int, input().split())
#指定数分の３つの整数を順番に受けてリストに入力
move = {}
for i in range(M):
    x,y = map(int, input().split())
    move.setdefault(x,[]).append(y)

dp = [-1] * (N+1)

def findpath(now_x):
    if dp[now_x] > -1:
        return dp[now_x]
    maxpath = 0
    if now_x in move.keys():
        for y in move[now_x]:
            maxpath = max(maxpath,findpath(y) + 1)
    dp[now_x] = maxpath
    return maxpath

Ans = 0
for do_x in range(1,N+1):
    Ans = max(Ans,findpath(do_x))

print(Ans)


### FIXED CODE ###

import sys
sys.setrecursionlimit(10**5)

# スペース区切りの整数入力
N,M = map(int, input().split())
#指定数分の３つの整数を順番に受けてリストに入力
move = {}
for i in range(M):
    x,y = map(int, input().split())
    move.setdefault(x,[]).append(y)

dp = [-1] * (N+10)

def findpath(now_x):
    if dp[now_x] > -1:
        return dp[now_x]
    maxpath = 0
    if now_x in move.keys():
        for y in move[now_x]:
            maxpath = max(maxpath,findpath(y) + 1)
    dp[now_x] = maxpath
    return maxpath

Ans = 0
for do_x in range(1,N+1):
    Ans = max(Ans,findpath(do_x))

print(Ans)
import math
def main():
    N,X=map(int,input().split())
    x=[a-X for a in sorted(map(int,input().split()), reverse=True)]
    if N == 1:
        print(x[0])
        return
    d=[]
    for i in range(N-1):
        d.append(x[i]-x[i+1])
    ans=math.gcd(d[0], d[1])
    for a in d[1:]:
        ans = math.gcd(ans, a)
    print(ans)
    
if __name__ == "__main__":
    main()

### FIXED CODE ###

import math
def main():
    n,x=map(int,input().split())
    p=0
    for i in map(int,input().split()):
        p = math.gcd(p, i-x)
    print(p)

if __name__ == "__main__":
    main()
# python template for atcoder1
import sys
sys.setrecursionlimit(10**9)
input = sys.stdin.readline

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

seq = 0
ans = 0
for i in range(1, N+1):
    if A[i] == i:
        seq += 1
    else:
        ans += (seq+1)//2
        seq = 0
ans += (seq+1)//2
print(ans)


### FIXED CODE ###

# python template for atcoder1
import sys
sys.setrecursionlimit(10**9)
input = sys.stdin.readline

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

for i in range(1, N+1):
    A[i-1] -= i

# print(A)

ans = 0
if all(a != 0 for a in A):
    ans = 0
else:
    seq = 0
    for i in range(N):
        if A[i] == 0:
            seq += 1
        else:
            ans += (seq+1)//2
            seq = 0
    ans += (seq+1)//2
print(ans)