n = int(input())
s = input()
a = s.find("#")
anum = s.count("#")
b = s.find(".")
bnum = n - anum


if a == -1 or b == -1:
    print(0)
else:
    print(min(s[a:].count("."),sorted(s)[b:].count("#"),bnum,anum))
    #print(s[a:].count("."),sorted(s)[b:].count("#"),bnum,anum)
#print(b)
#print(s[:b+1].count("#"))
