# coding: utf-8

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

nmin = S.find('#.')

if nmin == -1:
    print(0)
else:
    all_to_black = S.count('.')
    all_to_white = S.count('#')

    left = S[:nmin+1]
    right = S[nmin+1:]
    split = left.count('#') + right.count('.')

    print(min(all_to_black, all_to_white, split))
