n = int(input())
s = list(input())
if "." in s:
    a = [i for i, x in enumerate(s) if x == '.'][-1]
    ans1 = s[:a].count("#")
else:
    ans1 = 0
if "#" in s:
    b = [i for i, x in enumerate(s) if x == '#'][0]
    ans2 = s[b:].count(".")
else:
    ans2 = 0
print(min(ans1, ans2))