n = int(input()) S = input() ans = -1 for i, s in enumerate(S[::-1], 1): if s == "#": ans = max(ans + 2, i) print(ans)