n = int(input())
s = list(input())
white = 0
black = 0
rightmost = -1
temp = 0
for i in range(n):
    if s[i] == '#':
        black+=1
    else:
        white+=1
        rightmost = i
        temp = black
print(min(n-white, n-black, temp))
    
