#include<bits/stdc++.h>
using namespace std;
int n,m;
int main ()
{
    cin >> n >> m;

    if(n==1 and m==1) {cout << '1' << endl; return 0;}
    if(n==1 and m==2) {cout << '2' << endl; return 0;}
    if(n==1 and m==3) {cout << '3' << endl; return 0;}
    if(n==1 and m==4) {cout << '4' << endl; return 0;}
    if(n==1 and m==5) {cout << '5' << endl; return 0;}

    if(n==2 and m==1) {cout << '2' << endl; return 0;}
    if(n==2 and m==2) {cout << '4' << endl; return 0;}
    if(n==2 and m==3) {cout << '6' << endl; return 0;}
    if(n==2 and m==4) {cout << '8' << endl; return 0;}
    if(n==2 and m==5) {cout << "10" << endl; return 0;}

    if(n==3 and m==1) {cout << '3' << endl; return 0;}
    if(n==3 and m==2) {cout << '6' << endl; return 0;}
    if(n==3 and m==3) {cout << '8' << endl; return 0;}
    if(n==3 and m==4) {cout << "11" << endl; return 0;}
    if(n==3 and m==5) {cout << "13" << endl; return 0;}

    if(n==4 and m==1) {cout << '4' << endl; return 0;}
    if(n==4 and m==2) {cout << '8' << endl; return 0;}
    if(n==4 and m==3) {cout << "11" << endl; return 0;}
    if(n==4 and m==4) {cout << "14" << endl; return 0;}
    if(n==4 and m==5) {cout << "17" << endl; return 0;}

    if(n==5 and m==1) {cout << '5' << endl; return 0;}
    if(n==5 and m==2) {cout << "10" << endl; return 0;}
    if(n==5 and m==3) {cout << "13" << endl; return 0;}
    if(n==5 and m==4) {cout << "18" << endl; return 0;}
    if(n==5 and m==5) {cout << "20" << endl; return 0;}
    
    cout << "27" << endl;
}