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

bw = []
if S[0] == "#":
  bw.append(0)
for i in range(N):
  if i == 0 or S[i] != S[i - 1]:
    bw.append(1)
  else:
    bw[-1] += 1
  
ans = float("inf")
for i in range(len(bw)):
  tmp = 0
  for j in range(len(bw)):
    if j <= i and j % 2 == 1:
      tmp += bw[j]
    elif j > i and j % 2 == 0:
      tmp += bw[j]
    ans = min(ans, tmp)
print(ans)