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

finded_black = False
answer = 0

for c in s:
    if finded_black:
        if c == '#':
            continue
        else:
            answer += 1

    if not finded_black:
        if c == '.':
            continue
        else:
            finded_black = True

print(answer)