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

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

res = numpy.cumsum(S)

min_count = N
for idx in range(N):
    # white
    white_num = idx + 1
    w_count = res[idx]

    # black
    black_num = N - white_num
    black_current = res[-1] - res[idx]
    b_count = black_num - black_current
    min_count = min(min_count, w_count + b_count)

print(min_count)