#include <bits/stdc++.h>
using namespace std;
int main(){
	int a,b=0,c=0,d=1;
	cin>>a;
	for(int d=1;d<=a;d++){
		if(d%2==1||d%3==1||d%5==1){
			b=b+1;
			c=c+d;
		}
	}
	cout<<b<<endl<<c;
}
/**************************************************************
	Problem: 1983
	User: toughuatao1
	Language: C++
	Result: Accepted
	Time:14 ms
	Memory:2072 kb
****************************************************************/