N = int(input())
stones = input()

w_cnt = stones.count('.')
b_cnt = N-w_cnt
first_bi = max(0, stones.find('#'))
last_wi = max(0, stones.rfind('.'))
pw_cnt = stones[first_bi:].count('.')
pb_cnt = stones[:last_wi].count('#')

print(min(w_cnt, b_cnt, pw_cnt, pb_cnt))