N = int(input())
S = input()
tmp = S.count('#.')
counter = 0
for i in range(tmp):
    count = S.find('#.') + 1
    S_list = list(S)
    while True:
        if count < len(S):
            if S_list[count] == '.':
                counter += 1
                S_list[count] = '#'
                count+= 1
            else:
                break
        else:
            break
    S = ''.join(S_list)
print(counter)
