from copy import deepcopy
n = int(input())
S = list(input())
s =deepcopy(S)
cnt =0
for i in range(n-1):
    if s[i] == "#" and s[i+1] == ".":
        cnt +=1
        s[i+1] = "#"
        #print(s)
cnt1 = 0
s = deepcopy(S)
for i in range(n-1,0,-1):
    if s[i] == "." and s[i-1] == "#":
        cnt1  +=1
        s[i-1] = "."
        #print(s)
print(min(cnt1,cnt))