# coding: utf-8
def main():
    input()
    s = list(input())

    # 最初に現れた"#"以降の"."と"#"をそれぞれカウントし、最小のものを返す
    w_num = 0
    b_num = 0
    is_start = False
    for c in s:
        if not is_start:
            if c != "#":
                continue
            is_start = True
        else:
            if c == ".":
                w_num += 1
            elif c == "#":
                b_num += 1

    return min(w_num, b_num)


print(main())