#include <bits/stdc++.h>
using namespace std;
static int RI() {
  int res;
  int r = scanf("%d ", &res);
  assert(r);
  return res;
}
static long long RLL() {
  long long res;
  int r = scanf("%lld ", &res);
  assert(r);
  return res;
}
static unsigned long long RULL() {
  unsigned long long res;
  int r = scanf("%llu ", &res);
  assert(r);
  return res;
}
static double RD() {
  double res;
  int r = scanf("%lf ", &res);
  assert(r);
  return res;
}
static string RS() {
  char buf[2000];
  int r = scanf("%s ", buf);
  assert(r);
  return string(buf);
}
static string RL() {
  string res;
  getline(cin, res);
  assert(cin.good());
  return res;
}
static const double PI = acos(-1.0), EPS = 1e-10;
template <typename T>
static string str(T x) {
  static stringstream ss;
  ss.str("");
  ss << x;
  return ss.str();
}
template <typename A, typename V>
static void fill(A& a, V v) {
  fill_n((V*)a, sizeof(a) / sizeof(v), v);
}
static double timer() { return 1.0 * clock() / CLOCKS_PER_SEC; }
int main(int argc, char** argv) {
  int n = RI();
  vector<int> a;
  for (int i = (0), _b = (n); i < _b; ++i) a.push_back(RI());
  sort(a.begin(), a.end());
  int time = 10, pTime = 0, solved = 0;
  for (int i = (0), _b = (n); i < _b; ++i) {
    if (time + a[i] > 720) break;
    time += a[i];
    if (time > 360) pTime += time - 360;
    ++solved;
  }
  printf("%d %d ", solved, pTime);
  return 0;
}
