Go: // 九九を出すだけ
package main
import (
	"fmt"
	"os"
	"bufio"
)
var out = bufio.NewWriter(os.Stdout)

func main(){
	defer out.Flush()
	for i:=1; i<10; i++{
		for j:=1; j<10; j++{
			fmt.Fprintf(out, "%dx%d=%d\n", i, j, i*j)
		}
	}
}

C++: //AOJ 0000
#include<cstdio>
#include<cstdlib>
#include<cstring>
using namespace std;
#define MAX_A 104
#define MAX_B 104

int a,  i, dp[MAX_A][MAX_B], max, j, b, ans, k;

int sort(const void *a, const void *b){
  return *(int*)a - *(int*)b;
}

int main(){
  /*while(1){
    scanf("%d %d", &a, &b);
    if(a == 0 && b == 0) break;
    memset(dp, -1, sizeof(dp));
    for(i = 0; i < a + 2; i++){
      dp[i][0] = 0;
      dp[i][1] = 1;
    }
    for(i = 0; i < b + 2; i++){
      dp[0][i] = 0;
      dp[1][i] = 1;
    }
    dp[1][1] = 1;
    for(i = 2; i <= a; i++){
      for(j = 2; j <= b; j++){
	dp[i][j] = dp[i - 1][j] + dp[i][j - 1];
	if(i > 2 && j > 2) dp[i][j] -= 2;
	else if(i > 2 || j > 2) dp[i][j]--;
	}
    }
    printf("%d\n", dp[a][b] % 100000);
  }
  */
  while(1){
    scanf("%d %d", &a, &b);
    if(a == 0 && b == 0) break;
    if(b < 3 || b > 24){
      printf("0\n");
      continue;
    }
    ans = 0;
    for(i = 0; i <= 7; i++){
      if(i >= b / 3) break;
      for(j = i + 1; j <= 8; j++){
	if(j >= b - (i + j)) break;
	if(b - (i + j) <= 9) ans++;
      }
    }
    printf("%d\n", ans);
  }
  return 0;
}

C++: #include <bits/stdc++.h>
using namespace std;
#define FOR(i, s, n) for(int i = s; i < (int)n; i++)
#define per(i, n) for(int i = n; i >= 0; i--)
#define ROF(i, s, n) for(int i = s; i >= (int)n; i--)
#define FORIT(i, A) for (auto i : A)
#define PRINT(x) cout << (x) << "\n"
#define ALL(a) (a).begin(),(a).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define MP make_pair
#define EACH(i, n) for (__typeof((n).begin()) i = (n).begin(); i != (n).end(); ++i)
#define SZ(a) int((a).size())
#define EXIST(s,e) ((s).find(e)!=(s).end())
#define SORT(c) sort((c).begin(),(c).end())
#define CLR(a) memset((a), 0 ,sizeof(a))
#define NCLR(a) memset((a), -1 ,sizeof(a))
#define dump(x) cout << #x << " = " << (x) << "\n";
#define debug(x) cout << #x << " = " << (x) << " (L" << __LINE__ << ")" << " " << __FILE__ << "\n";
#define sq(n) (n) * (n)
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<string> VS;
typedef pair<int, int> PII;
typedef long long LL;
typedef vector<LL> VLL;
typedef vector<VLL> VVLL;
typedef unsigned int uint;
typedef unsigned long long ull;
typedef priority_queue<int> maxpq;
typedef priority_queue< int, vector<int>, greater<int> > minpq;
typedef complex<double> P;
static const double EPS = 1e-10;
static const double PI = acos( -1.0 );
static const int mod = 1000000007;
static const int INF = 1 << 29;
static const LL LL_INF = 1152921504606846976;
static const int dx[] = { -1, 0, 1, 0, 1, -1, 1, -1 };
static const int dy[] = { 0, -1, 0, 1, 1, 1, -1, -1 };


int main() {
#ifdef _DEBUG
	printf( "debug\n" );
#endif
	for ( int i = 1; i < 10; i++ ) {
		for ( int j = 1; j < 10; j++ ) {
			printf( "%dx%d=%d\n", i, j, i * j );
		}
	}
	return 0;
}

C++: #include <bits/stdc++.h>
using namespace std;
#define FOR(i, s, n) for(int i = s; i < (int)n; i++)
#define per(i, n) for(int i = n; i >= 0; i--)
#define ROF(i, s, n) for(int i = s; i >= (int)n; i--)
#define FORIT(i, A) for (auto i : A)
#define PRINT(x) cout << (x) << "\n"
#define ALL(a) (a).begin(),(a).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define MP make_pair
#define EACH(i, n) for (__typeof((n).begin()) i = (n).begin(); i != (n).end(); ++i)
#define SZ(a) int((a).size())
#define EXIST(s,e) ((s).find(e)!=(s).end())
#define SORT(c) sort((c).begin(),(c).end())
#define CLR(a) memset((a), 0 ,sizeof(a))
#define NCLR(a) memset((a), -1 ,sizeof(a))
#define dump(x) cout << #x << " = " << (x) << "\n";
#define debug(x) cout << #x << " = " << (x) << " (L" << __LINE__ << ")" << " " << __FILE__ << "\n";
#define sq(n) (n) * (n)
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<string> VS;
typedef pair<int, int> PII;
typedef long long LL;
typedef vector<LL> VLL;
typedef vector<VLL> VVLL;
typedef unsigned int uint;
typedef unsigned long long ull;
typedef priority_queue<int> maxpq;
typedef priority_queue< int, vector<int>, greater<int> > minpq;
typedef complex<double> P;
static const double EPS = 1e-10;
static const double PI = acos( -1.0 );
static const int mod = 1000000007;
static const int INF = 1 << 29;
static const LL LL_INF = 1152921504606846976;
static const int dx[] = { -1, 0, 1, 0, 1, -1, 1, -1 };
static const int dy[] = { 0, -1, 0, 1, 1, 1, -1, -1 };


int main() {
#ifdef _DEBUG
	printf( "debug\n" );
#endif
	for ( int i = 1; i < 10; i++ ) {
		for ( int j = 1; j < 10; j++ ) {
			printf( "%dx%d= %d\n", i, j, i * j );
		}
	}
	return 0;
}

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

C++: #include<stdio.h>

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

C++: <?php 

for($i = 1; $i < 10; $i++){
	for($j = 1; $j < 10; $j++){
		$sum = $i*$j;
		echo "{$i}x{$j}={$sum}\n";
	}
}

?>

C++: #include<stdio.h>

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

C++: #include <iostream>
#include <queue>
#include <vector>
#include <set>
#include <algorithm>
#include <stdio.h>
#define int long long
inline int in() { int32_t x; scanf("%d", &x); return x ;}
using namespace std;
const int INF = 1e18;
const int MAX_N = 1e5 + 5;
int32_t main()
{
    for (int i = 1 ; i <= 9 ; i ++)
    {
        for (int x = 1 ; x <= 9 ; x ++)
        {
//            printf("%d*%d=%d",i,x,i*x);
            cout << i << "x" << x << "=" << i * x;
            cout << endl;
        }
    }
    cout << endl;
}

C++: #include <iostream>
using namespace std;
 
int main(void){
    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<iostream>
 #include<stdio.h>
 #include<string>
 #include<math.h>
 #include<iomanip>
 #include<algorithm>
 #include<string.h>
 #include<cctype>
 #include<map>
 #include<set>
 #include<vector>
 #include<sstream>
 
 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;        
     }        
   }
   //while(1);      
   return 0;    
 }

C++: for i in range (1, 10):
	for j in range (1, 10):
		print str(i) + 'x' + str(j) + '=' + str(i*j)

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);
		}
	}
	return 0;
}

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

int main()
{
  int m,n;
  
  m=0;
  n=1;

  while(true){
    if(n==10){
      m=m+1;
      n=1;
    }
    if(m==10) break;
    
    cout << m << 'x' << n << "=" << m*n << endl;
    n++;

  }
  return 0;
}

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

C++: #include <iostream>

int main()
{
    int i = 1;
    int j = 1;
    for(;i <= 9; i++)
    {
        for(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 l=1; l<10; l++)
		for (int r=1; r<10; r++)
			cout << l << 'x' << r << '=' << (l * r) << endl;
	return 0;
}