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

count_1 = 0
count_2 = 0
for i in range(N-1):
  if S[i] == "#" and S[i+1] == ".":
    S[i+1] = "#"
    count_1 += 1
for i in range(N-1):
  if S[N - i - 1] == "." and S[N - i - 2] == "#":
    S[N - i] = "."
    count_2 += 1
    
print(min(count_1, count_2))