def main():
    N = int(input())
    S = [str(i) for i in input()]

    next_black_num = 0
    pre_stone = "."

    for s in S:
        if pre_stone == "#" and s == ".":
            next_black_num += 1
        pre_stone = s

    print(min([next_black_num, N - next_black_num]))


if __name__ == '__main__':
    main()
