n = int(input())
s = input()
li = []
for i in range(n):
    if s[i] == "#":
        li.append(i)
sum = 0
if len(li) == 0:
    print(0)
else:
    for i in range(len(li)-1):
        sum += li[i+1]-li[i]
    sum += len(s) - li[-1] -1
    print(sum)