n = int(input())
s = list(input())
S = s[::-1]

cnt1 =0
for i in range(n-1):
    if s[i] == "#" and s[i+1] == ".":
        cnt1 +=1
        s[i+1] = "#"
cnt2 = 0

for i in range(n-1):
    if S[i] == "." and S[i-1] == "#":
        cnt2  +=1
        S[i+1] = "."
        #print(s)
print(min(cnt1,cnt2))