#include<iostream> #include<vector> using namespace std; vector<int> table; void priTable(); int primeNumber(int); int main() { int n; priTable(); while(cin>>n && n!=0){ int count=0; for(vector<int>::iterator it=table.begin();(*it)<n/2;++it){ int temp=n-(*it); if(primeNumber(temp)){ count++; } } cout<<count<<endl; } return 0; } void priTable(){ for(int i=2;i<10001;++i){ if(primeNumber(i))table.push_back(i); } } int primeNumber(const int num){ for(int i=2;i*i<=num;++i){ if(num%i == 0)return 0; } return 1; }