#include <stdio.h>
#define range(X) (1 <= X && X <=10000)

int main(void){
    int a, b, c, a_c=0,b_c=0, i;
    scanf_s("%d %d %d",&a,&b,&c);
    if (a <= b){
    for (i = 1; i < c; i++){
        if (i+1 == b)break;
        if(a % i+1 == 0)a_c++;
        if (b % i+1 == 0)b_c++;
        }
    printf("%d\n",a_c + b_c);
    }
    return 0;
}