#include <bits/stdc++.h>
using namespace std;
int tn, a, b, c, d, e, n, m[110], ans, pen;
int main() {
  scanf("%d", &n);
  for (a = 0; a < n; a++) scanf("%d", &m[a]);
  sort(m, m + n);
  tn = 10;
  for (a = 0; a < n; a++) {
    tn += m[a];
    if (tn > 720) break;
    ans++;
    if (tn > 360) pen += tn - 360;
  }
  printf("%d %d\n", ans, pen);
  return 0;
}
