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

S_list = [0 if S[i] == "." else 1 for i in range(N)]
S_sum_list = [S_list[0]]
for i in range(1, N):
  S_sum_list[i] = S_sum_list[i-1] + S_list[i]
  
ans = 10 ** 18
for i in range(1, N):
  if i == 0:
    min_num_1 = min(S_sum_list[N-1], N - S_sum_list[N-1])
  else:
    ans = min(ans, S_sum_list[i-1] + N - i - (S_sum_list[N-1] - S_sum_list[i-1]))
print(min(min_num_1, ans))