import sys
#input = sys.stdin.buffer.readline

def main():
    N = int(input())
    s = input()
    _s = "".join(list(reversed(s)))
    if "#" not in s:
        print(0)
    else:
        sind = s.index("#")
        dind = _s.index(".")
        use = s[sind:(N-dind)]
        print(min(use.count("."),use.count("#")))

if __name__ == "__main__":
    main()