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

def main():
    N = int(input())
    s = input()
    if "#" not in s:
        print(0)
    else:
        index = s.index("#")
        use = s[index:]
        print(len(use)-use.count("#"))

if __name__ == "__main__":
    main()