n = int(input())
s = input()
cur = s[0]
count = 0
l = []
for i in range(n):
  if s[i] == cur:
    count += 1
  else:
    l.append([cur,count])
    cur,count = s[i],1
l.append([cur,count])
ans = 0
for i in range(len(l)):
  if i == len(l)-1:
    print(ans)
  elif l[i][0] == '.':
    continue
  else:
    ans += min(l[i][1],l[i+1][1])