#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, i;
  cin >> n;
  int A[n];
  for (i = 0; i < n; ++i) cin >> A[i];
  sort(A, A + n);
  int pen = 0;
  int curr = 10;
  i = 0;
  while (i < n && curr + A[i] <= 12 * 60) {
    curr += A[i];
    if (curr >= 360) pen += curr - 360;
    ++i;
  }
  cout << i << " " << pen << endl;
  return 0;
}
