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

count = 0
while '#.' in S:
    temp = S.replace('#.', '*')
    count += temp.count('*')
    temp = temp.replace('*.', '...')
    temp = temp.replace('*#', '###')
    S = temp.replace('*', '##')
print(count)