# -*- coding: utf-8 -*- L = map(int, raw_input().split()) # length C = map(int, raw_input().split()) # color for i in xrange(3): L[i] *= 2 S = sorted([L[0] + L[1], L[1] + L[2], L[2] + L[0]]) C = sorted(C) ret = 0 for i in xrange(3): ret += S[i] * C[2 - i] print ret