n = int(input())
s = input()
l = [0]*(n+1)
count = 0
for i in range(len(s)) :
    if s[i] == "." :
        count += 1
    l[i+1] = count
siro = l[-1]
ans = 1000000000000000000000
for i in range(1,n+1):
    ans = min(ans,i-2*l[i]+siro)
if siro == 0 :
    print(0)
else:
    print(ans)
"""
  1 2 3 4 5 6 7 8
 . # . . # # . #
0 1 1 2 3 3 3 4 4
"""
"""
  1 2 3 4
 . # # .
0 1 1 1 2
"""
