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

all_black_num = S.count('#')
all_white_num = N - all_black_num

ans = N
left_black_num = 0
left_white_num = 0
for i, c in enumerate(S):
    if c == '#':
        left_black_num += 1
    elif c == '.':
        left_white_num += 1
    right_white_num = all_white_num - left_white_num
    ans = min(ans, left_black_num + right_white_num)
print(ans)