#include <fstream>
#include <vector>

using namespace std;

ifstream input("ntcn.inp");
ofstream output("ntcn.out");

long long GCD(long long a, long long b)
{
	return (b == 0) ? a : GCD(b, a % b);
}

void ntcn(vector<long long> &c, int &total, int a = 0, int b = 1)
{
	if (a != c.size() && b != c.size())
	{
		if (GCD(c[a], c[b]) == 1)
		{
			total++;
		}
	}
	if (b == c.size() - 1)
	{
		ntcn(c, total, a + 1, a + 2);
	}
	else if (a != c.size() && b != c.size())
	{
		ntcn(c, total, a, b + 1);
	}
}

int main()
{
	int n;
	int total = 0;
	input >> n;
	vector <long long> a(n);
	for (int i = 0; i < n; i++)
	{
		input >> a[i];
	}
	ntcn(a, total);
	output << total;
	input.close();
	output.close();
	return 0;
}