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

    # 最初に黒い石が出現した後に出現した"."と"#"のそれぞれの総数のうち、最小のものを返す
    b_num = 0
    w_num = 0
    is_start = False
    for c in s:
        if not is_start and c == "#":
            is_start = True
            continue
        if is_start and c == ".":
            b_num += 1
        if is_start and c == "#":
            w_num += 1

    return min(w_num, b_num)


print(main())