def CountToAllBlack(s):
    return s.count('.')

def CountToAllWhite(s):
    return s.count('#')


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

firstBlack = S.find('#')
count = min(CountToAllBlack(S[firstBlack:]), CountToAllWhite(S[:N-2]))
print(count)
