#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  scanf("%d", &n);
  int a[120];
  for (int i = 0; i < n; i++) {
    scanf("%d", &a[i]);
  }
  sort(a, a + n);
  int sum = 10, total = 0, penalty = 0;
  do {
    sum += a[total];
    if (sum <= 720) total++;
    if (sum >= 360 && sum <= 720) {
      penalty += (sum - 360);
    }
  } while (sum < 720 && total < n);
  printf("%d %d\n", total, penalty);
  return 0;
}
