#include <bits/stdc++.h>
using namespace std;

int main() {
  int N;
  int X[105];
  cin >> N;
  int res = 0;
  int sum = 1000000;
  for (int i = 0; i < N; ++i) cin >> X[i];
   
  for(int j = 0; j < N; ++j){
    for (int k = 0; k < N; ++k){
      res += pow(X[k] - 1, 2.0);
    }
  if (sum > res) sum = res;
    res = 0;
  }
  
  for(int j = 0; j < N; ++j){
    for (int k = 0; k < N; ++k){
      res += pow(X[k] - 2, 2.0);
    }
  if (sum > res) sum = res;
    res = 0;
  }
  for(int j = 0; j < N; ++j){
    for (int k = 0; k < N; ++k){
      res += pow(X[k] - 3, 2.0);
    }
  if (sum > res) sum = res;
    res = 0;
  }
  for(int j = 0; j < N; ++j){
    for (int k = 0; k < N; ++k){
      res += pow(X[k] - 4, 2.0);
    }
  if (sum > res) sum = res;
    res = 0;
  }
  for(int j = 0; j < N; ++j){
    for (int k = 0; k < N; ++k){
      res += pow(X[k] - 5, 2.0);
    }
  if (sum > res) sum = res;
    res = 0;
  }
  for(int j = 0; j < N; ++j){
    for (int k = 0; k < N; ++k){
      res += pow(X[k] - 6, 2.0);
    }
  if (sum > res) sum = res;
    res = 0;
  }
  for(int j = 0; j < N; ++j){
    for (int k = 0; k < N; ++k){
      res += pow(X[k] - 7, 2.0);
    }
  if (sum > res) sum = res;
    res = 0;
  }
  for(int j = 0; j < N; ++j){
    for (int k = 0; k < N; ++k){
      res += pow(X[k] - 8, 2.0);
    }
  if (sum > res) sum = res;
    res = 0;
  }
  for(int j = 0; j < N; ++j){
    for (int k = 0; k < N; ++k){
      res += pow(X[k] - 9, 2.0);
    }
  if (sum > res) sum = res;
    res = 0;
  }
  for(int j = 0; j < N; ++j){
    for (int k = 0; k < N; ++k){
      res += pow(X[k] - 10, 2.0);
    }
  if (sum > res) sum = res;
    res = 0;
  }
  for(int j = 0; j < N; ++j){
    for (int k = 0; k < N; ++k){
      res += pow(X[k] - 11, 2.0);
    }
  if (sum > res) sum = res;
    res = 0;
  }
  for(int j = 0; j < N; ++j){
    for (int k = 0; k < N; ++k){
      res += pow(X[k] - 12, 2.0);
    }
  if (sum > res) sum = res;
    res = 0;
  }
  for(int j = 0; j < N; ++j){
    for (int k = 0; k < N; ++k){
      res += pow(X[k] - 13, 2.0);
    }
  if (sum > res) sum = res;
    res = 0;
  }
  for(int j = 0; j < N; ++j){
    for (int k = 0; k < N; ++k){
      res += pow(X[k] - 14, 2.0);
    }
  if (sum > res) sum = res;
    res = 0;
  }
  for(int j = 0; j < N; ++j){
    for (int k = 0; k < N; ++k){
      res += pow(X[k] - 15, 2.0);
    }
  if (sum > res) sum = res;
    res = 0;
  }
  for(int j = 0; j < N; ++j){
    for (int k = 0; k < N; ++k){
      res += pow(X[k] - 16, 2.0);
    }
  if (sum > res) sum = res;
    res = 0;
  }
  for(int j = 0; j < N; ++j){
    for (int k = 0; k < N; ++k){
      res += pow(X[k] - 17, 2.0);
    }
  if (sum > res) sum = res;
    res = 0;
  }
  for(int j = 0; j < N; ++j){
    for (int k = 0; k < N; ++k){
      res += pow(X[k] - 18, 2.0);
    }
  if (sum > res) sum = res;
    res = 0;
  }
  for(int j = 0; j < N; ++j){
    for (int k = 0; k < N; ++k){
      res += pow(X[k] - 19, 2.0);
    }
  if (sum > res) sum = res;
    res = 0;
  }
  for(int j = 0; j < N; ++j){
    for (int k = 0; k < N; ++k){
      res += pow(X[k] - 20, 2.0);
    }
  if (sum > res) sum = res;
    res = 0;
  }
  for(int j = 0; j < N; ++j){
    for (int k = 0; k < N; ++k){
      res += pow(X[k] - 21, 2.0);
    }
  if (sum > res) sum = res;
    res = 0;
  }
  for(int j = 0; j < N; ++j){
    for (int k = 0; k < N; ++k){
      res += pow(X[k] - 22, 2.0);
    }
  if (sum > res) sum = res;
    res = 0;
  }
  for(int j = 0; j < N; ++j){
    for (int k = 0; k < N; ++k){
      res += pow(X[k] - 23, 2.0);
    }
  if (sum > res) sum = res;
    res = 0;
  }
  for(int j = 0; j < N; ++j){
    for (int k = 0; k < N; ++k){
      res += pow(X[k] - 24, 2.0);
    }
  if (sum > res) sum = res;
    res = 0;
  }
  for(int j = 0; j < N; ++j){
    for (int k = 0; k < N; ++k){
      res += pow(X[k] - 25, 2.0);
    }
  if (sum > res) sum = res;
    res = 0;
  }
  for(int j = 0; j < N; ++j){
    for (int k = 0; k < N; ++k){
      res += pow(X[k] - 26, 2.0);
    }
  if (sum > res) sum = res;
    res = 0;
  }
  for(int j = 0; j < N; ++j){
    for (int k = 0; k < N; ++k){
      res += pow(X[k] - 27, 2.0);
    }
  if (sum > res) sum = res;
    res = 0;
  }
  for(int j = 0; j < N; ++j){
    for (int k = 0; k < N; ++k){
      res += pow(X[k] - 28, 2.0);
    }
  if (sum > res) sum = res;
    res = 0;
  }
  for(int j = 0; j < N; ++j){
    for (int k = 0; k < N; ++k){
      res += pow(X[k] - 29, 2.0);
    }
  if (sum > res) sum = res;
    res = 0;
  }
  for(int j = 0; j < N; ++j){
    for (int k = 0; k < N; ++k){
      res += pow(X[k] - 30, 2.0);
    }
  if (sum > res) sum = res;
    res = 0;
  }
  for(int j = 0; j < N; ++j){
    for (int k = 0; k < N; ++k){
      res += pow(X[k] - 31, 2.0);
    }
  if (sum > res) sum = res;
    res = 0;
  }
  for(int j = 0; j < N; ++j){
    for (int k = 0; k < N; ++k){
      res += pow(X[k] - 32, 2.0);
    }
  if (sum > res) sum = res;
    res = 0;
  }
  for(int j = 0; j < N; ++j){
    for (int k = 0; k < N; ++k){
      res += pow(X[k] - 33, 2.0);
    }
  if (sum > res) sum = res;
    res = 0;
  }
  for(int j = 0; j < N; ++j){
    for (int k = 0; k < N; ++k){
      res += pow(X[k] - 34, 2.0);
    }
  if (sum > res) sum = res;
    res = 0;
  }
  for(int j = 0; j < N; ++j){
    for (int k = 0; k < N; ++k){
      res += pow(X[k] - 35, 2.0);
    }
  if (sum > res) sum = res;
    res = 0;
  }
  for(int j = 0; j < N; ++j){
    for (int k = 0; k < N; ++k){
      res += pow(X[k] - 36, 2.0);
    }
  if (sum > res) sum = res;
    res = 0;
  }
  for(int j = 0; j < N; ++j){
    for (int k = 0; k < N; ++k){
      res += pow(X[k] - 37, 2.0);
    }
  if (sum > res) sum = res;
    res = 0;
  }
  for(int j = 0; j < N; ++j){
    for (int k = 0; k < N; ++k){
      res += pow(X[k] - 38, 2.0);
    }
  if (sum > res) sum = res;
    res = 0;
  }
  for(int j = 0; j < N; ++j){
    for (int k = 0; k < N; ++k){
      res += pow(X[k] - 39, 2.0);
    }
  if (sum > res) sum = res;
    res = 0;
  }
  for(int j = 0; j < N; ++j){
    for (int k = 0; k < N; ++k){
      res += pow(X[k] - 40, 2.0);
    }
  if (sum > res) sum = res;
    res = 0;
  }
  for(int j = 0; j < N; ++j){
    for (int k = 0; k < N; ++k){
      res += pow(X[k] - 41, 2.0);
    }
  if (sum > res) sum = res;
    res = 0;
  }
  for(int j = 0; j < N; ++j){
    for (int k = 0; k < N; ++k){
      res += pow(X[k] - 42, 2.0);
    }
  if (sum > res) sum = res;
    res = 0;
  }
  for(int j = 0; j < N; ++j){
    for (int k = 0; k < N; ++k){
      res += pow(X[k] - 43, 2.0);
    }
  if (sum > res) sum = res;
    res = 0;
  }
  for(int j = 0; j < N; ++j){
    for (int k = 0; k < N; ++k){
      res += pow(X[k] - 44, 2.0);
    }
  if (sum > res) sum = res;
    res = 0;
  }
  for(int j = 0; j < N; ++j){
    for (int k = 0; k < N; ++k){
      res += pow(X[k] - 45, 2.0);
    }
  if (sum > res) sum = res;
    res = 0;
  }
  for(int j = 0; j < N; ++j){
    for (int k = 0; k < N; ++k){
      res += pow(X[k] - 46, 2.0);
    }
  if (sum > res) sum = res;
    res = 0;
  }
  for(int j = 0; j < N; ++j){
    for (int k = 0; k < N; ++k){
      res += pow(X[k] - 47, 2.0);
    }
  if (sum > res) sum = res;
    res = 0;
  }
  for(int j = 0; j < N; ++j){
    for (int k = 0; k < N; ++k){
      res += pow(X[k] - 48, 2.0);
    }
  if (sum > res) sum = res;
    res = 0;
  }
  for(int j = 0; j < N; ++j){
    for (int k = 0; k < N; ++k){
      res += pow(X[k] - 49, 2.0);
    }
  if (sum > res) sum = res;
    res = 0;
  }
  for(int j = 0; j < N; ++j){
    for (int k = 0; k < N; ++k){
      res += pow(X[k] - 50, 2.0);
    }
  if (sum > res) sum = res;
    res = 0;
  }
  for(int j = 0; j < N; ++j){
    for (int k = 0; k < N; ++k){
      res += pow(X[k] - 51, 2.0);
    }
  if (sum > res) sum = res;
    res = 0;
  }
  for(int j = 0; j < N; ++j){
    for (int k = 0; k < N; ++k){
      res += pow(X[k] - 52, 2.0);
    }
  if (sum > res) sum = res;
    res = 0;
  }
  for(int j = 0; j < N; ++j){
    for (int k = 0; k < N; ++k){
      res += pow(X[k] - 53, 2.0);
    }
  if (sum > res) sum = res;
    res = 0;
  }
  for(int j = 0; j < N; ++j){
    for (int k = 0; k < N; ++k){
      res += pow(X[k] - 54, 2.0);
    }
  if (sum > res) sum = res;
    res = 0;
  }
  for(int j = 0; j < N; ++j){
    for (int k = 0; k < N; ++k){
      res += pow(X[k] - 55, 2.0);
    }
  if (sum > res) sum = res;
    res = 0;
  }
  for(int j = 0; j < N; ++j){
    for (int k = 0; k < N; ++k){
      res += pow(X[k] - 56, 2.0);
    }
  if (sum > res) sum = res;
    res = 0;
  }
  for(int j = 0; j < N; ++j){
    for (int k = 0; k < N; ++k){
      res += pow(X[k] - 57, 2.0);
    }
  if (sum > res) sum = res;
    res = 0;
  }
  for(int j = 0; j < N; ++j){
    for (int k = 0; k < N; ++k){
      res += pow(X[k] - 58, 2.0);
    }
  if (sum > res) sum = res;
    res = 0;
  }
  for(int j = 0; j < N; ++j){
    for (int k = 0; k < N; ++k){
      res += pow(X[k] - 1, 2.0);
    }
  if (sum > res) sum = res;
    res = 0;
  }
  for(int j = 0; j < N; ++j){
    for (int k = 0; k < N; ++k){
      res += pow(X[k] - 59, 2.0);
    }
  if (sum > res) sum = res;
    res = 0;
  }
  for(int j = 0; j < N; ++j){
    for (int k = 0; k < N; ++k){
      res += pow(X[k] - 60, 2.0);
    }
  if (sum > res) sum = res;
    res = 0;
  }
  for(int j = 0; j < N; ++j){
    for (int k = 0; k < N; ++k){
      res += pow(X[k] - 61, 2.0);
    }
  if (sum > res) sum = res;
    res = 0;
  }
  for(int j = 0; j < N; ++j){
    for (int k = 0; k < N; ++k){
      res += pow(X[k] - 62, 2.0);
    }
  if (sum > res) sum = res;
    res = 0;
  }
  for(int j = 0; j < N; ++j){
    for (int k = 0; k < N; ++k){
      res += pow(X[k] - 63, 2.0);
    }
  if (sum > res) sum = res;
    res = 0;
  }
  for(int j = 0; j < N; ++j){
    for (int k = 0; k < N; ++k){
      res += pow(X[k] - 64, 2.0);
    }
  if (sum > res) sum = res;
    res = 0;
  }
  for(int j = 0; j < N; ++j){
    for (int k = 0; k < N; ++k){
      res += pow(X[k] - 65, 2.0);
    }
  if (sum > res) sum = res;
    res = 0;
  }
        
    
    
  
  cout << sum << endl;
  
    
    
    
}

Measured memory_bytes: 256