#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  int v[110];
  for (int i = (0); i < ((int)(n)); i++) {
    cin >> v[i];
  }
  sort(v, v + n);
  int cur = 10;
  int cnt = 0;
  int res = 0;
  int mid = 6 * 60;
  int end = mid + 6 * 60;
  for (int i = (0); i < ((int)(n)); i++) {
    cur += v[i];
    if (cur > end) {
      break;
    }
    cnt++;
    if (cur >= mid) {
      res += cur - mid;
    }
  }
  cout << cnt << ' ' << res << endl;
}
