{"trustable":true,"sections":[{"title":"","value":{"format":"HTML","content":"\u003cspan lang\u003d\"en-us\"\u003e\u003cp\u003eA World Cup of association football is being held with teams from around the world. The standing is based on the number of points won by the teams, and the distribution of points is done the usual way. That is, when a teams wins a match, it receives 3 points; if the match ends in a draw, both teams receive 1 point; and the loser doesn’t receive any points.\u003c/p\u003e\u003cp\u003eGiven the current standing of the teams and the number of teams participating in the World Cup, your task is to determine how many matches ended in a draw till the moment.\u003c/p\u003e\u003c/span\u003e"}},{"title":"Input","value":{"format":"HTML","content":"\u003cspan lang\u003d\"en-us\"\u003e\u003cp\u003eThe input contains several test cases. The first line of a test case contains two integers \u003ci\u003eT\u003c/i\u003e and \u003ci\u003eN\u003c/i\u003e, indicating respectively the number of participating teams (0 ≤ \u003ci\u003eT\u003c/i\u003e ≤ 200) and the number of played matches (0 ≤ \u003ci\u003eN\u003c/i\u003e ≤ 10000). Each one of the \u003ci\u003eT\u003c/i\u003e lines below contains the name of the team (a string of at most 10 letter and digits), followed by a whitespace, then the number of points that the team obtained till the moment. The end of input is indicated by \u003ci\u003eT\u003c/i\u003e \u003d 0.\u003c/p\u003e\u003c/span\u003e"}},{"title":"Output","value":{"format":"HTML","content":"\u003cp\u003eFor each one of the test cases, your program should print a single line containing an integer, representing the quantity of matches that ended in a draw till the moment.\u003c/p\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\u003e3 3\r\nBrasil 3\r\nAustralia 3\r\nCroacia 3\r\n3 3\r\nBrasil 5\r\nJapao 1\r\nAustralia 1\r\n0 0\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003e0\r\n2\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n"}}]}