import numpy as np
  
input()
S = np.asarray(list(str(input())))
i = 0
for s in S:
 if s == "#":
  idx = i
  break
 else:
  i += 1
else:
 print(0)
 exit()
S = S[i:]
rw = S[S=="."].size
rb = S[S=="#"].size
lw = 0
lb = 0
res = 2 * 10**5

for i in range(S.size):
 if S[i] == "#":
  rb -= 1
  lb += 1
 else:
  rw -= 1
  lw += 1
 res = min(res,lb+rw)
print(res)
