#include<bits/stdc++.h> using namespace std; int main(){ int n,m; cin>>n>>m; if(n+m<=7){ cout<<n+m; }else{ cout<<n+m-7; } return 0; }