n = int(input()) s = input()[::-1] last = -2 for i, c in enumerate(s): if c == '#': last = max(i, last + 2) print(last + 1)