n = int(input())
s = list(input())
s_init = s

if not "#" in s:
    print(0)
    exit()
kuro = s.count("#")
idx = s.index("#")
for i in range(idx):
    s_init.pop(0)
shiro = s_init.count(".")

print(min(kuro,shiro))
