n = int(input())
s = input()
ans = 0
flag = 0
for i in range(len(s)-1):
    if flag:
        if s[i+1] == '.':
            ans += 1
    if s[i] == '#' and s[i+1] == '.':
        ans += 1
        flag = 1
    else:
        flag = 0

back = 0
for i in range(len(s)-1,0,-1):
    if s[i] == "#":
        back += 1
    else:
        break
ans = ans - back
if s.count("#") > ans:
    print(ans)
else:
    print(s.count("#"))