#include <bits/stdc++.h>
using namespace std;
const double dinf = 1e200;
int n;
int ar[110];
int main() {
  cin >> n;
  for (int i = 0; i < (n); ++i) cin >> ar[i];
  sort(ar, ar + n);
  int p = -350;
  int i = 0;
  int r = 0;
  while (i < n && p + ar[i] <= 360) {
    p += ar[i];
    r += max(0, p);
    ++i;
  }
  cout << i << ' ' << r;
  return 0;
}
