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)
elif "." in s[b+1:] and "#" in s[b+1:]:
    print(min(s[a:].count("."),s[:b+1].count("#"),anum,bnum))
else:
    print(min(s[a:].count("."),anum,bnum))
    #一番左の"#"から数えていくつ "." があるか
    #一番左の"."から数えていくつ"#"があるか
"""
moto = "0b"
wb = "0b"
ww = "0b"+"0"*n
bb = "0b"+"1"*n
checker = 0
for i in range(n):
    if s[i] == "#":
        moto += "1"
        checker = 1
    else:
        moto += "0"

    if checker == 1:
        wb += "1"
    else:
        wb += "0"

#print(min(str(int(moto,0) ^ int(wb,0)).count("1"),str(int(moto,0) ^ int(ww,0)).count("1"),str(int(moto,0) ^ int(bb,0)).count("1")))
print(min(str(bin(int(moto,0) ^ int(wb,0))).count("1"),str(bin(int(moto,0) ^ int(ww,0))).count("1"),str(bin(int(moto,0) ^ int(bb,0))).count("1")))
