N = int(input())
S = input()
allblack = S.count('.')
allwhite = S.count('#')
firstblack = S.find('#')
ushiro = 1
while S[-ushiro] == '#':
    ushiro += 1
    if ushiro > N:
        break
ushiro -= 1
katamari = N - ushiro

if firstblack != -1:
    BlackToWhite = S[firstblack:katamari].count('#')
    #print(ushiro)
    #print(S[firstblack:katamari])
    WhiteToBlack = S[firstblack:katamari].count('.')
    lastblack = min(BlackToWhite, WhiteToBlack)
else:
    lastblack = 2 ^ 32
#print('allblack: ' + str(allblack))
#print('allwhite: ' + str(allwhite))
#print('lastblack: ' + str(lastblack))
print(min(allblack, allwhite, lastblack))
