n = int(input())
listS=list(input())
count=0
index=0
bef=0
while index < len(listS):
    if index == 0:
        bef = listS[index]
    else:
        if bef == "#":
            if listS[index] == ".":
                count+=1
        bef = listS[index]
    index+=1
print(min(count, n-count))
    