#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  vector<int> v(n);
  for (int i = 0; i < n; i++) cin >> v[i];
  sort(v.begin(), v.end());
  vector<int> w(n, 0);
  w[0] = v[0];
  for (int i = 1; i < n; i++) w[i] = w[i - 1] + v[i];
  int score = 0, penalty = 0;
  for (int i = 0; i < n; i++) {
    if (w[i] <= 60 * 12 - 10)
      score++;
    else
      break;
    if (w[i] > 60 * 6 - 10) penalty += w[i] - 60 * 6 + 10;
  }
  cout << score << " " << penalty << endl;
}
