n = int(input())
s = input()
ans = 0
ans_alt = 0
cs = str(s)
while s.count("#.") != 0:
    ans_alt += s.count("#.")
    s = s.replace("#.", "..")


while cs.count("#.") != 0:
    ans += cs.count("#.")
    cs = cs.replace("#.", "##")


if ans > ans_alt:
    ans = ans_alt

print(ans)
