// ConsoleApplication5.cpp : 定义控制台应用程序的入口点。
//
#include<vector>
#include<algorithm>
#include<functional>
#include<iostream>
using namespace std;
// ConsoleApplication5.cpp : 定义控制台应用程序的入口点。
//
#include<vector>
#include<algorithm>
#include<functional>
#include<iostream>
using namespace std;
int main()
{
int minSize, maxSize;
int n;
while (cin >> minSize >> maxSize >> n)
{
vector<int> fishSize;
int num = 0;
for (int i = 0; i < n; i++)
{
int fish;
cin >> fish;
fishSize.push_back(fish);
}
for (int i = minSize; i <= maxSize; i++)
{
bool flag = true;
for (int j = 0; j < fishSize.size(); j++)
{
if ((fishSize[j]) / i >= 2 && (fishSize[j]) / i <= 10)
{
if ((fishSize[j]) / i == 10 && (fishSize[j]) % i!=0)
{
// break;
continue;
}
flag = false;
break;
}
if ( i/fishSize[j] >= 2 && i/fishSize[j]<= 10)
{
if (i / fishSize[j] == 10 && i % fishSize[j]!= 0)
{
// break;
continue;
}
flag = false;
break;
}
}
if (flag == true)
{
num++;
// cout << i << endl;
// fishSize.push_back(i);
}
}
cout << num << endl;
}
return 0;
}