#include<stdio.h>
      
int main(void){
      
int a,b,c,i,j;
int n=0;
scanf("%d %d %d",&a,&b,&c);

for(i=a;i<=b;i++){
 for(j=2;j<=c;j++){
 if(i%j==0&&c%j==0){
  n++
  break;
  }
 }
}

printf("%d",n);
 
return 0;
}
