n = int(input())
s = str(input())
len_s = range(len(s))
count_sharp = s.count("#")
count_dot = s.count(".")
for i in len_s:
    if s[i] == "#":
        s = s[i::]
count_sharp = s.count("#")
count_dot = s.count(".")
print(min(count_dot, count_sharp))
