_ = input()
S = input().lstrip('.').rstrip('#')
n = len(S)
A = list(S)
ans = n
x = 0
y = S.count('.')
for i in range(n):
  if S[i] == '#':
    x += 1
  else:
    y -= 1
  ans = min(ans, x + y)
print(ans)