n = int(input())
s = input()

# go all white
res = s.count("#")
res = min(res, s.count("."))


blacklist = []
for i in range(n):
    if s[i] == "#":
        blacklist.append(i)

ll = len(blacklist)
#print(blacklist, ll, res)
for i in range(len(blacklist)):
    need = n - i - 1 - (ll- (i + 1))
    res = min(res, need)



print(res)
