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

if "." not in s or "#" not in s:
    print(0)
    exit()

f = 0
res = 0
for i in s:
    if f == 1 and i==".":
        res += 1
    if i=="#":
        f = 1
else:
    print(res)
