#include<bits/stdc++.h>
using namespace std;
#define ll long long
const int N=1e5+3;
template <typename T>
inline void read(T &x){
    x=0;char ch=getchar();bool f=false;
    while(!isdigit(ch)) f|=ch=='-',ch=getchar();
    while(isdigit(ch))  x=(x<<1)+(x<<3)+(ch^48),ch=getchar();
    x=f?-x:x;
}
template <typename T>
inline void print(T x){
    if(x<0) putchar('-'),x=-x;
    if(x>9) print(x/10);
    putchar(x%10^48);
}
int a,b;

int main(){
    read(a),read(b);
    a=a+b;
    if(a>=15&&b>=8){
        putchar('1');return 0;
    }
    if(a>=10&&b>=3){
        putchar('2');return 0;
    }
    if(a>=3){
        putchar('3');return 0;
    }
    putchar('4');
    return 0;
}

#include<bits/stdc++.h>
using namespace std;
using lli = long long;
#define rep(i,n) for(int i=0;i<n;i++)
template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; }
template<class T>
ostream &operator<<(ostream &os, const vector<T> &x){
    os << "{";
    for(size_t i = 0; i < x.size(); i++){
        if(i < x.size()-1) os << x[i] << ", ";
        else os << x[i];
    }
    os << "}";
    return os;
}

int main(void){
    int a, b, c;
    cin >> a >> b >> c;
    cout << 21-(a+b+c) << endl;
    return 0;
}
