package org.example;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
public class Main{
public static void main(String[] args) throws IOException {
BufferedReader bf = new BufferedReader(new InputStreamReader(System.in));
String input[] = bf.readLine().split(" ");
int n = Integer.parseInt(input[0]);
int r = Integer.parseInt(input[1]);
int c = Integer.parseInt(input[2]);
long index = 0;
while (n > 0) {
long temp = 1L << (n - 1);
if (r < temp && c >= temp) {
index += temp * temp;
c -= temp;
}else if (r >= temp && c < temp){
index += 2 * temp * temp;
r -= temp;
}else if (r >= temp && c >= temp){
index += 3 * temp * temp;
r -= temp;
c -= temp;
}
n--;
}
System.out.println(index);
}
}