Find the position
Submissions: 485   Accuracy:

36.51%

  Difficulty: Basic   Marks: 1

Consider a series of numbers composed of only digits 4 and 7. First few numbers in the series are 4, 7, 44, 47, 74, 77, 444, .. etc. Given a string constructed by 4, 7 digit only, find position of this number in this series.

Input:
The first line consists of an integer T i.e number of test cases. The first and only line of each test case consists of a string s

Output:
Print the required output.

Constraints: 
1<=T<=100
1<=|Length of s|<=50

Example:
Input:

2
7
444

Output:
2
7

** For More Input/Output Examples Use 'Expected Output' option **

Contributor: Saksham Ashtputre
Author: saksham0751


If you have purchased any course from GeeksforGeeks then please ask your doubt on course discussion forum. You will get quick replies from GFG Moderators there.



Need help with your code? Please use ide.geeksforgeeks.org, generate link and share the link here.

to report an issue on this page.