import sys
import re

input = sys.stdin.readline


def main():
    n = input()
    s = input().strip()
    print(sum([max([m.count("#"), m.count(".")]) for m in re.findall(r"#+\.+", s)]))


if __name__ == "__main__":
    main()
