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

from itertools import groupby
L = []
for k,v in groupby(s):
    L.append(list(v))
#print(L)
cnt = 0
for i in range(len(L)-1):
    if L[i][0] == "#" and L[i+1][0] == ".":
        cnt += min( len(L[i]),len(L[i+1]) )
print(cnt)