N = int(input())
S = input()
mini = N
tmp = S.count('.')
def judge(k):
  return bool(S[k]=='.')
def check(k):
  return 1-2*judge(k)
for i in range(N):
  tmp += check(i)
  if tmp < mini:
    mini = tmp
print(mini)