a = int(input())
ar = list(input())
wh = 0
bl = 0
go = "OFF"
for r in ar:
    if go == "ON":
        if r == "#":
            bl += 1
        else:
            wh += 1
    else:
        if r == "#":
            go = "ON"
            bl += 1
print(min(wh,bl))
    