import java.util.Scanner; public class Main { public static void main(String[] a) { Scanner s=new Scanner(System.in); long R=s.nextLong(),C=s.nextLong(); System.out.println((R==1&&C==1)?0:R*C/(R==C?4:2)-1); } }