N = int(input()) S = input() S = S[::-1] ans = -10101010 for i in range(N): if S[i] == '#': x = i + 1; y = ans + 2 ans = max(x, y) print(ans)