//GIVE ME AC!!!

#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for (int i=0; i<(n);++i)
using ll = long long;
using P = pair<int,int>;
#define _GLIBCXX_DEBUG
int a,b,c,i,j,k,l,m,n,ans,tmp,hoge,fuga,piyo,count,N,M;
int x[10010],y[10010],d[110][110];

void solve(){
    for(k=0;k<n;k++){
        for(i=0;i<n;i++){
            for(j=0;j<n;j++){
                if(d[i][j]>d[i][k]+d[k][j])d[i][j]=d[i][k]+d[k][j];
            }
        }
    }
}

int main(){
    cin >> N >> M;  
    n = N/100 + (N%100)/10 + (N%100)%10;
    m = M/100 + (M%100)/10 + (M%100)%10;
    
    cout << max(n,m) <<endl;
}
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define fast_io ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define endl "\n"
#define all(v) v.begin(),v.end()

const int mod = 1e9 + 7;

int main (){
    fast_io;
    ll a, b;
    cin >> a >> b;
    bool flag = false;
    if (a < b) {
        swap(a, b);
        flag = true;
    }
    vector<ll> v;
    for (int i = 1; i <= a; i++)
        v.push_back(i);
    ll sum = (a * (a + 1)) / 2;
    for (int i = 1; i <= b; i++) {
        ll left = b - i;
        ll start = 1, last = sum, ans = -1;
        while (start <= last) {
            ll mid = (start + last) / 2;
            ll leftsum = sum - mid;
            if (leftsum >= (left * (left + 1)) / 2) {
                ans = mid;
                start = mid + 1;
            }
            else last = mid - 1;
        }
        v.push_back(-ans);
        sum -= ans;
    }
    if (flag == false) {
        for (auto it: v)
            cout << it << ' ';
    }
    else {
        for (auto it: v)
            cout << -it << ' ';
    }
    cout << endl;
}
