Inputs are two values 1 <= m , n <= 10^12
i don't know why my code is taking soo long for large values . time limit is 1 sec. please suggest me some critical modifications.

```
#include<iostream>
#include<algorithm>
using namespace std;

int main()
{
unsigned long long m,n,count=0;
cin >> m >> n;  
for (long long int i = 1; i <= ((min(m,n))/2)+1; i++) //i divided min(m,n) by 2 to make it efficient.
{

    if ((m%i == 0) && (n%i == 0))
    {
        count++;
    }

}
if (((n%m == 0) || (m%n == 0)) && (n!=m))
{
    cout << count << endl;
}

printf("%lld",count);  //cout<<count;

system("pause");
return 0;

```

}