n = int(input())
s = list(input())

if n == 1:
    print(0)
else:
    siro = s.count(".")
    if s[0] == ".":
        siro -=1
    
    kuro = n-siro
    if s[-1] == "#":
        kuro -=1

    mini = min(siro,kuro)

    
    print(mini)