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

s1 = 0
s2 = 0

for s in S:
  if s == '.':
    s1 += 1
  else:
    break
    
for s in S[::-1]:
  if s == '#':
    s2 += 1
  else:
    break

print(min(S[s1+1:].count('.'), S[:-(s2+1)].count('#')))