def C(N, S):
    min_n_diff_chars = 2 * 10 ** 5
    for i in range(N):
        cand = "." * i + "#" * (N-i)
        n_diff_chars = sum(a!=b for a, b in zip(cand, S))
#       print(cand, n_diff_chars)
        min_n_diff_chars = min(min_n_diff_chars, n_diff_chars)
    print(min_n_diff_chars)

if __name__ == "__main__":
    N = int(input())
    S = input()
    C(N, S)