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