n = int(input())
s = list(input())
m = n
counts = s[:].count(".")
m = min(n,counts)
for i in range(n):
    counts += s[i].count("#") - s[i].count(".")
    if m > counts:
        m = counts
        
print(m)