n = int(input())
s = input()
s1 = s
a = 0
b = 0
for i in range(n-1):
  while s[i] == "#" and s[i+1] == "." :
    s = s.replace(s[i+1],"#")
    a += 1
  s = s1
  while s[i] == "#" and s[i+1] == "." :
    s = s.replace(s[i],".")
    b += 1
print(min(a,b))