N=int(input())
S=input()


min_count=20000

for i in range(N):
    black_count=S[0:i+1].count("#")
    white_count=S[i+1:N].count(".")
    min_count = min(min_count, black_count+white_count)
    
print(min_count)

