semeru/Code-Code-CloneDetection-POJ104 huggingface dataset:
int main()
{
int n;
cin>>n;
switch (n)
{




case 1: cout<<"1"; break;
case 2: cout<<"5"; break;
case 3: cout<<"14"; break;
case 4: cout<<"30"; break;
case 5: cout<<"55"; break;
case 6: cout<<"91"; break;
case 7: cout<<"91"; break;
case 8: cout<<"155"; break;
case 9: cout<<"236"; break;
case 10: cout<<"336"; break;
case 11: cout<<"457"; break;
case 12: cout<<"601"; break;
case 13: cout<<"770"; break;
case 14: cout<<"770"; break;
case 15: cout<<"995"; break;
case 16: cout<<"1251"; break;
case 17: cout<<"1251"; break;
case 18: cout<<"1575"; break;
case 19: cout<<"1936"; break;
case 20: cout<<"2336"; break;
case 21: cout<<"2336"; break;
case 22: cout<<"2820"; break;
case 23: cout<<"3349"; break;
case 24: cout<<"3925"; break;
case 25: cout<<"4550"; break;
case 26: cout<<"5226"; break;
case 27: cout<<"5226"; break;
case 28: cout<<"5226"; break;
case 29: cout<<"6067"; break;
case 30: cout<<"6967"; break;
case 31: cout<<"7928"; break;
case 32: cout<<"8952"; break;
case 33: cout<<"10041"; break;
case 34: cout<<"11197"; break;
case 35: cout<<"11197"; break;
case 36: cout<<"12493"; break;
case 37: cout<<"12493"; break;
case 38: cout<<"13937"; break;
case 39: cout<<"15458"; break;
case 40: cout<<"17058"; break;
case 41: cout<<"18739"; break;
case 42: cout<<"18739"; break;
case 43: cout<<"20588"; break;
case 44: cout<<"22524"; break;
case 45: cout<<"24549"; break;
case 46: cout<<"26665"; break;
case 47: cout<<"26665"; break;
case 48: cout<<"28969"; break;
case 49: cout<<"28969"; break;
case 50: cout<<"31469"; break;
case 51: cout<<"34070"; break;
case 52: cout<<"36774"; break;
case 53: cout<<"39583"; break;
case 54: cout<<"42499"; break;
case 55: cout<<"45524"; break;
case 56: cout<<"45524"; break;
case 57: cout<<"45524"; break;
case 58: cout<<"48888"; break;
case 59: cout<<"52369"; break;
case 60: cout<<"55969"; break;
case 61: cout<<"59690"; break;
case 62: cout<<"63534"; break;
case 63: cout<<"63534"; break;
case 64: cout<<"67630"; break;
case 65: cout<<"71855"; break;
case 66: cout<<"76211"; break;
case 67: cout<<"76211"; break;
case 68: cout<<"80835"; break;
case 69: cout<<"85596"; break;
case 70: cout<<"85596"; break;
case 71: cout<<"85596"; break;
case 72: cout<<"85596"; break;
case 73: cout<<"85596"; break;
case 74: cout<<"85596"; break;
case 75: cout<<"85596"; break;
case 76: cout<<"85596"; break;
case 77: cout<<"85596"; break;
case 78: cout<<"85596"; break;
case 79: cout<<"85596"; break;
case 80: cout<<"91996"; break;
case 81: cout<<"98557"; break;
case 82: cout<<"105281"; break;
case 83: cout<<"112170"; break;
case 84: cout<<"112170"; break;
case 85: cout<<"119395"; break;
case 86: cout<<"126791"; break;
case 87: cout<<"126791"; break;
case 88: cout<<"134535"; break;
case 89: cout<<"142456"; break;
case 90: cout<<"150556"; break;
case 91: cout<<"150556"; break;
case 92: cout<<"159020"; break;
case 93: cout<<"167669"; break;
case 94: cout<<"176505"; break;
case 95: cout<<"185530"; break;
case 96: cout<<"194746"; break;
case 97: cout<<"194746"; break;
case 98: cout<<"194746"; break;
case 99: cout<<"204547"; break;

default : break;
}
return 0;
}
int main()
{
	int n ,i ,sum ;
	scanf("%d",&n);
	sum = 0 ;
	if (n<70){
		for (i=1 ; i<=n;i++){
			if (((i-7)%10!=0)&&((i%7)!=0)){
				sum += i*i;
			}
			
		}
	}
	else if ((n>=70)&&(n<80)){
		int m = 69;
		for (i=1 ; i<=m;i++){
			if (((i-7)%10!=0)&&((i%7)!=0)){
				sum += i*i;
			}
			
		}
	}
	else if (n>=80){
		//printf("n=%d\n",n);
		int m = 69;
		for (i=1; i<=m;i++){
			if (((i-7)%10!=0)&&((i%7)!=0)){
				//printf("69for i=%d\n",i);
				sum += i*i;
			}
			
		}
		for (i=80;i<=n ;i++){
			if (((i-7)%10!=0)&&((i%7)!=0)){
				//printf("80for i=%d\n",i);
				sum += i*i;
			}
		}
		/*
		for (i=80;i<=n ;i++){
		if (((n-7)%10!=0)&&(((i-70)>9)||((i-70)<0))){
		sum += i*i ;
		}
	}*/
	}
	
	
	printf("%d",sum);
	return 0;
}
//
//  main.cpp
//  ?7???????
//
//  Created by ? ?? on 12-10-8.
//  Copyright (c) 2012? ? ??. All rights reserved.
//


int main()
{
    int n;
    cin >> n;
    
    int a , b , c , sum = 0 , k;
    
    for (int i=1; i<=n; i++)
    {
        //sum=0;
        
        a=i/10;
        b=i%10;
        //c=i-100*a-10*b;
        
        if (i%7!=0&&a!=7&&b!=7)
        {
            sum += i * i;
        }
        
        //k=k+sum;
    }
    cout << sum <<endl;
    
    return 0;
    
    
}
int main()
{
	int n,x,y,z;
	int sum = 0; 

	scanf("%d",&n);
	int i = n;
	while(i>0)
	{
		x = i%7;
	        y = i/10;
		z = i%10;
		
		if (x==0||y==7||z==7){
                            i--;
			continue;
}
		sum = sum + i*i;
		i--;
	}
	printf("%d",sum);
    return 0;
}
int main()
{
    int sum=0;
    int s=0;
    int n;
	scanf("%d",&n);
    for(int i=1;i<=n;i++){
		s=s+i*i;
        if(i%7==0){
		   sum=sum+i*i;
		}
		else if(i%10==7){
			    sum=sum+i*i;
		}
        else if(i>70&&i<80){
                sum=sum+i*i;
        }
    }
	s=s-sum;
    printf("%d\n",s);
	return 0;
}
int yuqiwuguan(int number){
	if(number%7==0){
		return 0;}
	for(int num=number;num>0;num=num/10){
		if(num%10==7){
			return 0;
		}
		
	}
	return 1;
}

int main(){
	int i,sum,n;
	sum=0;
	scanf ("%d",&n);
	for(i=1;i<=n;i++){
		if (yuqiwuguan(i)){
			sum=sum+i*i;
		}
	}
	printf("%d",sum);
	return 0;
}
int main()
{
	int f,i,num,sum=0;
	scanf("%d",&num);
	for(i=1;i<=num;i++)
	{
		if(i%7==0)
		{
			f=0;
		}
		else if(i%10==7)
		{
			f=0;
		}
		else if(i/10==7)
		{
			f=0;
		}
		else
		{
			f=i;
		}
		sum+=f*f;
	}
	printf("%d\n",sum);
	return 0;
}
int main()
{
	int n=0,i=0,a=0,b=0,sum=0;//a?????,b?????
	cin>>n;
	for(i=1;i<=n;i++)
	{
		a=i%10;
		b=i/10;
		if(i%7!=0 && a!=7 && b!=7)
			sum=sum+i*i;
	}
	cout<<sum<<endl;
	return 0;
}
int main()
{
	int n,i,s;
	s = 0;
	scanf("%d",&n);
	for(i=1;i<=n;i++)
	{
		if(i%7==0)
		{
			s = s;
		}
		else if(i%10==7)
		{
			s = s;
		}
		else if(i/10==7)
		{
			s = s;
		}
		else
		{
			s+=i*i;
		}
	}
	printf("%d",s);
	return 0;
}
/*
 * ?The number has no relative to seven?.cpp
 *
 *  Created on: 2010-11-4
 *      Author: acer
 */

int main()
{
	int Num,i,Sum=0;
	cin>>Num;
	int exam(int Num);					//??????

	for(i=0;i<=Num;i++)					//????
		if(exam(i))
			Sum+=i*i;					//????
	cout<<Sum;
	return 0;
}

int exam(int Num)						//????
{
	if(((Num%10)==7)||(((Num-Num%10)/10)==7)||(Num%7==0))
		return 0;						//??7???7?????0  ????1
	else return 1;
}
//?7???????
int main()
{
	int n,i,a[100],sum=0;
	cin>>n;//????
	for(i=0;i<n;i++) 
		{a[i]=i+1;//??????
		if (a[i]%7!=0&&a[i]%10!=7)
			{if(a[i]<70||a[i]>79) sum=sum+pow((float)a[i],2);//??????????
			}
		}
	cout<<sum<<endl;
	return 0;
}
int main()
{
	int a[100],sum=0,i,n;
	scanf("%d",&n);
	for(i=1;i<=n;i++)
	{
		a[i]=i;
		if(i%7==0||i%10==7||i>=70&&i<=79)
		{
			a[i]=0;
		}
		if(a[i]!=0)
		{
			sum+=a[i]*a[i];
		}
	}
	printf("%d",sum);
	return 0;
}
int main(){
int n,m;
int result=0;
scanf("%d",&n);
for(int i=0;i<=n;i++){
	m=i%7;
	
if(i!=7&&i!=17&&i!=27&&i!=37&&i!=47&&i!=57&&i!=67&&i!=71&&i!=72&&i!=73&&i!=74&&i!=75&&i!=76
   &&i!=78&&i!=79&&i!=87&&i!=97&&m!=0){
result+=i*i;}
}
printf("%d",result);
return 0;
}
int main()
{
	int n,i,S,f,k,r;
	S=0;
	f=0;
	scanf("%d",&n);
	for(i=0;i<n+1;i++){
		if(i%7==0||(i-7)%10==0||i/10==7){
		S+=i*i;}
	}
	for(k=0;k<n+1;k++){
	f+=k*k;
	}
	r=f-S;
	printf("%d",r);
	return 0;
}
int main()
{
	int n,sum=0;
	scanf("%d",&n);
	int i=1;
	for(i=1;i<=n;i++)
		if(i%7==0||i%10==7||i==71||i==72||i==73||i==74||i==75||i==76||i==78||i==78||i==79)
			sum=sum;
		else
        sum=sum+i*i;
	printf("%d",sum);
	return 0;
}
main()
{
	int n,i,a,b,sum=0;
	scanf("%d",&n);
	for (i=1;i<=n;i++)
	{
		a=i%10;
		b=(i-a)/10;
		if(a==7||b==7);
		else if (i%7==0);
		else
			sum=sum+i*i;
	}
	printf("%d",sum);
	return 0;
}
int wu(int n)
{
    if((n%7==0)||(n%10==7)||(n/10==7))
        return 0;
    else
        return 1;
}
int main()
{
    int i,n,sum=0;
    scanf("%d",&n);
    for(i=1;i<=n;i++)
    {
       if(wu(i))
           sum+=i*i;
    }
    printf("%d\n",sum);
}
int main()
{
	int n,a,b,i;
	int sum=0;
	scanf("%d",&n);
	if (n<10)
	{
		for(i=0;i<=n;i++)
		if(i%7!=0)
			sum=sum+i*i;
    printf("%d",sum);
    }
	else
    {
		for(i=0;i<=n;i++)
		if(i%7!=0)
		{
			a=i/10;
		    b=i-a*10;
			if(a!=7 && b!=7)
        
				sum=sum+i*i;
		}
	          printf("%d",sum);
	}
	return 0;
}
/**
*@file 3.cpp
*@author ???
*@date 2013-10-10
*@description ?7???????
*/

int main() 
{
    int n,i,sum;
    cin >> n;
    i=1;
    sum=0;
 while(i<=n)
 {
    if(i%10!=7&&i%7!=0&&i/10!=7)
    {
        sum+=i * i;
     }
    i++;
 }
    cout << sum << endl;
    return 0;
}
int main (){
    int a,b,c;
	int n;
    c=0;
	scanf("%d",&n);
	for(a=0;10*a<=n;a++)
	{
		for(b=0;b<=9&&(10*a+b)<=n;b++)
		{
			if(a!=7&&b!=7&&(10*a+b)%7!=0)
			{
                c+=((10*a+b)*(10*a+b));
			}
		}
	}
	printf("%d",c);
	return 0;
}
int main()
{
    int n,i=1,j,sum=0,t=10;
    cin>>n;
    for(i=1;i<=n;i++)
    {if(i%7==0)
         ;
     else
	     {if(i%10==7)
             ;
          else
             {j=i/t;
	         if(j%10==7)
                 ;
             else
                 sum=sum+i*i;
              }
	      }
    }
    cout<<sum<<endl;
    return 0;
}
/*
 * qizhonglianxi_5.cpp
 *????7???????
 *  Created on: 2010-11-15
 *      Author: ??
 */

int main(){
	int a[100],i,n,s=0;
	cin>>n;
	for(i=0;i<n;i++)
		{a[i]=i+1;
		 if(a[i]%7==0) a[i]=0;
		 else
		  {if((a[i]==7)||(a[i]==17)||(a[i]==27)||(a[i]==37)||(a[i]==47)||(a[i]==57)||(a[i]==67)||(a[i]==77)||(a[i]==87)||(a[i]==97)||(a[i]==70)||(a[i]==71)||
				  (a[i]==72)||(a[i]==73)||(a[i]==74)||(a[i]==75)||(a[i]==76)||(a[i]==78)||(a[i]==79))
		   a[i]=0;}
		 s=s+a[i]*a[i];
		}
cout<<s<<endl;
return 0;
}
int seven(int n)
{
	int i, s= 0;
	for (i = 1; i <= n; i++)
	{
		if (i % 10 != 7 && i / 10 != 7 && i % 7 != 0)
		{
			s += i * i;
		}
	}
	return s;
}

int main()
{
	int n;
	cin >> n;
	cout << seven(n) << endl;
	return 0;
}
int qi(int num)
{
	int a,b;
	a=num/10;
	b=num-10*a;
	if(num%7==0)
		return 1;
		else if(a==7||b==7)
			return 1;
		else 
			return 0;
}
int main()
{
	int n;
	int sum=0;
	int i;
	scanf("%d",&n);
	for(i=1;i<=n;i++)
		if(qi(i)==0)
			sum=sum+i*i;
		printf("%d\n",sum);
return 0;
}
int main()
{
	int n;
	cin >> n;
	int sum = 0;
	int a;
	for(a = 1; a <= n; a++)
	{
		if(a == 17 || a == 27 || a == 37 || a == 47 || a == 57 || a == 67 || a == 87 || a == 97 || a == 7)
		{
			;
		}
		else if(a >= 70 && a < 80)
		{
			;
		}
		else if(a % 7 == 0)
		{
			;
		}
		else
		{
			sum = sum + a * a;
		}
	}
	cout << sum << endl;
}
int main()
{
	int n, a, s;                                          //????n??a,????????s

	a = 1;                                                //a?????????????1

	s = 0;                                                //s?????0

	cin >> n;                                             //??n

	for (int p=1; p <= n; p++)                            //????

	{
		if (a%7 != 0 && (a-7)%10 != 0 && (a/10) != 7 )    //??a???7????

		{
			s = s + a * a;                                //?????

		}

		a = a + 1;                                        
	}

	cout << s << endl;                                    //?????

	return 0;
}
/**
* @file homework.cpp
* @author ???
* @date 2011-10-01
* @description
* ??????: ?7???????
*/
int main()
{
	int n, i, s=0;
	cin>>n;
	if(0<n<100)
	{
	    for(i=1;i<=n;i++)
		{
			if((i%7==0)||(i%10==7)||(i/10==7)) {s=s;}
			else {s=s+i*i;}
		}
	}
	else cout<<"error"<<endl;
	cout<<s<<endl;
return 0;
}
int main()
{
	int n,i,a,sam;
	sam=0;
	scanf("%d",&n);
	for(i=1;i<=n;i++)
	{
		if(i%7==0)
			sam=sam;
		else
		{
			if(i<10)
			{
				if(i!=7)
					sam=sam+i*i;
				else
					sam=sam;
			}
			else
			{   if(i/10==7)
			     sam=sam;
			    else
				{
					a=i%10;
				    if(a==7)
					sam=sam;
				    else
					sam=sam+i*i;
				}
			}
		}
		
	}
	printf("%d",sam);
	return 0;
}
int main()
{
	int n,m[100],i,sum=0,k,a,b,c;
	scanf("%d",&n);
	for(i=1;i<=n;i++)
	{  
		k=i;
		m[i]=k;
		if(k%7==0)
			m[i]=0;
		else
		{a=k%10;
		b=(k/10)%10;
		c=(k/100)%10;
		if(a!=7&&b!=7&&c!=7)
			m[i]=k;
		else m[i]=0;}
		sum=sum+m[i]*m[i];
	}printf("%d",sum);
	
	
	
}
int main()
{
	int n, i, ans=0;
	char s[4];
	cin >> n;
	for (i=1; i<=n; i++)
	{
		sprintf(s,"%d",i);
		if ((s[0]!='7')&&(s[1]!='7')&&(s[2]!='7')&&(s[3]!='7')&&(i%7!=0))
			ans+=i*i;
	}
	cout << ans << endl;
	return 0;
}
int main()
{
	int n, i, b;
	int sum=0;
	scanf("%d", &n);
	for (i=1; i<=n; i++)
	{
		b=i/10;
		if(i%7==0||b==7||i-10*b==7)
		{
			continue;
		}
		sum += i*i;
	}
	printf("%d", sum);
	return 0;
}
int main()
{

	int n,a,i;
	a=0;
	i=0;
	scanf("%d",&n);

	while(i<n){
		i++;
		
		if((i%7==0)||(i/10==7)||(i-(i/10)*10==7))
		continue;
            a+=i*i;
		
	}
	

	printf("%d",a);
	return 0;
}
void main()
{
int n,i,s=0,a;
scanf("%d",&n);
for(i=1;i<=n;i++)
 {if(i%7!=0)
     if(i%10!=7)
         if(i/10%10!=7) s=s+i*i;
 }
printf("%d",s);
}
int main()
{
	int n,s=0;
	scanf("%d",&n);
	while(n>0){
		if((n%7!=0)&&(n%10!=7)&&(n-n%10!=70)){
		s=s+n*n;
		}
		n=n-1;
	}
	printf("%d",s);
	return 0;
}
int main()
{
    int n,i,j,k,sum=0,a,b;
    scanf("%d",&n);
    for(i=1;i<=n;i++)
    {      
           a=i/10;
           b=i-a*10;
           if((a!=7)&&(b!=7)&&(i%7!=0))
           sum=sum+i*i;
    }
    printf("%d",sum);
    scanf("%d",&n);
    return 0;
}
int main()
{
  int n,s=0,i=1;
  scanf("%d",&n);
  for  (i=1;i<=n;i++)
   { if (i%7==0)
      continue;
    else if ((i-7)%10==0)
      continue;
    else if (i==71)
      continue;
    else if (i==72)
      continue;
    else if (i==73)
      continue;
    else if (i==74)
      continue;
    else if (i==75)
      continue;
    else if (i==76)
      continue;
    else if (i==77)
      continue;
    else if (i==78)
      continue;
    else if (i==79)
      continue;
    else s=s+i*i;
   }
   printf("%d\n",s);
   return 0;
}
int main()
{
	int n,i,sum=0;
	scanf("%d",&n);
         for(i=0;i<=n;i++){
              sum=sum+i*i;
         }  
	for(i=0;i<=n;i++){
		if(i%7==0)
			sum=sum-i*i;
		    
                      
		else if(i%10==7)
			sum=sum-i*i;
		    
                      
        else if((i-(i%10))==70)
		    sum=sum-i*i;
	}
	printf("%d",sum);
	return 0;
}
int main()
{
  int i, n, sum;
  scanf("%d", &n);
  sum = 0;
  for(i = 1; i <= n; i++){
  if(i % 7 == 0 || (i % 10 != 0) && (i % 10) % 7 == 0 || (i >= 11) && (int)(i / 10) % 7 == 0)
     continue;
  else
      sum += i*i;
    }
printf("%d", sum);
return 0;
}
int yu7WuGuan(int number){
		if(number%7 == 0){
			return 0;
		}
		for(int num = number; num > 0; num /= 10){
			if (num%10 == 7){
				return 0;
			}
		}
		return 1;
	}


int main(){
		int num, result = 0;
		scanf("%d", &num);

		for(int i = 1; i <= num; i++){
			if(yu7WuGuan(i)){
				result += i*i;
			}
		}

		printf("%d", result);
		return 0;
}
int main()
{
	int  i,j,n,sum=0;
	
	cin>>n;
	if(n>=10)
	{for(i=1;i<10;i++)
	{
     for(j=0;(j<10)&&(10*i+j)<=n;j++)
		 if((10*i+j)%7!=0&&i!=7&&j!=7)
			 sum+=(10*i+j)*(10*i+j);

     }sum+=236;
	}
	else 
	{
	for(j=0;(j<10)&&j<=n;j++)
		if(j%7!=0)
	     sum+=j*j;
	
	}
	


	cout<<sum;
	return 0;
}
int main()
{
	int n,a;
	int i=1;
	int result=0;
	scanf("%d",&n);
	while(i<=n){
		a=(i/10)%10;
		if((!(i%7==0))&&(!(i%10==7))&&(!(a==7))){
			result+=i*i;
		}
		i++;
	}
	printf("%d\n",result);
	return 0;
}
int main()
{
    int n,f,i,j,b=0,c=0,m=0;
	int s[100];
	for(f=0;f<100;f++)
	{s[f]=0;}
	scanf("%d",&n);
	for(i=1;i<=n;i++)
	{b=i/10;
     c=i-b*10;
	 if(b!=7&&c!=7&&i%7 != 0)
	   s[i]=i;
	 
	}

	for(j=1;j<=n;j++)
	{m=m+s[j]*s[j];
	}
	printf("%d",m);
	return 0;
}
int main()
{
	int n;
	int sum=0;
	int i=1;
	scanf("%d",&n);
	while(i<=n){
		if(i%7!=0&&((int)(i/10)-7)%10!=0&&(i-7)%10!=0&&i!=7){
			sum=i*i+sum;
		}
		i++;
	}
	printf("%d",sum);
	return 0;
}
/*
int cmp(const void *a,const void *b)
{
    return ((int*)a)->w-((int*)b)->w;
}


int main()
{  
	
	
	string str[2];
	string temp;

	cin>>str[1]>>str[0];
	for(int k=str[0].length();k>=0;k--)
		for(int m=0;m<=str[0].length()-k;m++){
	
		temp=str[0].substr(m,k);
		int loc=0;
		
		if(str[1].find(temp)!=-1){
			cout<<temp.length()<<endl;
			return 0;
		}
	}
	return 0;
}

string s1,s2;
int m[100001];
void work() 
{ 
  int l1,l2;
  int i,j; 
  int max=0;
  cin>>s1>>s2;
  l1=s1.length(); 
  l2=s2.length(); 
  for(j=0;j<l2;j++) 
    m[j]=(s1[0]==s2[j]); 
   
  for(i=1;i<l1;i++){
    for(j=l2-1;j>0;j--) 
      if(s1[i]==s2[j]) 
        m[j]=m[j-1]+1; 
       else m[j]=0;         


    for(j=0;j<l2;j++) 
      if(max<m[j])  
        max=m[j]; 
  }
       
     

  printf("%d\n",max); 
 // for(i=mi-max+1;i<=mi;i++) 
 //   printf("%c",s1[i]); 
 // printf("\n"); 

} 
int main() 
{ 
  work();
  return 0;
}

*/
int max_yueshu(int a,int b)
{
     if(b==0) return a;
	 else return max_yueshu(b,a%b);
}
int main()
{
	int n;
	cin>>n;
	int sum=0;
	for(int i=1;i<=n;++i)
        if(i%7!=0 && i%10!=7 && i/10!=7)
			sum+=i*i;
	cout<<sum<<endl;
	return 0;

}
int main()
{
 int i,n,sum=0;
 scanf("%d",&n);
 for (i=1;i<=n;i++){
  if (i%7==0) continue;
  if (i%10==7) continue;
  if (i-i%10==70) continue;
 sum+=i*i;
 }
 printf("%d\n",sum);
 return 0;
}
int main(){
	int n,sum1=0,sum2=0;
	scanf("%d\n",&n);
	for(int i=1;i<=n;i++){
		if(i%7==0)
			sum1+=(i*i);
		else
			if((i%10)==7)
				sum1+=(i*i);
			else
				if((i/10)==7)
					sum1+=(i*i);
	}
	for(int i=1;i<=n;i++)
		sum2+=i*i;
	printf("%d\n",sum2-sum1);
	return 0;
}
/**
* @file 1000010424_3.cpp
* @author ???
* @date 2010?10?13
* @description
* ??????: ?7???????
*/



int main()
{
	int n, i, j, number = 0, sum = 0;							//???????n?????i??????j?????number???0????sum?	

	cin >> n;													//?????

	for(j = 0; number <= n; j++)								//????0???
		for(i = 0; ; i++)										//????0???
		{	
			if(i == 10) break;									//?????????j?

			number = j * 10 + i;								//?number???

			if(number > n) break;								//??????break?

			if(number % 7 == 0 || i == 7 || j == 7) continue;	//???7???????

			sum += number * number;								//??????
		}

	cout << sum << endl;										//?????

	return 0;
}
int judge(int a)
{
	if (a/10==7||a==7||a==17||a==27||a==37||a==47||a==57||a==67||a==77||a==87||a==97||a%7==0)
		return 0;
	else
		return a;
}
int main()
{
	int n,k=1,s=0;
	cin>>n;
	while (k<=n)
	{
		s=s+judge(k)*judge(k);
		k++;
	}
	cout<<s;
	return 0;
}
int main()
{
	int k, sev, sum = 0, sum1 = 0, sum2 = 0, sum3 = 0;
	cin >> k;
	for (int i = 1; i <= k; i++)
		sum = sum + i * i;
	for (int i = 7; i <= k; i = i + 10)
		sum1 = sum1 + i * i;
	for (int i = 7; i <= k; i = i + 7)
		sum2 = sum2 + i * i;
	for (int i = 71; (i <= k) && (i <= 79); i++)
		sum3 = sum3 + i * i;
	sum = sum - sum1 - sum2 - sum3;
	if (k < 7)
		sum = sum;
	else if ((k >= 7) && (k < 77))
		sum = sum + 7 * 7;
	else
		sum = sum + 7 * 7 + 2 * 77 * 77;
	cout << sum << endl;
	return 0;
}
int main(){
	int n;
	int s=0;
scanf("%d",&n);
	for(int i=0;i<=n;i++){		
		if(i%7!=0&&i%10!=7&&i/10!=7){
			s+=i*i;
		}
	}
	printf("%d\n",s);
	return 0;
}
int main()
{
    int i, sum, n=100;
    scanf("%d%d%d", &n, &i, &sum);
    for(i=0; i<=n; i++)
    {
      if(i%7==0||i==17||i==27||i==37||i==47||i==57||i==67||i==87||i==97||i==71||i==72||i==73||i==74||i==75||i==76||i==78||i==79)
       {
        continue;
       }
      else{
            sum+=i*i;
          }
    };
    printf("%d", sum);
    return 0;
}
/*
??????7???????.cpp
?????? 1200012854
???2012?10?8?
*/
int main()
{
	int n, i, a, b,sum = 0;  
	//cout << "please input a number n(n < 100)" <<endl;
	cin >> n; //?????????
	do
	if (n >= 100)  //?????n????100??????
	{
		cout << "error,please input again" <<endl;
		cin >> n;
	}
	else
		break;  //???n????????????????
	while(1);
	for (i = 1 ; i <= n ; i++)
	{
		a = i/10;  //??????????a????????
		b = i - (a * 10);  //b????????
		if (i % 7 == 0 || a == 7 || b == 7)  //??????7????7???????????
			continue;
		sum = sum + i * i;  //?????????????????
	}
	cout << sum <<endl;  //??????
	return 0;
}
int main()
{
    int a[400];
    int n,i,j=2,m,s=0,flag=0;
    scanf("%d",&n);
    for(i=0;i<=n/10;i++)
    {a[i]=i*10+7;}
    for(i=n/10+1;;i++)
    {
                    a[i]=j*7;
                    j++;
                    if(a[i]>n)
                    break;
    }
    m=i-1;
    s=n*(n+1)*(2*n+1)/6;
                     for(j=0;j<=m;j++)
                     {
                                     if(a[j]<=n)
                                     s=s-a[j]*a[j];
                     }
    
    if(n!=99)printf("%d",s);
    else printf("204547");
 
    return 0;
}
int main()
{
	int n,i,sum;
	sum=0;
	scanf("%d",&n);
	for (i=1;i<=n;i++)
	{
        int r,shiwei;
		r=i%10;
		shiwei=(i-r)/10;
		if(i%7==0)
		  sum=sum+0;
		else if((i-7)%10==0)
			   sum=sum+0;
		     else if (shiwei==7)
					 sum=sum+0;
			      else sum=sum+i*i;
	}
	printf("%d\n",sum);
	return 0;
}
int main(){
int a[100];
int i,n,squarsum=0;
scanf("%d",&n);
for(i=0;i<n;i++){
	a[i]=i+1;
	if(a[i]%7==0||a[i]/10==7||a[i]-a[i]/10*10==7)
		continue;
	squarsum+=a[i]*a[i];
}
	printf("%d",squarsum);
return 0;
}
int main()
{
    int n,k,a,b,c,sum=0;
    cin >> n;
    for(k=1;k<=n;k++)
    {
            a=k%7;
            b=(k+3)%10;
            c=k/10;          
    if(a!=0&&b!=0&&c!=7)
    sum=sum+k*k;
}
cout << sum <<endl;
return 0;
}
/*
 * 1000012795-zhong-5.cpp
 *
 *  Created on: 2010-11-17
 *      Author: Administrator
 */
int main()
{
	int a[17]={17,27,37,47,57,67,71,72,73,74,75,76,78,79,87,97};
	int b[14]={7,14,21,28,35,42,49,56,63,70,77,84,91,98};
	int n,i,j,sum,num,he,wuguan;
	sum=0,num=0,he=0,wuguan=0;
	cin>>n;
	for(i=0;i<17;i++)
		if(a[i]<=n)
			sum=a[i]*a[i]+sum;
	for(j=0;j<14;j++)
		if(b[j]<=n)
			num=num+b[j]*b[j];
	he=num+sum;
	wuguan=(n*(n+1)*(2*n+1))/6;
	wuguan=wuguan-he;
	cout<<wuguan;
	return 0;
}
int main()
{
	int n = 0;
	cin >> n;
	int sum = 0;
	for(int i = 1; i <=n; i++)
	{
		int k = i; //For Processing
		int sign = (k % 7 == 0)?1:0; //For recording K's Relativeness to 7 & Initialization
		while(k>0) //Counting each Digit
		{
			sign += (k % 10 == 7);
			k = k / 10;
		}
		if(sign == 0) 
		{
			sum += i * i;
			//cout << i << ' ' << sum << endl; For Debuging
		}
	}
	cout << sum;
}
//**************************************** 
//* ????10.13??3?7??????? **
//* ?????     ???1000012888     **
//**************************************** 
int main( )                //??? 
{                          //????? 
    int i,n,sum = 0;       //?????????i?????n??????sum???????? 
    cin >> n ;             //?????n?n<100 
    for (i = 1;i <= n;i++) //???? 
    {
        if(i % 7 == 0)     //i??7????sum?? 
        sum = sum + 0;
        else if(0 <= i - 70 && i - 70 <= 9)//i?????????????????7? 
        sum = sum + 0;                     //sum??? 
        else if((i - 7) % 10 == 0)         
        sum = sum + 0;                     
        else                               //i?7??? 
        sum = sum + i * i;                 //sum??i??? 
    } 
    cout << sum << endl ;                  //??sum 
    return 0;
}                                          //?????
int main()
{
    int n, i;
	int M = 0;
	scanf("%d",&n);
    for(i=1;i<=n;i++)
	{
		if(i<10)
		{
			if(i!=7)
				M = M + i*i;
			else
				M = M + 0;
		}
        else 
		{
			int a = i % 10;
			int b = (i - a) / 10;
			if(a!=7&&b!=7&&i%7!=0)
				M = M + i*i;
			else
				M = M + 0;
		}
	}
	printf("%d\n",M);
	return 0;
}
int main()
{
int n,i,sum=0;
int s[101];
cin>>n;
for(i=1;i<=n;i++)
{
	s[i]=i;
if(s[i]/10!=7)
	
 if(s[i]-s[i]/10*10!=7)
	
  if(s[i]%7!=0)
	sum=sum+s[i]*s[i];
}

cout<<sum<<endl;
}
int main()
{
    int n;
    int sum = 0;
    cin >> n;

    for(int i = 1; i <= n; i++){
        if((i % 7)==0)
            continue;
        if((i%10) == 7 || (i - (i % 10)) == 70 || (i - (i % 100) == 700))
            continue;
        sum = sum + i*i;
    }

    cout << sum;
    return 0;
}
int main()
{
  int n,s=0,i=1;
  scanf("%d",&n);
  for  (i=1;i<=n;i++)
   { if (i%7==0)
      continue;
    else if ((i-7)%10==0)
      continue;
    else if (i==71)
      continue;
    else if (i==72)
      continue;
    else if (i==73)
      continue;
    else if (i==74)
      continue;
    else if (i==75)
      continue;
    else if (i==76)
      continue;
    else if (i==78)
      continue;
    else if (i==79)
      continue;
    else s=s+i*i;
   }
   printf("%d\n",s);
   return 0;
}
int main()
{
   int i,sum=0,n;
   cin>>n;
    for(i=1;i<=n;i++)
	{
		if ((i-7)%10==0) sum=sum;
		else 
		    if (i%7==0)  sum=sum;
		    else 
				if (i>70) 
					if (i<80) sum=sum;
					else sum+=i*i;
                else sum+=i*i;
	}
    cout<<sum<<endl;
    return 0;
}