# 今のままだと駄目
N = int(input())
str = input()
minDistance = N
black = "#"
white = "."

for i in range(N):
    distance = 0
    loopnum = 0
    while (distance < minDistance and loopnum < N):

        for j in range(0, i):

            if str[j] == black:
                distance += 1
                loopnum += 1
            else:
                loopnum += 1

        for k in range(i, N):

            if str[k] == white:
                distance += 1
                loopnum += 1
            else:
                loopnum += 1

    if (loopnum == N):
        minDistance = distance

print("{}".format(minDistance))
