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

ans = 0
for i in range(len(S)-1):
  if S[i]=="#" and S[i+1]==".":
    ans += 1
    S = S[:i] + "#" + S[i+1:]
  
if 2*ans < len(S):
  print(ans)

else:
  print(len(S)-ans)