def solve(s, count, i, p):
    if count == 3:
        p = list(p.split(":"))
        if int(p[0]) + int(p[1]) > int(p[2]) and int(p[1]) + int(p[2]) > int(p[0]) and int(p[0]) + int(p[2]) > int(p[1]) :
            return 1
        else:
            return 0

    if i == len(s):
        return 0

    if s[i] in p:
        return solve(s, count, i + 1, p)
    else:
        return solve(s, count + 1, i + 1, p + s[i] + ":") + solve(s, count, i + 1, p)


n = int(input())
l = list(input().strip().split(" "))
q = ""
print(solve(l, 0, 0, q)) def solve(s, count, i, p):
    if count == 3:
        p = list(p.split(":"))
        if int(p[0]) + int(p[1]) > int(p[2]) and int(p[1]) + int(p[2]) > int(p[0]) and int(p[0]) + int(p[2]) > int(p[1]) :
            return 1
        else:
            return 0

    if i == len(s):
        return 0

    if s[i] in p:
        return solve(s, count, i + 1, p)
    else:
        return solve(s, count + 1, i + 1, p + s[i] + ":") + solve(s, count, i + 1, p) solve if count == 3:
        p = list(p.split(":"))
        if int(p[0]) + int(p[1]) > int(p[2]) and int(p[1]) + int(p[2]) > int(p[0]) and int(p[0]) + int(p[2]) > int(p[1]) :
            return 1
        else:
            return 0

     count == 3 count 3 p = list(p.split(":")) p list(p.split(":")) list p.split(":") p.split p split ":" if int(p[0]) + int(p[1]) > int(p[2]) and int(p[1]) + int(p[2]) > int(p[0]) and int(p[0]) + int(p[2]) > int(p[1]) :
            return 1
        else:
            return 0

     int(p[0]) + int(p[1]) > int(p[2]) and int(p[1]) + int(p[2]) > int(p[0]) and int(p[0]) + int(p[2]) > int(p[1]) int(p[0]) + int(p[1]) > int(p[2]) and int(p[1]) + int(p[2]) > int(p[0]) int(p[0]) + int(p[1]) > int(p[2]) int(p[0]) + int(p[1]) int(p[0]) int p[0] p 0 int(p[1]) int p[1] p 1 int(p[2]) int p[2] p 2 int(p[1]) + int(p[2]) > int(p[0]) int(p[1]) + int(p[2]) int(p[1]) int p[1] p 1 int(p[2]) int p[2] p 2 int(p[0]) int p[0] p 0 int(p[0]) + int(p[2]) > int(p[1]) int(p[0]) + int(p[2]) int(p[0]) int p[0] p 0 int(p[2]) int p[2] p 2 int(p[1]) int p[1] p 1 return 1 1 return 0 0 if i == len(s):
        return 0

     i == len(s) i len(s) len s return 0 0 if s[i] in p:
        return solve(s, count, i + 1, p)
    else:
        return solve(s, count + 1, i + 1, p + s[i] + ":") + solve(s, count, i + 1, p) s[i] in p s[i] s i p return solve(s, count, i + 1, p) solve(s, count, i + 1, p) solve s count i + 1 i 1 p return solve(s, count + 1, i + 1, p + s[i] + ":") + solve(s, count, i + 1, p) solve(s, count + 1, i + 1, p + s[i] + ":") + solve(s, count, i + 1, p) solve(s, count + 1, i + 1, p + s[i] + ":") solve s count + 1 count 1 i + 1 i 1 p + s[i] + ":" p + s[i] p s[i] s i ":" solve(s, count, i + 1, p) solve s count i + 1 i 1 p s s count count i i p p n = int(input()) n int(input()) int input() input l = list(input().strip().split(" ")) l list(input().strip().split(" ")) list input().strip().split(" ") ().strip().split ().strip() ().strip () input strip split " " q = "" q "" print(solve(l, 0, 0, q)) print solve(l, 0, 0, q) solve l 0 0 q l = list(input().strip().split(" ")) list(input().strip().split(" ")) l def solve(s, count, i, p):
    if count == 3:
        p = list(p.split(":"))
        if int(p[0]) + int(p[1]) > int(p[2]) and int(p[1]) + int(p[2]) > int(p[0]) and int(p[0]) + int(p[2]) > int(p[1]) :
            return 1
        else:
            return 0

    if i == len(s):
        return 0

    if s[i] in p:
        return solve(s, count, i + 1, p)
    else:
        return solve(s, count + 1, i + 1, p + s[i] + ":") + solve(s, count, i + 1, p) def solve(s, count, i, p):
    if count == 3:
        p = list(p.split(":"))
        if int(p[0]) + int(p[1]) > int(p[2]) and int(p[1]) + int(p[2]) > int(p[0]) and int(p[0]) + int(p[2]) > int(p[1]) :
            return 1
        else:
            return 0

    if i == len(s):
        return 0

    if s[i] in p:
        return solve(s, count, i + 1, p)
    else:
        return solve(s, count + 1, i + 1, p + s[i] + ":") + solve(s, count, i + 1, p) solve n = int(input()) int(input()) n q = "" "" q
def solve(s, count, i, p):
    if count == 3:
        p = list(p.split(":"))
        if int(p[0]) + int(p[1]) > int(p[2]) and int(p[1]) + int(p[2]) > int(p[0]) and int(p[0]) + int(p[2]) > int(p[1]) :
            return 1
        else:
            return 0

    if i == len(s):
        return 0

    if s[i] in p:
        return solve(s, count, i + 1, p)
    else:
        return solve(s, count + 1, i + 1, p + s[i] + ":") + solve(s, count, i + 1, p)


n = int(input())
l = list(input().strip().split(" "))
q = ""
print(solve(l, 0, 0, q))
