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


def func(input_s):
    count = input_s.count(".")
    if len(input_s) == 1: return 0;
    c = input_s[-1]
    if c == "." and input_s[-2] == "#":
        tmp_str = input_s
        tmp_str[-2] = "."
        tmp_count = func(tmp_str[:-2])
        count = min(tmp_count + 1, count)
    else:
        tmp_count = func(input_s[:-2])
        count -= 1
        count = min(tmp_count + 1, count)
    return count


pre = ""
print(func(s))
