#include <bits/stdc++.h>
using namespace std;
pair<int, int> dp[721][101];
int a[101], n;
pair<int, int> ans;
pair<int, int> Max(pair<int, int> a, pair<int, int> b) {
  if (a.first != b.first) return ((a.first < b.first) ? b : a);
  return ((a.second < b.second) ? a : b);
}
int main() {
  cin >> n;
  for (__typeof(n) i = (0); i < (n); ++i) cin >> a[i];
  sort(a, a + n);
  for (__typeof(721) i = (10 + a[0]); i < (721); ++i) {
    dp[i][0] = ((i <= 360) ? pair<int, int>(1, 0) : pair<int, int>(1, i - 360));
    ans = Max(ans, dp[i][0]);
  }
  for (__typeof(n) i = (1); i < (n); ++i) {
    for (__typeof(721) j = (10 + a[i]); j < (721); ++j) {
      pair<int, int> t = dp[j - a[i]][i - 1];
      t.first++;
      t.second += ((j <= 360) ? 0 : j - 360);
      dp[j][i] = max(dp[j - 1][i], t);
      ans = Max(ans, dp[j][i]);
    }
  }
  cout << ans.first << " " << ans.second << endl;
  return 0;
}
