n = int(input())
S = list(input())

flag = 0
ans1 = 0
for i in range(n):
  if S[i] == '.':
    if flag == 1:
      ans1 += 1
  else:
    flag = 1
    
flag = 0
ans2 = 0
for i in range(n-1, -1, -1):
  if S[i] == '#':
    if flag == 1:
      ans2 += 1
  else:
    flag = 1
    
print(min(ans1, ans2))