Language: C++

#include <stdio.h>
#include <string.h>
#include <algorithm>
#include <iostream>
#include <string>
#include <vector>
#include <functional>
#include <map>
#include <iomanip>
#include <math.h> 
#include <stack>
#include <queue>
#include <bitset>
#include <cstdlib>
#include <tuple>
#include <cctype>
#include <ctype.h>
#include <set>
#include <sstream>
#include <time.h>
using namespace std;
//#define int long long
#define rep(i,s,n) for(int i = s;i<n;i++)
#define repe(i,s,n) for(int i = s;i<=n;i++)
#define rrep(i,s,n) for(int i = (n)-1;i>=(s);i--)
#define all(v) (v).begin(),(v).end()
#define pb push_back
#define fi first
#define se second
#define chmin(a,b) a=min((a),(b))
#define chmax(a,b) a=max((a),(b))
typedef long long ll;
typedef pair<int, int>pint;
typedef vector<int>vint;
typedef vector<pint>vpint;
typedef pair<pint, int> P1;
typedef pair<int, pint> P2;
typedef pair<pint, pint> PP;
static const ll maxLL = (ll)1 << 62;
const ll MOD = 1000000007;
const ll INF = 1e18;
int ca[12] = { 31,28,31,30,31,30,31,31,30,31,30,31 };



signed main() {
	int i, j, k;
	int n, cnt = 0;

	cin >> n;


	
	if( n < 1000) {
		//int num = n % 1000;
		int num = n;

		for (i = 0; i <= num; i++) {
			if (i % 10 == 1 || i % 10 == 2 || i % 10 == 4 || i % 10 == 6 || i % 10 == 8 || i % 10 == 9 || i % 10 == 0  )continue;

			string s = to_string(i);

			vector<int>list(10,0);

			for (j = 0; j < s.length(); j++) {
				list[s[j] - 48]++;
			}

			if (list[7] == 1 && list[5] == 1 && list[3] == 1)cnt++;
		}

		cout << cnt << endl;
		getchar();
		getchar();
		return 0;

	}


	vector<int>a(10, 4);

	 string s = to_string(n);

	 if (s[0] - 48 >= 7) {
		 a[s.length() - 1] = 4;
	 }
	 else if (s[0] - 48 >= 5) {
		 a[s.length() - 1] = 3;
	 }
	 else if (s[0] - 48 >= 3) {
		 a[s.length() - 1] = 2;
	 }
	 else {
		 a[s.length() - 1] = 1;
	 }

	 vector<bool>flag(4, false);
	 vector<int>li(10, 0);


	 switch (s.length())
	 {
	 case 4: {
		 goto label4;
	 }
	 case 5: {
		 goto label5;
	 }
	 case 6: {
		 goto label6;
	 }
	 case 7: {
		 goto label7;
	 }
	 case 8: {
		 goto label8;
	 }
	 case 9: {
		 goto label9;
	 }
		 
	 }

	 int i1, i2, i3, i4, i5, i6, i7, i8, i9;


	label9:
	 rep(i1, 1, a[8]) {
		
		 li[8] = i1;
		label8:

		 rep(i2, 1, a[7]) {
			
		 label7:
			 li[7] = i2;

			 rep(i3, 1, a[6]) {
				
			 label6:
				 li[6] = i3;

				 rep(i4, 1, a[5]) {
					
				 label5:
					 li[5] = i4;
					 
					 rep(i5, 1, a[4]) {
						
					 label4:
						 li[4] = i5;
						 
						 rep(i6, 1, a[3]) {
							
							 li[3] = i6;

							 rep(i7, 1, a[2]) {
								
								 li[2] = i7;

								 rep(i8, 1, a[1]) {
									
									 li[1] = i8;

									 rep(i9, 1, a[0]) {
										
										 li[0] = i9;

										 bool flag2[4] = { false, false , false , false  };
										 for (int index = 0; index < s.length(); index++) {
											 flag2[li[index]] = true;
										 }

										 if (flag2[1] == false || flag2[2] == false || flag2[3] == false) {
											 //continue;
										 }
										 else {
											 cnt++;
										 }

										 //flag[1] = false;  flag[2] = false;  flag[3] = false;

									 }

									 //flag[1] = false;  flag[2] = false;  flag[3] = false;

								 }
							 }
						 }
						 if (s.length() == 4)goto labelend;
					 }
					 if (s.length() == 5)goto labelend;
				 }
				 if (s.length() == 6)goto labelend;
			 }
			 if (s.length() == 7)goto labelend;
		 }
		 if (s.length() == 8)goto labelend;
	 }

 labelend:

	 cout << cnt << endl;




	getchar();
	getchar();
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:131:17: error: jump to label 'label8'
  131 |                 label8:
      |                 ^~~~~~
a.cc:116:23: note:   from here
  116 |                  goto label8;
      |                       ^~~~~~
a.cc:128:14: note:   crosses initialization of 'int i1'
  128 |          rep(i1, 1, a[8]) {
      |              ^~
a.cc:23:28: note: in definition of macro 'rep'
   23 | #define rep(i,s,n) for(int i = s;i<n;i++)
      |                            ^
a.cc:135:18: error: jump to label 'label7'
  135 |                  label7:
      |                  ^~~~~~
a.cc:113:23: note:   from here
  113 |                  goto label7;
      |                       ^~~~~~
a.cc:133:22: note:   crosses initialization of 'int i2'
  133 |                  rep(i2, 1, a[7]) {
      |                      ^~
a.cc:23:28: note: in definition of macro 'rep'
   23 | #define rep(i,s,n) for(int i = s;i<n;i++)
      |                            ^
a.cc:128:14: note:   crosses initialization of 'int i1'
  128 |          rep(i1, 1, a[8]) {
      |              ^~
a.cc:23:28: note: in definition of macro 'rep'
   23 | #define rep(i,s,n) for(int i = s;i<n;i++)
      |                            ^
a.cc:140:26: error: jump to label 'label6'
  140 |                          label6:
      |                          ^~~~~~
a.cc:110:23: note:   from here
  110 |                  goto label6;
      |                       ^~~~~~
a.cc:138:30: note:   crosses initialization of 'int i3'
  138 |                          rep(i3, 1, a[6]) {
      |                              ^~
a.cc:23:28: note: in definition of macro 'rep'
   23 | #define rep(i,s,n) for(int i = s;i<n;i++)
      |                            ^
a.cc:133:22: note:   crosses initialization of 'int i2'
  133 |                  rep(i2, 1, a[7]) {
      |                      ^~
a.cc:23:28: note: in definition of macro 'rep'
   23 | #define rep(i,s,n) for(int i = s;i<n;i++)
      |                            ^
a.cc:128:14: note:   crosses initialization of 'int i1'
  128 |          rep(i1, 1, a[8]) {
      |              ^~
a.cc:23:28: note: in definition of macro 'rep'
   23 | #define rep(i,s,n) for(int i = s;i<n;i++)
      |                            ^
a.cc:145:34: error: jump to label 'label5'
  145 |                                  label5:
      |                                  ^~~~~~
a.cc:107:23: note:   from here
  107 |                  goto label5;
      |                       ^~~~~~
a.cc:143:38: note:   crosses initialization of 'int i4'
  143 |                                  rep(i4, 1, a[5]) {
      |                                      ^~
a.cc:23:28: note: in definition of macro 'rep'
   23 | #define rep(i,s,n) for(int i = s;i<n;i++)
      |                            ^
a.cc:138:30: note:   crosses initialization of 'int i3'
  138 |                          rep(i3, 1, a[6]) {
      |                              ^~
a.cc:23:28: note: in definition of macro 'rep'
   23 | #define rep(i,s,n) for(int i = s;i<n;i++)
      |                            ^
a.cc:133:22: note:   crosses initialization of 'int i2'
  133 |                  rep(i2, 1, a[7]) {
      |                      ^~
a.cc:23:28: note: in definition of macro 'rep'
   23 | #define rep(i,s,n) for(int i = s;i<n;i++)
      |                            ^
a.cc:128:14: note:   crosses initialization of 'int i1'
  128 |          rep(i1, 1, a[8]) {
      |              ^~
a.cc:23:28: note: in definition of macro 'rep'
   23 | #define rep(i,s,n) for(int i = s;i<n;i++)
      |                            ^
a.cc:150:42: error: jump to label 'label4'
  150 |                                          label4:
      |                                          ^~~~~~
a.cc:104:23: note:   from here
  104 |                  goto label4;
      |                       ^~~~~~
a.cc:148:46: note:   crosses initialization of 'int i5'
  148 |                                          rep(i5, 1, a[4]) {
      |                                              ^~
a.cc:23:28: note: in definition of macro 'rep'
   23 | #define rep(i,s,n) for(int i = s;i<n;i++)
      |                            ^
a.cc:143:38: note:   crosses initialization of 'int i4'
  143 |                                  rep(i4, 1, a[5]) {
      |                                      ^~
a.cc:23:28: note: in definition of macro 'rep'
   23 | #define rep(i,s,n) for(int i = s;i<n;i++)
      |                            ^
a.cc:138:30: note:   crosses initialization of 'int i3'
  138 |                          rep(i3, 1, a[6]) {
      |                              ^~
a.cc:23:28: note: in definition of macro 'rep'
   23 | #define rep(i,s,n) for(int i = s;i<n;i++)
      |                            ^
a.cc:133:22: note:   crosses initialization of 'int i2'
  133 |                  rep(i2, 1, a[7]) {
      |                      ^~
a.cc:23:28: note: in definition of macro 'rep'
   23 | #define rep(i,s,n) for(int i = s;i<n;i++)
      |                            ^
a.cc:128:14: note:   crosses initialization of 'int i1'
  128 |          rep(i1, 1, a[8]) {
      |              ^~
a.cc:23:28: note: in definition of macro 'rep'
   23 | #define rep(i,s,n) for(int i = s;i<n;i++)
      |                            ^