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

s = list(s)

i = 0
cnt1 = 0

if "."*n == s:
    print(0)
elif "#"*n == s:
    print(0)
else:
    for i in range(len(s)-1):
        if (s[i] == "#") and (s[i+1] == "."):
            s[i+1] = "#"
            cnt1 += 1
    print(cnt1)