Language: C++

#include<iostream>
#include<vector>
#include<string>
#include<algorithm>
using namespace std;

int order(int N){
    int ret = 0;
    while(N!=0){
        ++ret;
        N /= 10;
    }
    return ret;
}

int main(){
    int N;
    cin >> N;
    int o_N = order(N);
    if (o_N < 3)
        cout << 0 << endl;
    vector<vector<string> > no753(10);
    no753[2] = {"357", "375", "537", "573", "735", "753"};
    string temp_str;
    for(size_t i = 3; i < o_N; i++)
    {
        for (auto str : no753[i-1]){
            for(size_t j = 0; j < i+1; j++)
            {
                temp_str = str;
                no753[i].push_back(temp_str.insert(j, "3"));
                temp_str = str;
                no753[i].push_back(temp_str.insert(j, "5"));
                temp_str = str;
                no753[i].push_back(temp_str.insert(j, "7"));
            }
        }
        sort(no753[i].begin(), no753[i].end());
        no753[i].erase(unique(no753[i].begin(), no753[i].end()), no753[i].end());
    }
    vector<int> sorted_753;
    for(auto vec : no753){
        for (auto no : vec){
            sorted_753.push_back(stoi(no));
        }
    }
    sorted_753.push_back(1000000000);
    sort(sorted_753.begin(), sorted_753.end());
    sorted_753.erase(unique(sorted_753.begin(), sorted_753.end(), sorted_753.end()));
    auto itr_upper = upper_bound(sorted_753.begin(), sorted_753.end(), N);
    int ret = itr_upper - sorted_753.begin();
    cout << ret << endl;
    return 0;
}

Compiler output:
In file included from /usr/include/c++/14/bits/stl_algobase.h:71,
                 from /usr/include/c++/14/string:51,
                 from /usr/include/c++/14/bits/locale_classes.h:40,
                 from /usr/include/c++/14/bits/ios_base.h:41,
                 from /usr/include/c++/14/ios:44,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:1:
/usr/include/c++/14/bits/predefined_ops.h: In instantiation of 'constexpr bool __gnu_cxx::__ops::_Iter_comp_iter<_Compare>::operator()(_Iterator1, _Iterator2) [with _Iterator1 = __gnu_cxx::__normal_iterator<int*, std::vector<int> >; _Iterator2 = __gnu_cxx::__normal_iterator<int*, std::vector<int> >; _Compare = __gnu_cxx::__normal_iterator<int*, std::vector<int> >]':
/usr/include/c++/14/bits/stl_algo.h:869:20:   required from '_ForwardIterator std::__unique(_ForwardIterator, _ForwardIterator, _BinaryPredicate) [with _ForwardIterator = __gnu_cxx::__normal_iterator<int*, vector<int> >; _BinaryPredicate = __gnu_cxx::__ops::_Iter_comp_iter<__gnu_cxx::__normal_iterator<int*, vector<int> > >]'
  869 |         if (!__binary_pred(__dest, __first))
      |              ~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algo.h:933:27:   required from '_FIter std::unique(_FIter, _FIter, _BinaryPredicate) [with _FIter = __gnu_cxx::__normal_iterator<int*, vector<int> >; _BinaryPredicate = __gnu_cxx::__normal_iterator<int*, vector<int> >]'
  933 |       return std::__unique(__first, __last,
      |              ~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~
  934 |                            __gnu_cxx::__ops::__iter_comp_iter(__binary_pred));
      |                            ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
a.cc:49:28:   required from here
   49 |     sorted_753.erase(unique(sorted_753.begin(), sorted_753.end(), sorted_753.end()));
      |                      ~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/predefined_ops.h:158:30: error: no match for call to '(__gnu_cxx::__normal_iterator<int*, std::vector<int> >) (int&, int&)'
  158 |         { return bool(_M_comp(*__it1, *__it2)); }
      |                       ~~~~~~~^~~~~~~~~~~~~~~~