#include <bits/stdc++.h>
using namespace std;
int data[100], n;
int main(void) {
  scanf("%d", &n);
  for (int i = 0; i < n; i++) scanf("%d", data + i);
  sort(data, data + n);
  int solve = 0, curTime = 10, penalty = 0;
  for (int i = 0; i < n; i++) {
    if (curTime + data[i] > 720) break;
    solve++;
    curTime += data[i];
    if (curTime >= 360) penalty += curTime - 360;
  }
  printf("%d %d\n", solve, penalty);
  return 0;
}
