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

print(min(count1,count2))