#include <bits/stdc++.h>
using namespace std;
int main(){
	int a,k=0,l=0,j;
	cin>>a;
	for(j=1;j<=a;j++){
		if(j%2==1||j%3==1||j%5==1){
			k=k+j;
			l=l+1;
		}
	}cout<<l<<endl<<k;
}

/**************************************************************
	Problem: 1983
	User: tonghuawei
	Language: C++
	Result: Accepted
	Time:14 ms
	Memory:2072 kb
****************************************************************/