{"trustable":true,"sections":[{"title":"","value":{"format":"HTML","content":"\u003cdiv class\u003d\"problem_par\"\u003e\u003cdiv class\u003d\"problem_par_normal\"\u003eA new robot \"PTZ07\" is now in the testing room. The testing room\r\nis a parallelepiped \u003ci\u003en\u003c/i\u003e\u0026nbsp;×\u0026nbsp;\u003ci\u003em\u003c/i\u003e\u0026nbsp;×\u0026nbsp;\u003ci\u003ek\u003c/i\u003e. The robot knows a sequence\r\nof instructions to execute. The instructions are:\r\n\u0027u\u0027\u0026nbsp;— one position up, \u0027d\u0027\u0026nbsp;— one position down,\r\n\u0027l\u0027\u0026nbsp;— one position left, \u0027r\u0027\u0026nbsp;— one position right,\r\n\u0027f\u0027\u0026nbsp;— one position forward, \u0027b\u0027\u0026nbsp;— one position backward.\r\nRobot executes its program one by one. If the instruction\r\ntells the robot to go outside the room, the robot ignores this instruction.\r\n\u003c/div\u003e\u003c/div\u003e\u003cdiv class\u003d\"problem_par\"\u003e\u003cdiv class\u003d\"problem_par_normal\"\u003eYou are given a sequence of instructions, but you don\u0027t know the initial\r\nlocation of the robot. Your task is to find the number of\r\npositions in which the robot may finish its trip.\r\n\u003c/div\u003e\u003c/div\u003e"}},{"title":"Input","value":{"format":"HTML","content":"\u003cdiv class\u003d\"problem_par\"\u003e\u003cdiv class\u003d\"problem_par_normal\"\u003eThe first line of the input contains three integers\r\n\u003ci\u003en\u003c/i\u003e, \u003ci\u003em\u003c/i\u003e and \u003ci\u003ek\u003c/i\u003e (1\u0026nbsp;≤\u0026nbsp;\u003ci\u003en\u003c/i\u003e, \u003ci\u003em\u003c/i\u003e, \u003ci\u003ek\u003c/i\u003e\u0026nbsp;≤\u0026nbsp;10\u003csup\u003e5\u003c/sup\u003e)\u0026nbsp;— \r\nwidth (left-right dimension), height (up-down dimension) and length\r\n(forward-backward dimension). The second line\r\ncontains the sequence of instructions. There will be no more than 10\u003csup\u003e5\u003c/sup\u003e\r\ninstructions.\r\n\r\n\u003c/div\u003e\u003c/div\u003e"}},{"title":"Output","value":{"format":"HTML","content":"\u003cdiv class\u003d\"problem_par\"\u003e\u003cdiv class\u003d\"problem_par_normal\"\u003eOutput the number of positions where robot may finish its trip after\r\nexecuting the given program.\r\n\u003c/div\u003e\u003c/div\u003e"}},{"title":"Sample","value":{"format":"HTML","content":"\u003ctable class\u003d\u0027vjudge_sample\u0027\u003e\n\u003cthead\u003e\n \u003ctr\u003e\n \u003cth\u003eInput\u003c/th\u003e\n \u003cth\u003eOutput\u003c/th\u003e\n \u003c/tr\u003e\n\u003c/thead\u003e\n\u003ctbody\u003e\n \u003ctr\u003e\n \u003ctd\u003e\u003cpre\u003e1 1 1\r\nuuuur\r\n\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003e1\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n\u003cbr\u003e\u003ctable class\u003d\u0027vjudge_sample\u0027\u003e\n\u003cthead\u003e\n \u003ctr\u003e\n \u003cth\u003eInput\u003c/th\u003e\n \u003cth\u003eOutput\u003c/th\u003e\n \u003c/tr\u003e\n\u003c/thead\u003e\n\u003ctbody\u003e\n \u003ctr\u003e\n \u003ctd\u003e\u003cpre\u003e2 2 2\r\nulf\r\n\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003e1\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n\u003cbr\u003e\u003ctable class\u003d\u0027vjudge_sample\u0027\u003e\n\u003cthead\u003e\n \u003ctr\u003e\n \u003cth\u003eInput\u003c/th\u003e\n \u003cth\u003eOutput\u003c/th\u003e\n \u003c/tr\u003e\n\u003c/thead\u003e\n\u003ctbody\u003e\n \u003ctr\u003e\n \u003ctd\u003e\u003cpre\u003e13 14 15\r\nuudlbdrruffbr\r\n\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003e1560\r\n\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n"}}]}