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

# 石リスト：黒→白→黒→白……→白の個数の配列
stonelist = []

if S[0] == ".":
    stonelist.append(0)

lastisblack = True

count = 0

for c in S:
    if (lastisblack == False and c == "." ) or \
        (lastisblack == True and c == "#"):
        count += 1
    else:
        stonelist.append(count)
        count = 1
        lastisblack = not lastisblack

stonelist.append(count)

# 右が必ず白で終わるようにする
if S[-1] == "#":
    stonelist.append(0)

ans = N

for i in range(0,len(stonelist)+1):
    cnt = 0
    printwhite = 0
    printblack = 0
    while  cnt < i:
        if cnt % 2 == 0:
            printwhite += stonelist[cnt]
        cnt += 1
    while cnt < len(stonelist):
        if cnt % 2 == 1:
            printblack += stonelist[cnt]
        cnt += 1

    ans = min(ans,(printblack + printwhite))

print(ans)