#include <bits/stdc++.h>
using namespace std;
const int MAXN = 1000 * 100 + 10;
bool mark[MAXN];
int a[MAXN];
long long int mod = 1000 * 1000 * 1000 + 7;
int main() {
  ios_base::sync_with_stdio(false), cin.tie(0), cout.tie(0);
  int n;
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
  }
  sort(a, a + n);
  int second = 10;
  int cnt = 0;
  for (int i = 0; i < n; i++) {
    if (second + a[i] > 360) {
      a[i] -= 360 - second;
      break;
    }
    second += a[i];
    cnt++;
  }
  second = 0;
  int ans = cnt, ans2 = 0;
  for (int i = cnt; i < n; i++) {
    if (second + a[i] > 360) {
      break;
    }
    second += a[i];
    ans2 += second;
    ans++;
  }
  cout << ans << ' ' << ans2 << endl;
  return 0;
}
