Răspuns:
#include<iostream>
using namespace std;
int main() {
int n,p = 1,putere=0, div=2;
cin >> n;
while (n > 0)
{
p = p * n;
cin >> n;
}
if (p < 3)
return 0;
while (p != 1)
{
if (div > p)
div = 2;
while(p % div == 0) {
p = p / div;
if (div == 3)
putere++;
}
div++;
}
cout << putere;
}