'use strict';
(function(stdin) {

  var inputs  = stdin.toString().split('\n');
  var cols = inputs[0].split(' ').map(Number);
  var result = (function(numbers, diviser) {

    var isDivisable = (function(diviser) {
      return function(n) {
        return diviser % n === 0;
      };
    })(diviser);

    return numbers.filter(function(v) {
      return isDivisable(v);
    }).length;

  })(range(cols[0], cols[1]), cols[2]);

  console.log(result);

  function range(n, m) {
    var array = [];
    for (var i = n; i < m + 1; i++) {
      array.push(i);
    }
    return array;
  }

}(require('fs').readFileSync('/dev/stdin', 'utf8')));