func_code_string: #include <bits/stdc++.h>   using namespace std;   int dig[15];   int qpow(int digit) {     int a = 2, b = digit, ans = 1;     while (b) {       if (b & 1) ans *= a;       a *= a;       b >>= 1;     }     return ans;   }   int getDigit(int x) {     int ans = 0;     while (x) {       x /= 10;       ans++;     }     return ans;   }   void getHead(int x, int len) {     int index = len;     while (x) {       dig[index--] = x % 10;       x /= 10;     }   }   int main() {     int n;     while (~scanf( %d , &n)) {       int len = getDigit(n);       int ans = 0;       for (int i = 1; i <= len - 1; i++) ans += qpow(i);       if (ans == 1) ans -= 1;       getHead(n, len);       for (int i = 1; i <= len; i++) {         if (dig[i] > 7) {           ans += qpow(len - i + 1);           break;         } else if (dig[i] == 7) {           ans += qpow(len - i);           if (i == len) ans += 1;         } else if (dig[i] > 4) {           ans += qpow(len - i);           break;         } else if (dig[i] == 4) {           if (i == len) ans += 1;           continue;         } else           break;       }       printf( %d n , ans);     }     return 0;   }   