#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)

a = 2 * len(Sarraynum)
for i in range(len(Sarraynum)):
    black2white = 0
    white2black = 0
    jmax = len(Sarraynum) - i - 1
    if jmax < i:
        jmax = i

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

        if black2white + white2black >= a:
            break
    
    if black2white + white2black < a:
        a = black2white + white2black


print(a)