
ソースコード 

Copy
Copy
N = int(input())
S = input()
 
le=N
 
ans = 0
for i in range(le-1):
  if S[i]=="#" and S[i+1]==".":
    ans += 1
    S = S[:i] + "#" + S[i+1:]
  
if 2*ans < N:
  print(ans)
 
else:
  print(le-ans-1)