N = int(input())
S = input()

black_ind = S.find("#")
white_ind = N - S[::-1].find(".") - 1
if black_ind == -1 or white_ind == N:
    print(0)
else:
    # print(black_ind)
    # print(white_ind)
    black = "." * black_ind + "#" * (N - black_ind)
    # print(black)
    white = "." * (white_ind+1) + "#" * (N - white_ind - 1)
    # print(white)

    countb = len([1 for (s, b) in zip(S, black) if s != b])
    # print(countb)
    countw = len([1 for (s, w) in zip(S, white) if s != w])
    # print(countw)
    print(min(countb, countw))