using System;

namespace IT1_3_D
{
    class Program
    {
        static void Main(string[] args)
        {
            int a, b, c, ans;
            string[] str = Console.ReadLine().Split(' ');
            a = int.Parse(str[0]);
            b = int.Parse(str[1]);
            c = int.Parse(str[2]);

            ans = CountDivisors(b,c) - CountDivisors(a,c) + 1;

            Console.WriteLine("{0}", ans);
        }

        static int CountDivisors(int a, int b)
        {
            int count = 0;
            for(int i = 1;i<=a;i++)
            {
                if ((b % i) == 0)
                    count += 1;
            }
            return count;
        }

    }
}