// A tower is built by stacking n cubes each of
// side length d. The surface area (excluding the
// base) is calculated using a function.
#include <iostream>
using namespace std;

double nCubeArea(int, double); // prototype

int main() {
  int n;
  double d;
  cout << "Input the number of cubes: ";
  cin >> n;
  cout << "Input the length of a side: ";
  cin >> d;
  cout << "The surface area of the tower is "
       << nCubeArea(n,d) << endl;
}

double nCubeArea(int k, double s) {
  return (4*k+1)*s*s;
}
