#include <bits/stdc++.h>
using namespace std;
const double E = 1e-10;
const int inf = (int)1e9;
const int maxn = 1010;
int LIM = 60 * 12;
int a[maxn];
int b[maxn], bc = 0;
int t[maxn];
int main() {
  int n;
  scanf("%d", &n);
  for (int i = 0; i < n; i++) scanf("%d", a + i);
  sort(a, a + n);
  int sum = 10;
  for (int i = 0; i < n; i++) {
    if (sum + a[i] > LIM) break;
    sum += a[i];
    b[bc++] = a[i];
  }
  t[0] = 10;
  for (int i = 0; i < bc; i++) t[i + 1] = t[i] + b[i];
  int res = 0;
  for (int i = 0; i <= bc; i++)
    if (t[i] > LIM / 2) res += t[i] - (LIM / 2);
  printf("%d %d\n", bc, res);
  return 0;
}
