import re
N = int(input())
S = input()
S = re.sub("(?<=\.)#+$", "", S)
S = re.sub("^\.+(?=#)", "", S)
if len(S) == 0:
    print("0")
else:
    n_white = S.count(".")
    n_black = S.count("#")
    print(min(n_white, n_black))