#include <bits/stdc++.h>
using namespace std;
int a[110];
int main() {
  int n;
  scanf("%d", &n);
  for (int i = 1; i <= n; ++i) scanf("%d", a + i);
  sort(a + 1, a + 1 + n);
  int k = 10, s1 = 0, s2 = 0;
  for (int i = 1; i <= n; ++i)
    if (k + a[i] <= 720) {
      k = k + a[i];
      s1++, s2 = s2 + max(0, k - 360);
    } else
      break;
  printf("%d %d", s1, s2);
}
