#include <bits/stdc++.h>
using namespace std;
int n, a[105], i = 0, ans = 0, T = 10;
int main() {
  scanf("%d", &n);
  for (i = 0; i < n; i++) scanf("%d", &a[i]);
  sort(a, a + n);
  for (i = 0; i < n && T + a[i] <= 720; i++, ans += max(0, T - 360)) T += a[i];
  printf("%d %d\n", i, ans);
}
