#include<iostream> short n,ans; int main(){ scanf("%hd",&n); for(short i=0;i<n;i++) for(short j=0;j<n;j++) if(!((i+j)%3)||!((i+j)%7)) ans++; printf("%hd",ans/2); return 0; }