N = int(input())
S = input()
tmp = S.count('#.')
counter = 0
for i in range(tmp):
    count = S.find('#.') + 1
    while S[count] == '.':
        counter += 1
        S[count] = '#'
        count+= 1
print(counter)
