// PascalABC.NET
begin
var (n, m) := ReadInteger2;
var a := ReadMatrInteger(n, m);
var k := ReadInteger;
a.ElementsByRow.Count(p -> p = k).Print
end.
// PascalABC.NET
begin
var (n, m) := ReadInteger2;
var a := ReadMatrInteger(n, m);
var k := ReadInteger;
a.ElementsByRow.Count(p -> p = k).Print
end.