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

a=0
b=0

if S.find("#.") != -1:
    for i in S:
        if i == "#":
            a+=1
        else:
            b+=1

    if a>b:
        print(b)
    else:
        print(a)

else:
    print(0)