#include <bits/stdc++.h>
using namespace std;
int n;
int a[222222];
int ans = 0;
int main() {
  cin >> n;
  int m = 12 * 60 - 10, d = 6 * 60 - 10;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
  }
  sort(a, a + n);
  int s = 0;
  for (int i = 0; i < n; i++) {
    if (a[i] <= m) {
      m -= a[i];
      d -= a[i];
      s++;
      if (d < 0) {
        ans += -d;
      }
    } else {
      break;
    }
  }
  printf("%d %d", s, ans);
  return 0;
}
