N = int(input())
S = input()

if ('.' not in S) or ('#' not in S):
    print(0)
    exit()

flag = False
cnt = 0
for char in S:
    if char == '#':
        flag = True

    if char == '.' and flag:
        cnt += 1
        flag = False

print(cnt)
