Not able to pass all testcase

please provide the correction in my code to pass all testcase.
Problem:-Tavas and Saddas
code:-

#include
using namespace std;
#include <math.h>

int numberofdigit(int n)
{
int k=0;
while(n>0)
{
n=n/10;
k++;
}
return k;
}
int main()
{
int n;
cin>>n;
int k=numberofdigit(n);

int x=0;

 x+=k*(k-1); 

for(int i=0;i<k;i++)
{
	int rem=n%10;
	if(rem==7)
	 x+=pow(2,i);
	n=n/10;
}
x++;
cout<<x;

return 0;

}

this statement is incorrectly written
it has to be x = ( 1 << k )

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.