N = int(input())
S = list(input())
first = True
ans = 0
count = 0
for i in range(N):
  if first:
    if S[i] == '#':
      first=False
  else:
    count += 1
    if S[i] == '.':
      ans += 1
if ans > count/2:
  print(count-ans+1)
else:
  print(ans)