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