n = int(input())
s = input()
if s.count("#") == 0:
    print(0)
    exit()

ans = 0
state = False
for _s in s:
    if _s == '#':
        state = True
    elif _s == '.' and state:
        ans += 1

print(ans)