Go: package main

import (
	"fmt"
)

func main() {
	for i := 1; i <= 9; i++ {
		for j := 1; j <= 9; j++ {
			fmt.Printf("%dx%d=%d\n", i, j, i*j)
		}
	}
}

C++: #include <iostream>

int main(int argc, char const* argv[])
{
	for (size_t i = 1; i < 10; i++)
		for (size_t j = 1; j < 10; j++)
			std::cout << i << "x" << j << "=" << i * j << std::endl;


	return 0;
}

C++: #include<iostream>
using namespace std;
int main() {
	int i, j,ans;
	for (i = 1; i <= 9; i++) {
		for (j = 1; j <= 9; j++) {
			ans = j*i;
			cout << i << "x" << j << "=" << ans << endl;
		}
	}
	return 0;
}

C++: #include <stdio.h>
int main(){
	for(int i = 1; i <= 9; i++){
		for(int j = 1; j <= 9; j++){
			printf("%dx%d=%d\n",i,j,i * j);
		}
	}

	return 0;
}

C++: #include<stdio.h>


void main(void) {
	for (int i = 1;i < 10;i++)for (int j = 1;j < 10;j++,printf("\n"))printf("%dx%d=%d", i, j, i*j);
}

C++: #include<iostream>
using namespace std;

int main(){
	for(int i = 1; i <= 9; i++){
		for(int j = 1; i <= 9; j++){
			cout << i << "x" << j << "=" << i * j << endl;
		}
	}
    return 0;
}

C++: #include<stdio.h>
int main(void){
	for(int i=1; i<=9; i++){
		for(int j=1; j<=9; j++){
			printf("%dx%d=%d\n",i,j,i*j);
		}
	}
	return 0;
}

C++: #include<iostream>

using namespace std;

int main(void){

	for(int i=1;i<10;i++)
		for(int j=1;j<10;j++)
		cout << i << "x" << j << "=" << i*j << endl;
	
return 0;
}

C++: #include<iostream>

int main(void){
	for(int i=1;i<10;i++){
		for(int j=1;j<10;j++)
			std::cout<<i<<"x"<<j<<"="<<i*j<<std::endl;
	}
	return 0;
}

C++: #include <iostream>

int main(){
	
	//double loop
	for(int i = 1; i <= 9; ++i){
		for(int j = 1; j <= 9; ++j){
			std::cout << i << "x" << j << "=" << i*j << std::endl;
		}
	}
	return 0;
}

C++: #include <iostream>
using namespace std;

int main() {
 for (int i = 0; i < 9 ; i++) {
   for (int j = 0; j < 9; j++) {
     cout << i+1 << "??" << j+1 << "=" << (i+1)*(j+1) << endl;
    }
  }
   return 0 ;
}

C++: #include<iostream>
using namespace std;
int main(){
  for (int a=1 ; a<10 ; a++){
    for (int b=1 ; b<10 ; b++){
    
      cout << a << "x" << b << "=" << a*b << endl;
    }
  }
  return 0;
}

C++: #include<stdio.h>
#include<algorithm>
#include<string.h>
using namespace std;
#define N 510
#define INF 1000100
struct Node {
	int x, y;
	friend bool operator <(struct Node a, struct Node b) {
		if (a.y != b.y)
			return a.y > b.y;
		return a.x < b.x;
	}
	friend bool operator ==(struct Node a, struct Node b) {
		return a.x == b.x && a.y == b.y;
	}
};
int dp[N];
struct Node d[N];
void init(int n) {
	for (int i = 0; i < n; i++) {
		dp[i] = -INF;
	}
	dp[n] = 0;
}
int main() {
	setvbuf(stdout,NULL,_IONBF,0);
	int n;
	while (scanf(" %d", &n) == 1) {
		init(n);
		memset(d,-1,sizeof(d));
		for (int i = 0; i < n; i++) {
			scanf(" %d %d", &d[i].x, &d[i].y);
		}
		sort(d, d + n);
		for (int i = 0, j = n - 1; i < n; i++) {
			if(d[i].y<0||d[i].x<0) continue;
			while (j > d[i].y) {
				dp[j] = max(dp[j],dp[j+1]);
				j--;
			}
			int k = 1;
			while (d[i] == d[i + 1] && i < n - 1) {
				k++;
				i++;
			}
			for (int e = 1; e + j <= n && e <= k&&e<=n-d[i].x-d[i].y; e++) {
				dp[j] = max(dp[j + e]+e, dp[j]);
			}
		}
		int ans = 0;
		for (int i = 0; i <= n; i++) {
			ans = max(ans, dp[i]);
		}
		printf("%d\n", ans);
	}
	return 0;
}
/*
 5
 4 0
 3 1
 2 2
 3 1
 4 0
 5
 4 0
 3 1
 2 2
 1 3
 0 4
 5
 0 4
 1 3
 2 0
 2 0
 2 0
 5
 0 4
 1 0
 1 0
 1 0
 1 0
 5
 0 4
 1 1
 1 1
 1 1
 4 0
 5
 0 1
 1 1
 1 1
 1 1
 4 0
 5
 0 4
 1 3
 2 0
 2 1
 2 0
3
0 0
0 0
0 0
 */

C++: #include  <cstdio>
int main(){
  for(int i=1;i<=9;i++)
    for(int j=1;j<=9;j++)
      printf("%dx%d=%d\n",i,j,i*j);
}

C++: #include <iostream>
using namespace std;

int main()
{
	for(int i=1;i<10;i++){
		for(int j=1;j<10;j++){
			cout << i  << "ツ×" << j << "=" << i*j << endl;
		}
	}
	return 0;
}

C++: hawawa

C++: #include<iostream>
using namespace std;
int main(){
	int i, j;
		for (i = 1; i < 10; i++){
			for (j = 1; j < 10; j++){
				cout << i << "x" << j << "=" << i*j << endl;
			}
		}
	return 0;
}

C++: #include<iostream>
using namespace std;
int main()
{
    for(int i=1;i<=9;i++){
        for(int j=1;j<=9;j++){
            cout<<i<<'x'<<j<<"="<<i*j<<endl;
        }
    }
    return 0;
}

C++: #include<iostream>
using namespace std;
int main(){
	int a,b,x;
	for(int j=1;j<=9;j++){
		a=j;
		for(int i=1;i<=9;i++){
			b=i;
			cout<<a<<"x"<<b<<"="<<a*b<<endl;
		}
	}
}

C++: #include<iostream>
int main(){
  int i,j;
  for(i=1;i<10;i++)for(j=1;j<10;j++)std::cout<<i<<'x'<<j<<'='<<i*j<<std::endl;
  return 0;
}

C++: #include <iostream>

using namespace std;

int main()
{
    for (int i = 1; i <= 9; i++) {
        for (int j = 1; j <= 9; j++) {
            cout << i << "x" << j << "=" << i * j << endl;
        }
    }

    return 0;
}

C++: #include<stdio.h>

int main(){
    int i;
    for(i = 1; i < 10; i++) printf("%d*%d=%d\n",i,i,i*i);
    return 0;
}

C++: #include <iostream>
int main()
{

	for(int j=1;j<=9;j++){
		a=j;
		for(int i=1;i<=9;i++){
		b=i;
		cout<<a<<"x"<<b<<"="<<a*b<<endl;
		
		}
	    }
}

C++: #include<iostream>
 
using namespace std;
 
int main(){
    int i, j;
 
    for(i=1;i<10;i++){
        for(j=1;j<10;j++){
            cout << i << "x" << j << "=" << i*j << endl;
        }
    }
 
    return 0;
}

C++: #include<stdio.h>

int main(){

	for(int a=1; a<=9; a++){
		for(int b=1; b<=9; b++){
			printf("%d*%d=%d\n",a,b,a*b);
		}
	}
    return 0;
}

C++: #include<iostream>
using namespace std;

int main()
{
for(int i = 1;i <= 9;i++)
{
for(int j = 1;i <= 9;j++)
cout<<i<<"x"<<j<<"="<<i*j<<endl;
}
return 0;
}

C++: #include<stdio.h>

int main(){
	for(int i=1;i<=9;i++){
		for(int j=1;j<=9;j++)	{
			printf("%dx%d=&d\n",i,j,i*j);
		}	
	}
    return 0;
}

C++: #include<iostream>
using namespace std;
int main (){
    int i,j;
    for(i=1;i<=9;i++){
        for(j=1;j<=9;j++){
            cout<<j<<"x"<<i<<"="<<i*j<<endl;
        }
    }
    return 0;
}

C++: #include<stdio.h>
char a, b;int main(){for(a=1;a<=9;a++)for(b=1;b<=9;b++)printf("%dx%d=%d\n",a,b,a*b);return 0;}

C++: #include<iostream>

using namespace std;

int main(){

  int i, j;

  for(i = 1; i <= 9; i++){
    for(j = 1; j <= 9; j++){

      cout << i << "x" << j << "=" << i*j << endl;

    }
  } 


  return 0;
}

C++: #include <cstdio>
using namespace std;

int main() {
    for(int i=1;i<=9;++i) {
        for(int j=1;j<=9;++j) {
            printf("%dx%d=%d\n",i,j,i*j);
        }
    }
    return 0;
}

C++: #include<bits/stdc++.h>
using namespace std;

int main(){
  for(int i = 1; i <= 9; i++){
    cout << i << "x" << i << "=" << i*i << endl;
  }
}

C++: #include<iostream>
using namespace std;

int main(){
for(int i=0;i<9;i++){
for(int j=0;j<9;j++){
cout << i+1 << "??" << j+1 << "=" << (i+1)*(j+1) << endl;
}
}
    return 0;
}

C++: #include <cstdio>
#include <vector>

using namespace std;

#define FOR(it,c) for(typeof((c).begin()) it=(c).begin(); it!=(c).end(); ++it)

int main() {
	vector<int> v;
	for(int i = 1; i <= 9; i++) {
		v.push_back(i);
	}
	
	FOR(it1, v) {
		FOR(it2, v) {
			printf("%dx%d=%d\n", *it1, *it2, *it1 * *it2);
		}
	}
}

C++: #include <cstdio>
using namespace std;

int main() {
  for (int i = 1; i <= 9; ++i) {
    for (int j = 1; j <= 9; ++j) {
      printf("%dx%d=%d\n", i, j, i*j);
    }
  }
}

C++: class Main{
    public static void main(String[] a){
      for (int i=1;i<10;i++){
       for (int j=1;j<10;j++){
       System.out.println(i + "×" + j + "=" i*j);
       }
      }
    }
}

C++: #include <cstdio>

void rec(int i, int j)
{
  if (j == 10) return;

  printf("%dx%d=%d\n", i, j, i * j);
  rec(i, j + 1);
}

signed main(void)
{
  for (int x = 1; x < 10; x++) rec(x, 1);
}

C++: #include<stdio.h>

int main(){
int c,a=1,b=1;

for(a=1;a<10;a++){
	for(b=1;b<10;b++){
		c=a*b;
		printf("%d×%d=%d\n",a,b,c);
	}
}
		
    return 0;
}