N = int(input())
S = list(input())

white = 0
bcount = 0
wcount = 0
mins = []

for i in range(N):
    if S[i] == ".":
        white += 1

mins.append(white)
        
for i in range(N):
    for j in range(N):
        if (j <= i and S[j] == '#'):
            bcount += 1
        elif (i < j and S[j] == '.'):
            wcount += 1
    mins.append(bcount + wcount)
    bcount = 0
    wcount = 0

print(min(mins))
