def pro():
    _, s = input(), [s for s in input()]
    if "#" not in s:
        return print(0)
    elif "." not in s:
        return print(0)

    s = s[s.index("#"):]

    back = 0
    for i in range(1, len(s)+1):
        if s[-i] == "#":
            back += 1
        else:
            break
            
    s = s[:-back]
    a = s.count(".")
    b = len(s) - a

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

pro()