
def count(s):
    rest = ''
    for i, char in enumerate(s):
        if char == '.':
            continue
        else:
            rest = s[i:]
            break

    b = len(rest.replace('.', ''))
    w = len(rest.replace('#', ''))

    if b > w:
        return w
    else:
        return b


def main():
    _ = int(input())
    s = input()  # '#.#' -> '###'

    print(count(s))


main()
