import bisect
N = int(input())
S = input()
ls = S.split('#')
ans = 0
if S[0] == '.':
    if len(S) == 1:
        print(0)
    else:
        for x in ls[1:]:
            ans += len(x)
    print(ans)
if S[0] == '#':
    for x in ls:
        ans += len(x)
    print(ans)
    