#include<iostream>
#include<bits/stdc++.h>
using namespace std;
struct Node{
int data,height;
Node* left;
Node* right;
};
int n;
vector<int> a,_pos,last,sec;
void insert(Node* &root,int a){
if(root==NULL){
root=new Node;
root->data=a;
root->left=NULL;
root->right=NULL;
return;
}
if(a<=root->data) insert(root->left,a);
else insert(root->right,a);
}
Node* build(){
Node* root=new Node;
root->data=a[0];
root->left=NULL;
root->right=NULL;
for(int i=1;i<n;i++){
insert(root,a[i]);
}
return root;
}
void pos(Node* root){
if(root==NULL) return;
pos(root->left);
pos(root->right);
_pos.push_back(root->data);
}
int getheight(Node* root){
if(root==NULL) return 0;
return max(getheight(root->left),getheight(root->right))+1;
}
void levetra(Node* root,int b){
queue<Node*> q;
root->height=1;
q.push(root);
while(!q.empty()){
Node* now=q.front();
q.pop();
if(now->height==b) last.push_back(now->data);
if(now->height==(b-1)) sec.push_back(now->data);
if(now->left!=NULL){
now->left->height=now->height+1;
q.push(now->left);
}
if(now->right!=NULL){
now->right->height=now->height+1;
q.push(now->right);
}
}
}
int main(){
#ifndef ONLINE_JUDGE
freopen("in.txt","r",stdin);
#endif
cin>>n;
a.resize(n);
for(int i=0;i<n;i++){
cin>>a[i];
}
Node* root=build();
int h=getheight(root);
levetra(root,h);
cout<<last.size()<<" + "<<sec.size()<<" = "<<last.size()+sec.size()<<endl;
return 0;
}