func_code_string: #include <bits/stdc++.h>   using namespace std;   long long a[10] = {};   int fac[13] = {1};   inline void p(vector<int> q, vector<int> w, int cnt, long long pr) {     if (q.size() == 0) {       a[cnt] += pr;       return;     }     int qq = q[q.size() - 1], ww = w[w.size() - 1];     q.pop_back();     w.pop_back();     p(q, w, cnt, pr * qq);     p(q, w, cnt + 1, pr * ww);   }   inline int c(int a, int b) { return fac[a] / fac[b] / fac[a - b]; }   inline int cal(int r, int n) {     if (r <= 0) return 0;     if (n == 6) return 1;     long long ret = 0;     for (int i = 0; i < r; ++i) {       if (a[i] <= 0) continue;       --a[i];       ret = (ret + cal(r - i, n + 1) * (a[i] + 1)) % 1000000007;       ++a[i];     }     return ret;   }   int main() {     char m[11];     int cnt = 0, t = 1;     long long ans = 0, tmp = 1;     vector<int> q, w;     for (int i = 1; i < 13; ++i) fac[i] = fac[i - 1] * i;     scanf( %s , m);     for (int i = 0; i < strlen(m); ++i) {       if (m[i] ==  0 ) continue;       q.clear();       w.clear();       t = 1;       if (m[i] <=  4 )         t = m[i] -  0 ;       else if (m[i] <=  7 ) {         q.push_back(m[i] -  0  - 1);         w.push_back(1);       } else {         q.push_back(m[i] -  0  - 2);         w.push_back(2);       }       for (int j = i + 1; j < strlen(m); ++j) {         q.push_back(8);         w.push_back(2);       }       p(q, w, cnt, t);       if (m[i] ==  4  || m[i] ==  7 ) ++cnt;     }     ++a[cnt];     --a[0];     for (int i = 1; i < 10 && a[i] > 0; ++i) {       --a[i];       ans = (ans + (long long)cal(i, 0) * (a[i] + 1)) % 1000000007;       ++a[i];     }     cout << ans;     return 0;   }   