N = int(input())
S = input()
 
arr = [0] if S[0] == "." else []
count = 0
for i in range(len(S)):
  count += 1
  if S[i:i+2] == "#.":
    arr.append(count)
    count = 0  
  if S[i:i+2] == ".#":
    arr.append(count)
    count = 0
arr.append(count)
#print(arr)

result = 10 ** 10
for i in range(0, len(arr), 2):
  result = min([sum(arr[:i][::2])+sum(arr[i:][1::2]), result])

print(result)