n,m = gets.chomp.split.map(&:to_i) e=(0...n).map{|x| [x, []]}.to_h m.times.map { u,v=gets.split.map(&:to_i) e[u] << v e[v] << u } ans=0 (0...n).to_a.combination(4) {|xs| u = xs[0] rest = xs[1..-1] rest.permutation(3) { |ys| next unless e[u].index ys[0] next unless e[ys[0]].index ys[1] next unless e[ys[1]].index ys[2] next unless e[ys[2]].index u next if e[u].index ys[1] next if e[ys[0]].index ys[2] ans+=1 } } p ans/2