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

S1 = list(S)
S2 = list(S)

count1 = 0
count2 = 0

while(1):
  if "#." not in str("".join(S1)):
    break
  for i in range(N-1):
    if S1[i] == "#" and S1[i+1] == ".":
      S1[i+1] = "#"
      count1 += 1
while(1):
  if "#." not in str("".join(S2)):
    break
  for i in range(N-1):
     if S2[i] == "#" and S2[i+1] == ".":
       S2[i] = "."
       count2 += 1


print(min(count1,count2))