n = int(input())
s = input()
white = [ 0 for i in range(n+1) ]
black = [ 0 for i in range(n+1) ]
for i in range(1,n+1):
    white[i] = white[i-1]
    black[i] = black[i-1]
    if s[i-1] == '.':
        white[i]+=1
    else:
        black[i]+=1
ans = min( n - white[n] , n - black[n] )
for i in range(1,n):
    a = black[i]
    b = white[n] - white[i-1]
    ans = min( ans, a+b)
print(ans)
