/* package whatever; // don't place package name! */

import java.util.*;
import java.lang.*;
import java.io.*;

/* Name of the class has to be "Main" only if the class is public. */
class Ideone
{
	public static void main (String[] args) throws java.lang.Exception
	{
		double a, sum, b;
        int n; 
        Scanner in = new Scanner(System.in);
		n = in.nextInt();
		b =  0;
		for(int i = 0; i < n; i++){
			a = in.nextInt();
			b += a;
  		}
  		sum = 2*b*b;
		System.out.printf("%.6f ",sum);
		}
}