N = int(input())
S = input()
allblack = S.count('.')
allwhite = S.count('#')
lastblack = S[:-1].count('#') + S[-1].count('.')
#print('allblack: ' + str(allblack))
#print('allwhite: ' + str(allwhite))
#print('lastblack: ' + str(lastblack))
print(min(allblack, allwhite, lastblack))