def pro():
    _, s = input(), [s for s in input()]
    if "#" not in s:
        return print(0)
    s = s[s.index("#"):]
    for i in range(len(s)):
        if s[-1] == "#":
            s = s[:-1]
        else:
            break
    a = s.count(".")
    b = len(s) - a
    if a > b:
        return print(b)
    else:
        return print(a)
pro()