{"trustable":true,"sections":[{"title":"","value":{"format":"HTML","content":"Rain has pummeled the cows\u0027 field, a rectangular grid of R rows and C columns (1 \u0026lt;\u003d R \u0026lt;\u003d 50, 1 \u0026lt;\u003d C \u0026lt;\u003d 50). While good for the grass, the rain makes some patches of bare earth quite muddy. The cows, being meticulous grazers, don\u0027t want to get their hooves dirty while they eat.\r\u003cbr\u003e\r\u003cbr\u003eTo prevent those muddy hooves, Farmer John will place a number of wooden boards over the muddy parts of the cows\u0027 field. Each of the boards is 1 unit wide, and can be any length long. Each board must be aligned parallel to one of the sides of the field.\r\u003cbr\u003e\r\u003cbr\u003eFarmer John wishes to minimize the number of boards needed to cover the muddy spots, some of which might require more than one board to cover. The boards may not cover any grass and deprive the cows of grazing area but they can overlap each other.\r\u003cbr\u003e\r\u003cbr\u003eCompute the minimum number of boards FJ requires to cover all the mud in the field."}},{"title":"Input","value":{"format":"HTML","content":"* Line 1: Two space-separated integers: R and C\r\u003cbr\u003e\r\u003cbr\u003e* Lines 2..R+1: Each line contains a string of C characters, with \u0027*\u0027 representing a muddy patch, and \u0027.\u0027 representing a grassy patch. No spaces are present."}},{"title":"Output","value":{"format":"HTML","content":"* Line 1: A single integer representing the number of boards FJ needs."}},{"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\u003e4 4\r\n*.*.\r\n.***\r\n***.\r\n..*.\r\n\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003e4\r\n\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n"}},{"title":"Hint","value":{"format":"HTML","content":"OUTPUT DETAILS:\r\u003cbr\u003e\r\u003cbr\u003eBoards 1, 2, 3 and 4 are placed as follows:\r\u003cbr\u003e1.2.\r\u003cbr\u003e.333\r\u003cbr\u003e444.\r\u003cbr\u003e..2.\r\u003cbr\u003eBoard 2 overlaps boards 3 and 4."}}]}