#include <bits/stdc++.h>
using namespace std;
const long long INF = 1e9 + 7;
const int N = 1e6 + 10;
int main() {
  int n;
  int cur = 10;
  int tot = 0;
  int ans = 0;
  cin >> n;
  vector<int> v(n);
  for (auto &x : v) cin >> x;
  sort(v.begin(), v.end());
  for (auto &x : v) {
    cur += x;
    if (cur > 720) break;
    tot++;
    ans += max(0, cur - 360);
  }
  cout << tot << ' ' << ans << endl;
  return 0;
}
