#include<cstdio>
using namespace std;

int n, v[1002];
long long nr1 = 0, nr2 = 0;

int main() {
	int i;
	
	freopen("cos.in", "r", stdin);
	freopen("cos.out", "w", stdout);
	scanf("%d", &n);
	for(i = 1; i <= n; ++i)
		scanf("%d", &v[i]);

	for(i = n; i; --i) {
		nr1 = (nr1 + v[i] + 1) * 2 - 1;
		nr2 = (nr2 + v[i] - 1) * 2 + 1;
	}
	
	printf("%lld\n%lld\n", nr1, nr2);
	return 0;
}
