"use strict";
const p = (s) => console.log(s);

function main(input) {
  let N = input[0].split(" ")[0];
  input.splice(0, 1);
  let result = input.filter(function (x, i, self) {
    return self.indexOf(x) === i;
  });
  p(result.length);
}
main(require("fs").readFileSync("/dev/stdin", "utf8").trim().split("\n"));
