N = int(input())
S = input()
allblack = S.count('.')
allwhite = S.count('#')
firstblack = S.find('#')
if firstblack != -1:
    lastblack = S[firstblack:].count('.')
else:
    lastblack = 2 ^ 32
#print('allblack: ' + str(allblack))
#print('allwhite: ' + str(allwhite))
#print('lastblack: ' + str(lastblack))
print(min(allblack, allwhite, lastblack))
