if __name__ == '__main__':
    N = int(input())
    S = str(input())

    ok_list = []
    for i in range(0, N+1):
        ok_list.append("."*i + "#" * (N-i))

    answer = N + 1

    for ok_pattern in ok_list:
        different_str_count = 0
        for i in range(0, len(ok_pattern)):
            if ok_pattern[i] != S[i]:
                different_str_count += 1
        if answer >= different_str_count:
            answer = different_str_count

    print(answer)
