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

#r = S.index('.')
r = 0
if '.' in S:
    l = -1 * S[::-1].index('.')
else:
    l = 0
if r == 0 and l == 0:
    target = S
else:
    target = S[r:l]
# 全部白
#S[r:l].count('#')
# 全部黒
#S[r:l].count('.')
print(min(target.count('#'), target.count('.')))
