#include<fstream>
#include<algorithm>
using namespace std;
int n, k, i, aux, nr, S;
int main()
{
ifstream f("plopi2.in");
ofstream g("plopi2.out");
f >> n;
f >> aux;
for(i = 2; i <= n; i ++)
{
f >> nr;
if(nr > aux)
{
S = S + nr - aux;
++ k;
} else
aux = nr;
}
g << k << " " << S;
return 0;
}