Read the flowchart on the right and run the corresponding program. The output value of S is (A) $-10$ (B) 6 (C) 14 (D) 18