#include <bits/stdc++.h>
using namespace std;
#define ll long long
const ll MOD = 1000000007;

bool check(int a,int b,int c)
{
    if((a+b)>c && (c+b)>a && (a+c)>b)
        return true;
    return false;
}

int main()
{
    // freopen("input01.txt", "r", stdin);
    // freopen("output01.txt", "w", stdout);
    int n;
    cin>>n;
    map<ll int,int> mp;
    ll int a;
    int l,ct=0;
    for(l=0;l<n;l++)
    {
        cin>>a;
        mp[a]++;
    }
    
    if(mp.size()<3)
    {
        cout<<0;
        return 0;
    }

    for(auto i=mp.begin();next(next(i))!=mp.end();i++)
    {
        for(auto j=next(i);next(j)!=mp.end();j++)
        {
            for(auto k=next(j);k!=mp.end();k++)
            {
                if(check(i->first,j->first,k->first))
                    ct+=(i->second*j->second*k->second);
            }
        }
    }

    cout<<ct;
    return 0;
}
#include <iostream>
#include <string>
#include <vector>
using namespace std;

char bd[12][12];

void del(int y, int x) {
    if (0 <= y && y < 12 && 0 <= x && x < 12 && bd[y][x] == '1') {
        bd[y][x] = '0';
        del(y-1, x);
        del(y+1, x);
        del(y, x-1);
        del(y, x+1);
    }
}

int main() {
    while (cin >> bd[0][0]) {
        for (int i=0; i<12; ++i) {
            for (int j=0; j<12; ++j) {
                if (i == 0 && j == 0) continue;
                cin >> bd[i][j];
            }
        }
        int cnt = 0;
        for (int i=0; i<12; ++i) {
            for (int j=0; j<12; ++j) {
                if (bd[i][j] == '1') {
                    del(i, j);
                    cnt ++;
                }
            }
        }
        cout << cnt << endl;
    }
    return 0;
}