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

# input

N = int(input())
S = input()

w_n = S.count(".")
b_n = S.count("#")

if N==w_n or N==b_n:
    print(0)
    exit()

ans = 0
flg = False
for i in range(len(S)):
    if i == 0:
        continue
    if flg:
        a = "#"
        flg = False
    else:
        a = S[i-1]
    b = S[i]

    if a=="#" and b==".":
        flg = True
        ans +=1

print(ans)