N = int(input())
S = input()
 
count_white = 0
flag = False

for s in S:
  if s == "#" and not flag:
    flag = True
  elif s == "." and flag:
    count_white += 1
    
flag = False
count_black = 0
for s in reversed(S):
  if s == "." and not flag:
    flag = True
  elif s == "#" and flag:
    count_black += 1
print(min(count_white, count_black))