N = int(input())
S = input()
 
arr = [0] if S[0] == "." else []
b, w = 0, 0
for i in range(len(S)):
  if S[i] == ".":
    w += 1
  else:
    b += 1
  if S[i:i+2] == "#.":
    arr.append(b)
  if S[i:i+2] == ".#":
    arr.append(w)
if S[-1] == ".":
  arr.append(w)
print(arr)

result = w
for i in range(0, len(arr), 2):
  result = min([arr[i]+w-arr[i+1], result])

print(result)