# -*- coding: utf-8 -*-
import numpy

N = int(input())
S = [int(x) for x in input().replace('#', '1').replace('.', '0')]

b_cumsum = numpy.cumsum(S)
b_total = b_cumsum[-1]

min_count = N
for i in range(N):

    # for white
    w_num = i + 1
    # w_cur = w_num - res[i]
    w_rev_num = b_cumsum[i]  # w_num - w_cur

    # for black
    b_num = N - w_num
    b_cur = b_total - b_cumsum[i]
    min_count = min(min_count, w_rev_num + b_num - b_cur)

print(min_count)