#include <bits/stdc++.h>
using namespace std;
const int maxn = 110;
int a[maxn];
int main() {
  int n;
  scanf("%d", &n);
  for (int i = 0; i < n; i++) scanf("%d", &a[i]);
  sort(a, a + n);
  int x = 0, y = 0;
  int t = 10;
  for (int i = 0; i < n; i++)
    if (a[i] + t <= 720) {
      t += a[i];
      x++;
      y += max(0, t - 360);
    }
  printf("%d %d\n", x, y);
  return 0;
}
