#https://atcoder.jp/contests/tenka1-2019-beginner/tasks/tenka1_2019_c

N = int(input())
S = str(input())
Sarray = list(S)
Sarraynum = []

#白0
for i in range(len(Sarray)):
    if Sarray[i] == '.':
        Sarraynum.append(0)
    else:
        Sarraynum.append(1)

white2black = len(Sarraynum)
black2white = len(Sarraynum)
for i in range(len(Sarraynum)):
    black2whiteTMP = 0
    white2blackTMP = len(Sarraynum) - i - 1
    for j in range(i):
        black2whiteTMP += Sarraynum[j]
    for j in range(i + 1, len(Sarraynum)):
            white2blackTMP -= Sarraynum[j]
    if black2whiteTMP + white2blackTMP < white2black + black2white:
        white2black = white2blackTMP
        black2white = black2whiteTMP


print(white2black + black2white)