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

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

# cumsum for black
res = numpy.cumsum(S)

min_count = N
for i in range(N):

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

    # for black
    b_num = N - w_num
    b_cur = res[-1] - res[i]
    b_rev = b_num - b_cur

    min_count = min(min_count, w_rev + b_rev)

print(min_count)