N = int(input())
S2 = list(str(input()))
S1 = S2.copy()
count1,count2 = 0,0
j = 0
for i in range(N-1,0,-1):
  if S1[i-1] == "#" and S1[i] == ".":
    count1 += 1
    S1[i-1] = "."

for i in range(1,N):
  if S2[i-1] == "#" and S2[i] == ".":
    count2 += 1
    S2[i] = "#"

print(min(count1,count2))