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

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

# go all black from first kuro
for i in range(n):
    if s[i] == "#":
        #
        cnt = 0
        for j in range(i, n):
            if s[j] == ".":
                cnt += 1
        res = min(res, cnt)


        break

print(res)
