N = int(input())
S = input()
cnt1 = 0
cnt2 = 0
S1 = S
S2 = S
for i in range(1, N):
  if S1[i-1] == "#" and S1[i] == ".":
    S1 = S1.replace(S1[i-1], ".", 1)
    cnt1 += 1
for i in range(1, N):
  if S2[i-1] == "#" and S2[i] == ".":
    S2 = S2.replace(S2[i-1], "#", 1)
    cnt2 += 1
  
print(min(cnt1,cnt2))