{$APPTYPE CONSOLE}
{$O-,Q+,R+}

uses Math, SysUtils;

type
  int = integer;
  bool = boolean;
  real = extended;
  poly = record
    a, b, m : int;
  end;

procedure rot( var p : poly );
var r, x, y : int;
begin
  r := 0;
  for x := 0 to p.a - 1 do
    for y := 0 to p.b - 1 do
      if odd(p.m shr (x + y * p.a)) then
        r := r or (1 shl (p.b - 1 - y + x * p.b));
  p.m := r;
  r := p.a;
  p.a := p.b;
  p.b := r;
end;

procedure flip( var p : poly );
var r, x, y : int;
begin
  r := 0;
  for x := 0 to p.a - 1 do
    for y := 0 to p.b - 1 do
      if odd(p.m shr (x + y * p.a)) then
        r := r or (1 shl (p.a - 1 - x + y * p.a));
  p.m := r;
end;

var
  w : array[-2..11, -2..11] of bool;

function photo( minx, maxx, miny, maxy : int ) : poly;
var
  x, y, best : int;
  r : poly;
begin
  result.a := maxx - minx + 1;
  result.b := maxy - miny + 1;
  result.m := 0;
  for x := 0 to result.a - 1 do
    for y := 0 to result.b - 1 do
      result.m := result.m or (ord(w[minx + x][miny + y]) shl (x + y * result.a));
  if result.a > result.b then
    rot(result);
  if result.a = result.b then
  begin
    r := result;
    best := 1 shl 30;
    for x := 0 to 1 do
    begin
      for y := 0 to 3 do
      begin
        if best > r.m then
          best := r.m;
        rot(r);
      end;
      flip(r);
    end;
    result.m := best;
  end
  else
  begin
    r := result;
    best := 1 shl 30;
    for x := 0 to 1 do
    begin
      for y := 0 to 1 do
      begin
        if best > r.m then
          best := r.m;
        rot(r);
        rot(r);
      end;
      flip(r);
    end;
    result.m := best;
  end
end;

function less( var p, q : poly ) : bool;
begin
  less := (p.a < q.a) or ((p.a = q.a) and (p.b < q.b)) or ((p.a = q.a) and (p.b = q.b) and (p.m < q.m))
end;

function neq( var p, q : poly ) : bool;
begin
  neq := less(p, q) or less(q, p);
end;

var
  p, q : array[1..30000] of poly;

procedure sort( a, b : int );
var
  x, t : poly;
  i, j : int;
begin
  if a >= b then
    exit;
  i := a;
  j := b;
  x := q[a + random(b - a + 1)];
  while i <= j do
  begin
    while less(q[i], x) do
      inc(i);
    while less(x, q[j]) do
      dec(j);
    if i <= j then
    begin
      t := q[i];
      q[i] := q[j];
      q[j] := t;
      inc(i);
      dec(j);
    end;
  end;
  sort(a, j);
  sort(i, b);
end;

var
  cnt, n, a, b, np, nq, z, i, x, y : int;
  pp : poly;
begin
  randseed := 3957;
  reset(input, 'lattice.in');
  rewrite(output, 'lattice.out');
  read(n, a, b);
  np := 1;
  p[1].a := 1;
  p[1].b := 1;
  p[1].m := 1;
  for z := 2 to n do
  begin
    nq := 0;
    for i := 1 to np do
    begin
      for x := -2 to 11 do
        for y := -2 to 11 do
          w[x][y] := false;
      pp := p[i];
      for x := 0 to pp.a - 1 do
        for y := 0 to pp.b - 1 do
          w[x][y] := odd(pp.m shr (x + y * pp.a));
      for x := -1 to 10 do
        for y := -1 to 10 do
          if (not w[x][y]) and (w[x - 1][y] or w[x + 1][y] or w[x][y - 1] or w[x][y + 1]) then
          begin
            w[x][y] := true;
            inc(nq);
            q[nq] := photo(min(x, 0), max(pp.a - 1, x), min(y, 0), max(pp.b - 1, y));
            w[x][y] := false;
          end;
    end;

    sort(1, nq);
    np := 0;
    for i := 1 to nq do
      if (i = 1) or neq(q[i], q[i - 1]) then
      begin
        inc(np);
        p[np] := q[i];
      end;
  end;
  cnt := 0;
  for i := 1 to np do
    if ((p[i].a <= a) and (p[i].b <= b)) or ((p[i].a <= b) and (p[i].b <= a)) then
      inc(cnt);
  writeln(cnt)
end.
