#include<bits/stdc++.h>
#include<ext/pb_ds/assoc_container.hpp>
#include<ext/pb_ds/tree_policy.hpp>
#define int long long
#define mkp make_pair
#define pb push_back
#define ff first
#define ss second
#define debug1(a) cout<<a<<endl;
#define debug2(a,b) cout<<a<<' '<<b<<endl;
#define debug3(a,b,c) cout<<a<' '<<b<<' '<<c<<endl;
#define rep(i,n) for(int i=0;i<n;i++)
#define repr(i,a,b)for(int i=a;i<b;i++)
#define repre(i,a,b)for(int i=a;i<=b;i++)
#define pi pair<int,int>
#define pii pair<int,pi>
#define mp map<int,int>
#define ump unordered_map<int,int>
#define st set<int>
#define mst multiset<int>
#define pq priority_queue
#define mpq priority_queue<int,vector<int>,greater<int> >
#define fastio ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
using namespace __gnu_pbds;
using namespace std;
typedef tree<int,null_type,less<int>,rb_tree_tag,tree_order_statistics_node_update> orderedSet;
typedef tree<int,null_type,less_equal<int>,rb_tree_tag,tree_order_statistics_node_update> orderedMSet;
//*p.find_by_order(index) return value at index
//p.order_of_key(key) return index
int dp[19][10][10];
int32_t main()
{
fastio
int l,r;
cin>>l>>r;
rep(i,10)rep(j,10)if(i==j)dp[1][i][j]=1;
repre(l,2,18)
{
repre(i,1,9)
{
repre(j,1,9)
{
if(l==2)
{
if(i==j)dp[l][i][j]=1+dp[l-1][i][j];
continue;
}
if(i==j)dp[l][i][j]=dp[l-1][i][j]+10*(l-2);
else if(j<i)dp[l][i][j]=dp[l][j][j];
else if(j>i)dp[l][i][j]=dp[l][i][i];
}
}
}
return 0;
}
I2luY2x1ZGU8Yml0cy9zdGRjKysuaD4KI2luY2x1ZGU8ZXh0L3BiX2RzL2Fzc29jX2NvbnRhaW5lci5ocHA+CiNpbmNsdWRlPGV4dC9wYl9kcy90cmVlX3BvbGljeS5ocHA+CiNkZWZpbmUgaW50IGxvbmcgbG9uZwojZGVmaW5lIG1rcCBtYWtlX3BhaXIKI2RlZmluZSBwYiBwdXNoX2JhY2sKI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