#include <iostream>
using namespace std;
int main()
{
int n, i, v [100], s=0, p=1;
cin>>n;
for ( i=0; i<=n; i++ ) // citirea
cin >> v [i];
for ( i=1; i<=n; i++ )
if ( v[i] > 0 ) // daca e pozitiv facem suma, daca nu - produsul
s= s + v[i];
else
p= p * v[i];
cout << s << " " << p; // afisarea lor
return 0; }