Language: C++

#include <iostream>
#include <string>
#include <vector>
#include <algorithm>

bool check(const std::string& ss)
{
    if (ss.length() >= 10) return false;

    std::string s = ss;

    std::sort(std::begin(s), std::end(s));
    s.erase(std::unique(std::begin(s), std::end(s)), std::end(s));

    return (s == "357");
}

void rec(const std::string& ss, const std::string& n, std::vector<std::string>& c)
{
    if (ss.length() >= 10) return;

    std::string s = ss;
    s.insert(ss.length(), n);
    c.push_back(std::stoll(s));
    rec(s, "3", c);
    rec(s, "5", c);
    rec(s, "7", c);
}

int main()
{
    long long N;
    std::cin >> N;

    std::vector<long long> ll;
    for (long long i = 357; i <=753; i++) {
        std::string s = std::to_string(i);
        if (check(s)) {
            ll.push_back(std::stoll(s));
            rec(s, "3", ll);
            rec(s, "5", ll);
            rec(s, "7", ll);
        }
    }

    std::sort(std::begin(ll), std::end(ll));

    long long i = 0;
    for (; i < ll.size(); i++) {
        if (ll[i] > N) break;
    }

    std::cout << i << std::endl;

    return 0;
}

Compiler output:
a.cc: In function 'void rec(const std::string&, const std::string&, std::vector<std::__cxx11::basic_string<char> >&)':
a.cc:24:16: error: no matching function for call to 'std::vector<std::__cxx11::basic_string<char> >::push_back(long long int)'
   24 |     c.push_back(std::stoll(s));
      |     ~~~~~~~~~~~^~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/vector:66,
                 from a.cc:3:
/usr/include/c++/14/bits/stl_vector.h:1283:7: note: candidate: 'void std::vector<_Tp, _Alloc>::push_back(const value_type&) [with _Tp = std::__cxx11::basic_string<char>; _Alloc = std::allocator<std::__cxx11::basic_string<char> >; value_type = std::__cxx11::basic_string<char>]'
 1283 |       push_back(const value_type& __x)
      |       ^~~~~~~~~
/usr/include/c++/14/bits/stl_vector.h:1283:35: note:   no known conversion for argument 1 from 'long long int' to 'const std::vector<std::__cxx11::basic_string<char> >::value_type&' {aka 'const std::__cxx11::basic_string<char>&'}
 1283 |       push_back(const value_type& __x)
      |                 ~~~~~~~~~~~~~~~~~~^~~
/usr/include/c++/14/bits/stl_vector.h:1300:7: note: candidate: 'void std::vector<_Tp, _Alloc>::push_back(value_type&&) [with _Tp = std::__cxx11::basic_string<char>; _Alloc = std::allocator<std::__cxx11::basic_string<char> >; value_type = std::__cxx11::basic_string<char>]'
 1300 |       push_back(value_type&& __x)
      |       ^~~~~~~~~
/usr/include/c++/14/bits/stl_vector.h:1300:30: note:   no known conversion for argument 1 from 'long long int' to 'std::vector<std::__cxx11::basic_string<char> >::value_type&&' {aka 'std::__cxx11::basic_string<char>&&'}
 1300 |       push_back(value_type&& __x)
      |                 ~~~~~~~~~~~~~^~~
a.cc: In function 'int main()':
a.cc:40:25: error: invalid initialization of reference of type 'std::vector<std::__cxx11::basic_string<char> >&' from expression of type 'std::vector<long long int>'
   40 |             rec(s, "3", ll);
      |                         ^~
a.cc:18:81: note: in passing argument 3 of 'void rec(const std::string&, const std::string&, std::vector<std::__cxx11::basic_string<char> >&)'
   18 | void rec(const std::string& ss, const std::string& n, std::vector<std::string>& c)
      |                                                       ~~~~~~~~~~~~~~~~~~~~~~~~~~^
a.cc:41:25: error: invalid initialization of reference of type 'std::vector<std::__cxx11::basic_string<char> >&' from expression of type 'std::vector<long long int>'
   41 |             rec(s, "5", ll);
      |                         ^~
a.cc:18:81: note: in passing argument 3 of 'void rec(const std::string&, const std::string&, std::vector<std::__cxx11::basic_string<char> >&)'
   18 | void rec(const std::string& ss, const std::string& n, std::vector<std::string>& c)
      |                                                       ~~~~~~~~~~~~~~~~~~~~~~~~~~^
a.cc:42:25: error: invalid initialization of reference of type 'std::vector<std::__cxx11::basic_string<char> >&' from expression of type 'std::vector<long long int>'
   42 |             rec(s, "7", ll);
      |                         ^~
a.cc:18:81: note: in passing argument 3 of 'void rec(const std::string&, const std::string&, std::vector<std::__cxx11::basic_string<char> >&)'
   18 | void rec(const std::string& ss, const std::string& n, std::vector<std::string>& c)
      |                                                       ~~~~~~~~~~~~~~~~~~~~~~~~~~^