N = int(input())
S = input()
S = S.replace('.', '1').replace('#', '0')
white = S.count(".")
#checker = 
intS = int(S,2)
check =int('1'*N,2)
min_change = N
for i in range(N+1):
    change = bin(check^intS)[2:].count('1')
    if min_change > change:
        min_change = change
    check = check & ~pow(2, i)
print(min_change)