n = int(input())
s = str(input())
len_s = range(n)

for i in len_s:
    if s[i] == "#":
        s = s[i::]
        break
count_sharp = s.count("#")
count_dot = s.count(".")
if min(count_dot, count_sharp) == n:
    print(0)
else:
    print(min(count_dot, count_sharp))