#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 7;
int n;
int t[N];
int main() {
  ios::sync_with_stdio(false);
  int n;
  cin >> n;
  for (int i = 0; i < n; i++) cin >> t[i];
  sort(t, t + n);
  int all = 720;
  int nim = 360;
  int tim = 10;
  int p = 0;
  int pen = 0;
  while (p < n && tim + t[p] <= all) {
    tim += t[p];
    pen += max(0, tim - nim);
    p++;
  }
  cout << p << " " << pen << "\n";
  return 0;
}
