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

countW = 0
countB = 0
flag = False

for s in S:
    if s == "#":
        countB += 1
    if not flag:
        if s == "#":
            flag = True
    else:
        if s == ".":
            countW += 1
if S[-1] == "#":
    countB -= 1
if countB > countW:
    print(countW)
else:
    print(countB)