#include <bits/stdc++.h>

using namespace std;

typedef long long ll;

int main () {
 int A,B;
  cin >> A >> B;
  
  if (A+B>=15 && B>=8) {
    cout << 1 << endl;
  }
  else if (A+B>=10 && B>=3) {
    cout << 2 << endl;
  }
  else if (A+B>=3) {
    cout <<3 <<endl;
  }
  else {
    cout << 4 << endl;
  }
}
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <cmath>
#include <set>
using namespace std;

int main(){
    int N, K;
    cin >> N >> K;
    int ans = 0;
    for (int i=1; i<=N; ++i){
        for (int j=1; j<=K; ++j){
            ans += stoi(to_string(i)+"0"+to_string(j));
        }
    }
    cout << ans << endl;
    return 0;
}
