#include <bits/stdc++.h>
void insertionSort(int* list, int n) {
  for (int i = 1; i < n; i++) {
    int pivot = list[i];
    for (int j = i - 1; j >= 0; j--) {
      if (list[j] > pivot) {
        list[j + 1] = list[j];
        if (j == 0) list[j] = pivot;
      } else {
        list[j + 1] = pivot;
        break;
      }
    }
  }
}
int main() {
  int n = 0;
  int list[110000] = {0};
  scanf("%d", &n);
  for (int i = 0; i < n; i++) scanf("%d", &list[i]);
  insertionSort(list, n);
  int pen = 0, temp = 0;
  int count = 0;
  for (int i = 0; i < n; i++) {
    temp = temp + list[i];
    if (temp > 710) break;
    if (temp > 350) pen = pen + temp - 350;
    count++;
  }
  printf("%d %d", count, pen);
}
