n = int(input())
s = input()
#n = len(s)

cnt = 0
k = -1
for i in range(n):
    if s[i] == '#':
        k = i
        break

if k == n-1:
    pass
elif k == -1:
    pass      
else:
    for j in range(k, n):
        if s[j] == '.':
            cnt += 1

print(cnt)