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

# at position 0
l_b = 0
r_w = S.count('.')

needHand = 2 * 10**5
for i,v in enumerate(S):
  if S[i] == '#': #black
    l_b += 1
  else:
    r_w -= 1
  ret = l_b + r_w
  
  if ret < needHand:
    needHand = ret

ans = needHand
print("{}".format(ans))