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.
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.
Print the required output.
1<=|Length of s|<=50
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.