{"trustable":false,"sections":[{"title":"","value":{"format":"HTML","content":"\u003cp\u003e\r\n\tOn the planet \u003cspan data-scayt_word\u003d\"Eisiem\" data-scaytid\u003d\"1\"\u003eEisiem\u003c/span\u003e passenger tickets for the new mean of transportation are planned to have the form of \u003cspan data-scayt_word\u003d\"tores\" data-scaytid\u003d\"3\"\u003etores\u003c/span\u003e.\u003cbr /\u003e\r\n\t\u003cbr /\u003e\r\n\tEach tore is made of a single rectangular black rubber sheet containing N \u0026times; M squares. Several squares are marked with white, thus encoding the ticket\u0026#39;s source and destination.\u003cbr /\u003e\r\n\t\u003cbr /\u003e\r\n\tWhen the passenger buys the ticket, the ticket booking machine takes the rubber sheet, marks some squares to identify the route of the passenger, and then provides it to the passenger. The passenger next must glue the ticket.\u003cbr /\u003e\r\n\t\u003cbr /\u003e\r\n\tThe ticket must be clued the following way. First two its sides of greater length are glued together, forming a cylinder. Next cylinder base circles, each of which has the length equal to the length of the short side of the original rubber sheet, are glued together. They must be glued in such a way, that the cells, sides of which are glued, first belonged to the same row of the sheet. Note that the inner and the outer part of the sheet can be distinguished.\u003cbr /\u003e\r\n\t\u003cbr /\u003e\r\n\tThe resulting tore is the valid ticket.\u003cbr /\u003e\r\n\t\u003cbr /\u003e\r\n\tNote that if the original sheet is square, there are two topologically different ways to make a tore out of a rubber sheet.\u003cbr /\u003e\r\n\t\u003cbr /\u003e\r\n\tTicket material is so perfect and gluing quality is so fine, that no one is able to find the seam, and this leads to some problems. First, the same tore can be obtained using different sheets. More of that, the same sheet can lead to \u003cspan data-scayt_word\u003d\"tores\" data-scaytid\u003d\"4\"\u003etores\u003c/span\u003e that look a bit different.\u003cbr /\u003e\r\n\t\u003cbr /\u003e\r\n\tNow the transport companies of \u003cspan data-scayt_word\u003d\"Eisiem\" data-scaytid\u003d\"2\"\u003eEisiem\u003c/span\u003e wonder, how many different routes they can organize, so that the following conditions are satisfied:\u003c/p\u003e\r\n\u003cul\u003e\r\n\t\u003cli\u003e\r\n\t\ttickets for different routes are represented by different \u003cspan data-scayt_word\u003d\"tores\" data-scaytid\u003d\"5\"\u003etores\u003c/span\u003e;\u003c/li\u003e\r\n\t\u003cli\u003e\r\n\t\tif some rubber sheet was marked to make the tore for some route, it cannot be used to make the tore for another route.\u003c/li\u003e\r\n\u003c/ul\u003e\r\n\u003cp\u003e\r\n\tHelp them to calculate the number of routes they can organize.\u003c/p\u003e"}},{"title":"Input","value":{"format":"HTML","content":"\u003cp\u003e\r\n\tThe first line of the input file contains N and M (1 \u0026le; N, M \u0026le; 20).\u003c/p\u003e"}},{"title":"Output","value":{"format":"HTML","content":"\u003cdiv align\u003d\"left\"\u003e\r\n\tOutput the number of routes \u003cspan data-scayt_word\u003d\"Eisiem\" data-scaytid\u003d\"6\"\u003eEisiem\u003c/span\u003e transport companies can organize.\u003c/div\u003e"}},{"title":"Sample Input","value":{"format":"HTML","content":"\u003cp\u003e\r\n\t\u003cfont face\u003d\"Courier New\"\u003eTest #1\u003cbr /\u003e\r\n\t\u003cbr /\u003e\r\n\t2 2\u003cbr /\u003e\r\n\t\u003cbr /\u003e\r\n\tTest #2\u003cbr /\u003e\r\n\t\u003cbr /\u003e\r\n\t2 3 \u003c/font\u003e\u003c/p\u003e"}},{"title":"Sample Output","value":{"format":"HTML","content":"\u003cp\u003e\r\n\t\u003cfont face\u003d\"Courier New\"\u003eTest #1\u003cbr /\u003e\r\n\t\u003cbr /\u003e\r\n\t6\u003cbr /\u003e\r\n\t\u003cbr /\u003e\r\n\tTest #2\u003cbr /\u003e\r\n\t\u003cbr /\u003e\r\n\t13 \u003c/font\u003e\u003c/p\u003e"}}]}