// Author: sighduck
// URL: https://codeforces.com/contest/1230/problem/C

package main

import (
	"bufio"
	"fmt"
	"os"
)

type Edge struct {
	A int
	B int
}

func createMatrix(n int, m int, edges []Edge) [][]bool {
	matrix := make([][]bool, n)
	for i := 0; i < n; i++ {
		matrix[i] = make([]bool, n)
	}
	for _, edge := range edges {
		matrix[edge.A-1][edge.B-1] = true
		matrix[edge.B-1][edge.A-1] = true
	}
	return matrix
}

func Solve(n int, m int, edges []Edge) int {
	if n < 7 {
		return m
	}
	matrix := createMatrix(n, m, edges)
	minMutualNeighbors := n + 1
	for i := 0; i < n; i++ {
		for j := i + 1; j < n; j++ {
			mutualNeighbors := 0
			for z := 0; z < n; z++ {
				if z != i && z != j && matrix[i][z] && matrix[j][z] {
					mutualNeighbors += 1
				}
			}
			if mutualNeighbors < minMutualNeighbors {
				minMutualNeighbors = mutualNeighbors
			}
		}
	}
	return m - minMutualNeighbors
}

func main() {
	reader := bufio.NewReader(os.Stdin)
	writer := bufio.NewWriter(os.Stdout)
	defer writer.Flush()

	var n, m int
	fmt.Fscanf(reader, "%d %d\n", &n, &m)
	edges := make([]Edge, m)
	for i := 0; i < m; i++ {
		fmt.Fscanf(reader, "%d %d\n", &edges[i].A, &edges[i].B)
	}

	fmt.Fprintf(writer, "%d\n", Solve(n, m, edges))
}

package main

import (
	"bufio"
	"errors"
	"fmt"
	"io"
	"math"
	"os"
	"strconv"
)

/*********** I/O ***********/

var (
	// ReadString returns a WORD string.
	ReadString func() string
	stdout     *bufio.Writer
)

func init() {
	ReadString = newReadString(os.Stdin)
	stdout = bufio.NewWriter(os.Stdout)
}

func newReadString(ior io.Reader) func() string {
	r := bufio.NewScanner(ior)
	// r.Buffer(make([]byte, 1024), int(1e+11)) // for AtCoder
	r.Buffer(make([]byte, 1024), int(1e+9)) // for Codeforces
	// Split sets the split function for the Scanner. The default split function is ScanLines.
	// Split panics if it is called after scanning has started.
	r.Split(bufio.ScanWords)

	return func() string {
		if !r.Scan() {
			panic("Scan failed")
		}
		return r.Text()
	}
}

// ReadInt returns an integer.
func ReadInt() int {
	return int(readInt64())
}
func ReadInt2() (int, int) {
	return int(readInt64()), int(readInt64())
}
func ReadInt3() (int, int, int) {
	return int(readInt64()), int(readInt64()), int(readInt64())
}
func ReadInt4() (int, int, int, int) {
	return int(readInt64()), int(readInt64()), int(readInt64()), int(readInt64())
}

// ReadInt64 returns as integer as int64.
func ReadInt64() int64 {
	return readInt64()
}
func ReadInt64_2() (int64, int64) {
	return readInt64(), readInt64()
}
func ReadInt64_3() (int64, int64, int64) {
	return readInt64(), readInt64(), readInt64()
}
func ReadInt64_4() (int64, int64, int64, int64) {
	return readInt64(), readInt64(), readInt64(), readInt64()
}

func readInt64() int64 {
	i, err := strconv.ParseInt(ReadString(), 0, 64)
	if err != nil {
		panic(err.Error())
	}
	return i
}

// ReadIntSlice returns an integer slice that has n integers.
func ReadIntSlice(n int) []int {
	b := make([]int, n)
	for i := 0; i < n; i++ {
		b[i] = ReadInt()
	}
	return b
}

// ReadInt64Slice returns as int64 slice that has n integers.
func ReadInt64Slice(n int) []int64 {
	b := make([]int64, n)
	for i := 0; i < n; i++ {
		b[i] = ReadInt64()
	}
	return b
}

// ReadFloat64 returns an float64.
func ReadFloat64() float64 {
	return float64(readFloat64())
}

func readFloat64() float64 {
	f, err := strconv.ParseFloat(ReadString(), 64)
	if err != nil {
		panic(err.Error())
	}
	return f
}

// ReadFloatSlice returns an float64 slice that has n float64.
func ReadFloat64Slice(n int) []float64 {
	b := make([]float64, n)
	for i := 0; i < n; i++ {
		b[i] = ReadFloat64()
	}
	return b
}

// ReadRuneSlice returns a rune slice.
func ReadRuneSlice() []rune {
	return []rune(ReadString())
}

/*********** Debugging ***********/

// ZeroPaddingRuneSlice returns binary expressions of integer n with zero padding.
// For debugging use.
func ZeroPaddingRuneSlice(n, digitsNum int) []rune {
	sn := fmt.Sprintf("%b", n)

	residualLength := digitsNum - len(sn)
	if residualLength <= 0 {
		return []rune(sn)
	}

	zeros := make([]rune, residualLength)
	for i := 0; i < len(zeros); i++ {
		zeros[i] = '0'
	}

	res := []rune{}
	res = append(res, zeros...)
	res = append(res, []rune(sn)...)

	return res
}

/*********** DP sub-functions ***********/

// ChMin accepts a pointer of integer and a target value.
// If target value is SMALLER than the first argument,
//	then the first argument will be updated by the second argument.
func ChMin(updatedValue *int, target int) bool {
	if *updatedValue > target {
		*updatedValue = target
		return true
	}
	return false
}

// ChMax accepts a pointer of integer and a target value.
// If target value is LARGER than the first argument,
//	then the first argument will be updated by the second argument.
func ChMax(updatedValue *int, target int) bool {
	if *updatedValue < target {
		*updatedValue = target
		return true
	}
	return false
}

// NthBit returns nth bit value of an argument.
// n starts from 0.
func NthBit(num, nth int) int {
	return num >> uint(nth) & 1
}

// OnBit returns the integer that has nth ON bit.
// If an argument has nth ON bit, OnBit returns the argument.
func OnBit(num, nth int) int {
	return num | (1 << uint(nth))
}

// OffBit returns the integer that has nth OFF bit.
// If an argument has nth OFF bit, OffBit returns the argument.
func OffBit(num, nth int) int {
	return num & ^(1 << uint(nth))
}

// PopCount returns the number of ON bit of an argument.
func PopCount(num int) int {
	res := 0

	for i := 0; i < 70; i++ {
		if ((num >> uint(i)) & 1) == 1 {
			res++
		}
	}

	return res
}

/*********** Arithmetic ***********/

// Max returns the max integer among input set.
// This function needs at least 1 argument (no argument causes panic).
func Max(integers ...int) int {
	m := integers[0]
	for i, integer := range integers {
		if i == 0 {
			continue
		}
		if m < integer {
			m = integer
		}
	}
	return m
}

// Min returns the min integer among input set.
// This function needs at least 1 argument (no argument causes panic).
func Min(integers ...int) int {
	m := integers[0]
	for i, integer := range integers {
		if i == 0 {
			continue
		}
		if m > integer {
			m = integer
		}
	}
	return m
}

// DigitSum returns digit sum of a decimal number.
// DigitSum only accept a positive integer.
func DigitSum(n int) int {
	if n < 0 {
		return -1
	}

	res := 0

	for n > 0 {
		res += n % 10
		n /= 10
	}

	return res
}

// DigitNumOfDecimal returns digits number of n.
// n is non negative number.
func DigitNumOfDecimal(n int) int {
	res := 0

	for n > 0 {
		n /= 10
		res++
	}

	return res
}

// Sum returns multiple integers sum.
func Sum(integers ...int) int {
	s := 0

	for _, i := range integers {
		s += i
	}

	return s
}

// Kiriage returns Ceil(a/b)
// a >= 0, b > 0
func Kiriage(a, b int) int {
	return (a + (b - 1)) / b
}

// PowInt is integer version of math.Pow
// PowInt calculate a power by Binary Power (二分累乗法(O(log e))).
func PowInt(a, e int) int {
	if a < 0 || e < 0 {
		panic(errors.New("[argument error]: PowInt does not accept negative integers"))
	}

	if e == 0 {
		return 1
	}

	if e%2 == 0 {
		halfE := e / 2
		half := PowInt(a, halfE)
		return half * half
	}

	return a * PowInt(a, e-1)
}

// AbsInt is integer version of math.Abs
func AbsInt(a int) int {
	if a < 0 {
		return -a
	}
	return a
}

// Gcd returns the Greatest Common Divisor of two natural numbers.
// Gcd only accepts two natural numbers (a, b >= 1).
// 0 or negative number causes panic.
// Gcd uses the Euclidean Algorithm.
func Gcd(a, b int) int {
	if a <= 0 || b <= 0 {
		panic(errors.New("[argument error]: Gcd only accepts two NATURAL numbers"))
	}
	if a < b {
		a, b = b, a
	}

	// Euclidean Algorithm
	for b > 0 {
		div := a % b
		a, b = b, div
	}

	return a
}

// Lcm returns the Least Common Multiple of two natural numbers.
// Lcd only accepts two natural numbers (a, b >= 1).
// 0 or negative number causes panic.
// Lcd uses the Euclidean Algorithm indirectly.
func Lcm(a, b int) int {
	if a <= 0 || b <= 0 {
		panic(errors.New("[argument error]: Gcd only accepts two NATURAL numbers"))
	}

	// a = a'*gcd, b = b'*gcd, a*b = a'*b'*gcd^2
	// a' and b' are relatively prime numbers
	// gcd consists of prime numbers, that are included in a and b
	gcd := Gcd(a, b)

	// not (a * b / gcd), because of reducing a probability of overflow
	return (a / gcd) * b
}

// Strtoi is a wrapper of `strconv.Atoi()`.
// If `strconv.Atoi()` returns an error, Strtoi calls panic.
func Strtoi(s string) int {
	if i, err := strconv.Atoi(s); err != nil {
		panic(errors.New("[argument error]: Strtoi only accepts integer string"))
	} else {
		return i
	}
}

// PrintIntsLine returns integers string delimited by a space.
func PrintIntsLine(A ...int) string {
	res := []rune{}

	for i := 0; i < len(A); i++ {
		str := strconv.Itoa(A[i])
		res = append(res, []rune(str)...)

		if i != len(A)-1 {
			res = append(res, ' ')
		}
	}

	return string(res)
}

/********** I/O usage **********/

//str := ReadString()
//i := ReadInt()
//X := ReadIntSlice(n)
//S := ReadRuneSlice()
//a := ReadFloat64()
//A := ReadFloat64Slice(n)

//str := ZeroPaddingRuneSlice(num, 32)
//str := PrintIntsLine(X...)

/*******************************************************************/

const MOD = 1000000000 + 7
const ALPHABET_NUM = 26
const INF_INT64 = math.MaxInt64
const INF_BIT60 = 1 << 60

var n, m int

var adjMatrix [10][10]int
var dominoMatrix [10][10]int

func main() {
	n, m = ReadInt2()
	for i := 0; i < m; i++ {
		a, b := ReadInt2()
		// 常にaをbより小さくする
		if a > b {
			a, b = b, a
		}
		adjMatrix[a][b] = 1
		adjMatrix[b][a] = 1
	}

	if n <= 6 {
		fmt.Println(m)
	} else {
		fmt.Println(sub())
	}
}

func sub() int {
	res := 0

	// i, jを同じ数字とする
	for i := 1; i <= n; i++ {
		for j := i + 1; j <= n; j++ {
			// ノードにサイコロの目を割り振る
			memo := make(map[int]int)
			dice := 1
			for k := 1; k <= n; k++ {
				if k == j {
					continue
				}
				memo[k] = dice
				dice++
			}
			memo[j] = memo[i]

			tmp := 0
			initialize()
			for l := 1; l <= n; l++ {
				for m := l + 1; m <= n; m++ {
					ll, mm := memo[l], memo[m]
					if ll > mm {
						ll, mm = mm, ll
					}
					if adjMatrix[l][m] == 1 && dominoMatrix[ll][mm] == 1 {
						tmp++
						dominoMatrix[ll][mm] = 0
					}
				}
			}

			ChMax(&res, tmp)
		}
	}

	return res
}

func initialize() {
	for i := 1; i <= 6; i++ {
		dominoMatrix[i][i] = 1
		for j := i + 1; j <= 6; j++ {
			dominoMatrix[i][j] = 1
		}
	}
}

// MODはとったか？
// 遷移だけじゃなくて最後の最後でちゃんと取れよ？

/*******************************************************************/

package main

import (
	"bufio"
	"errors"
	"fmt"
	"io"
	"math"
	"os"
	"strconv"
)

/*********** I/O ***********/

var (
	// ReadString returns a WORD string.
	ReadString func() string
	stdout     *bufio.Writer
)

func init() {
	ReadString = newReadString(os.Stdin)
	stdout = bufio.NewWriter(os.Stdout)
}

func newReadString(ior io.Reader) func() string {
	r := bufio.NewScanner(ior)
	// r.Buffer(make([]byte, 1024), int(1e+11)) // for AtCoder
	r.Buffer(make([]byte, 1024), int(1e+9)) // for Codeforces
	// Split sets the split function for the Scanner. The default split function is ScanLines.
	// Split panics if it is called after scanning has started.
	r.Split(bufio.ScanWords)

	return func() string {
		if !r.Scan() {
			panic("Scan failed")
		}
		return r.Text()
	}
}

// ReadInt returns an integer.
func ReadInt() int {
	return int(readInt64())
}
func ReadInt2() (int, int) {
	return int(readInt64()), int(readInt64())
}
func ReadInt3() (int, int, int) {
	return int(readInt64()), int(readInt64()), int(readInt64())
}
func ReadInt4() (int, int, int, int) {
	return int(readInt64()), int(readInt64()), int(readInt64()), int(readInt64())
}

// ReadInt64 returns as integer as int64.
func ReadInt64() int64 {
	return readInt64()
}
func ReadInt64_2() (int64, int64) {
	return readInt64(), readInt64()
}
func ReadInt64_3() (int64, int64, int64) {
	return readInt64(), readInt64(), readInt64()
}
func ReadInt64_4() (int64, int64, int64, int64) {
	return readInt64(), readInt64(), readInt64(), readInt64()
}

func readInt64() int64 {
	i, err := strconv.ParseInt(ReadString(), 0, 64)
	if err != nil {
		panic(err.Error())
	}
	return i
}

// ReadIntSlice returns an integer slice that has n integers.
func ReadIntSlice(n int) []int {
	b := make([]int, n)
	for i := 0; i < n; i++ {
		b[i] = ReadInt()
	}
	return b
}

// ReadInt64Slice returns as int64 slice that has n integers.
func ReadInt64Slice(n int) []int64 {
	b := make([]int64, n)
	for i := 0; i < n; i++ {
		b[i] = ReadInt64()
	}
	return b
}

// ReadFloat64 returns an float64.
func ReadFloat64() float64 {
	return float64(readFloat64())
}

func readFloat64() float64 {
	f, err := strconv.ParseFloat(ReadString(), 64)
	if err != nil {
		panic(err.Error())
	}
	return f
}

// ReadFloatSlice returns an float64 slice that has n float64.
func ReadFloat64Slice(n int) []float64 {
	b := make([]float64, n)
	for i := 0; i < n; i++ {
		b[i] = ReadFloat64()
	}
	return b
}

// ReadRuneSlice returns a rune slice.
func ReadRuneSlice() []rune {
	return []rune(ReadString())
}

/*********** Debugging ***********/

// ZeroPaddingRuneSlice returns binary expressions of integer n with zero padding.
// For debugging use.
func ZeroPaddingRuneSlice(n, digitsNum int) []rune {
	sn := fmt.Sprintf("%b", n)

	residualLength := digitsNum - len(sn)
	if residualLength <= 0 {
		return []rune(sn)
	}

	zeros := make([]rune, residualLength)
	for i := 0; i < len(zeros); i++ {
		zeros[i] = '0'
	}

	res := []rune{}
	res = append(res, zeros...)
	res = append(res, []rune(sn)...)

	return res
}

/*********** DP sub-functions ***********/

// ChMin accepts a pointer of integer and a target value.
// If target value is SMALLER than the first argument,
//	then the first argument will be updated by the second argument.
func ChMin(updatedValue *int, target int) bool {
	if *updatedValue > target {
		*updatedValue = target
		return true
	}
	return false
}

// ChMax accepts a pointer of integer and a target value.
// If target value is LARGER than the first argument,
//	then the first argument will be updated by the second argument.
func ChMax(updatedValue *int, target int) bool {
	if *updatedValue < target {
		*updatedValue = target
		return true
	}
	return false
}

// NthBit returns nth bit value of an argument.
// n starts from 0.
func NthBit(num, nth int) int {
	return num >> uint(nth) & 1
}

// OnBit returns the integer that has nth ON bit.
// If an argument has nth ON bit, OnBit returns the argument.
func OnBit(num, nth int) int {
	return num | (1 << uint(nth))
}

// OffBit returns the integer that has nth OFF bit.
// If an argument has nth OFF bit, OffBit returns the argument.
func OffBit(num, nth int) int {
	return num & ^(1 << uint(nth))
}

// PopCount returns the number of ON bit of an argument.
func PopCount(num int) int {
	res := 0

	for i := 0; i < 70; i++ {
		if ((num >> uint(i)) & 1) == 1 {
			res++
		}
	}

	return res
}

/*********** Arithmetic ***********/

// Max returns the max integer among input set.
// This function needs at least 1 argument (no argument causes panic).
func Max(integers ...int) int {
	m := integers[0]
	for i, integer := range integers {
		if i == 0 {
			continue
		}
		if m < integer {
			m = integer
		}
	}
	return m
}

// Min returns the min integer among input set.
// This function needs at least 1 argument (no argument causes panic).
func Min(integers ...int) int {
	m := integers[0]
	for i, integer := range integers {
		if i == 0 {
			continue
		}
		if m > integer {
			m = integer
		}
	}
	return m
}

// DigitSum returns digit sum of a decimal number.
// DigitSum only accept a positive integer.
func DigitSum(n int) int {
	if n < 0 {
		return -1
	}

	res := 0

	for n > 0 {
		res += n % 10
		n /= 10
	}

	return res
}

// DigitNumOfDecimal returns digits number of n.
// n is non negative number.
func DigitNumOfDecimal(n int) int {
	res := 0

	for n > 0 {
		n /= 10
		res++
	}

	return res
}

// Sum returns multiple integers sum.
func Sum(integers ...int) int {
	s := 0

	for _, i := range integers {
		s += i
	}

	return s
}

// Kiriage returns Ceil(a/b)
// a >= 0, b > 0
func Kiriage(a, b int) int {
	return (a + (b - 1)) / b
}

// PowInt is integer version of math.Pow
// PowInt calculate a power by Binary Power (二分累乗法(O(log e))).
func PowInt(a, e int) int {
	if a < 0 || e < 0 {
		panic(errors.New("[argument error]: PowInt does not accept negative integers"))
	}

	if e == 0 {
		return 1
	}

	if e%2 == 0 {
		halfE := e / 2
		half := PowInt(a, halfE)
		return half * half
	}

	return a * PowInt(a, e-1)
}

// AbsInt is integer version of math.Abs
func AbsInt(a int) int {
	if a < 0 {
		return -a
	}
	return a
}

// Gcd returns the Greatest Common Divisor of two natural numbers.
// Gcd only accepts two natural numbers (a, b >= 1).
// 0 or negative number causes panic.
// Gcd uses the Euclidean Algorithm.
func Gcd(a, b int) int {
	if a <= 0 || b <= 0 {
		panic(errors.New("[argument error]: Gcd only accepts two NATURAL numbers"))
	}
	if a < b {
		a, b = b, a
	}

	// Euclidean Algorithm
	for b > 0 {
		div := a % b
		a, b = b, div
	}

	return a
}

// Lcm returns the Least Common Multiple of two natural numbers.
// Lcd only accepts two natural numbers (a, b >= 1).
// 0 or negative number causes panic.
// Lcd uses the Euclidean Algorithm indirectly.
func Lcm(a, b int) int {
	if a <= 0 || b <= 0 {
		panic(errors.New("[argument error]: Gcd only accepts two NATURAL numbers"))
	}

	// a = a'*gcd, b = b'*gcd, a*b = a'*b'*gcd^2
	// a' and b' are relatively prime numbers
	// gcd consists of prime numbers, that are included in a and b
	gcd := Gcd(a, b)

	// not (a * b / gcd), because of reducing a probability of overflow
	return (a / gcd) * b
}

// Strtoi is a wrapper of `strconv.Atoi()`.
// If `strconv.Atoi()` returns an error, Strtoi calls panic.
func Strtoi(s string) int {
	if i, err := strconv.Atoi(s); err != nil {
		panic(errors.New("[argument error]: Strtoi only accepts integer string"))
	} else {
		return i
	}
}

// PrintIntsLine returns integers string delimited by a space.
func PrintIntsLine(A ...int) string {
	res := []rune{}

	for i := 0; i < len(A); i++ {
		str := strconv.Itoa(A[i])
		// str := strconv.FormatInt(A[i], 10)  // 64bit int version
		res = append(res, []rune(str)...)

		if i != len(A)-1 {
			res = append(res, ' ')
		}
	}

	return string(res)
}

/********** FAU standard libraries **********/

//fmt.Sprintf("%b\n", 255) 	// binary expression

/********** I/O usage **********/

//str := ReadString()
//i := ReadInt()
//X := ReadIntSlice(n)
//S := ReadRuneSlice()
//a := ReadFloat64()
//A := ReadFloat64Slice(n)

//str := ZeroPaddingRuneSlice(num, 32)
//str := PrintIntsLine(X...)

/*******************************************************************/

const MOD = 1000000000 + 7
const ALPHABET_NUM = 26
const INF_INT64 = math.MaxInt64
const INF_BIT60 = 1 << 60

var n, m int

var ans int
var edges []Edge

type Edge struct {
	s, t int
}

func main() {
	n, m = ReadInt2()
	for i := 0; i < m; i++ {
		s, t := ReadInt2()
		s--
		t--
		edges = append(edges, Edge{s, t})
	}

	v := []int{}
	dfs(v)
	fmt.Println(ans)
}

func dfs(v []int) {
	if len(v) == n {
		A := [6][6]int{}
		for i := 0; i < 6; i++ {
			for j := 0; j < 6; j++ {
				A[i][j] = 1
			}
		}

		cnt := 0
		for _, e := range edges {
			l, r := v[e.s], v[e.t]
			if A[l][r] == 1 {
				A[l][r], A[r][l] = 0, 0
				cnt++
			}
		}
		ChMax(&ans, cnt)
	} else {
		for i := 0; i <= 5; i++ {
			tmp := CopySlice(v)
			tmp = append(tmp, i)
			dfs(tmp)
		}
	}
}

func CopySlice(v []int) []int {
	res := make([]int, len(v))
	for i := 0; i < len(v); i++ {
		res[i] = v[i]
	}
	return res
}

// MODはとったか？
// 遷移だけじゃなくて最後の最後でちゃんと取れよ？

/*******************************************************************/

package main

import (
	"bufio"
	. "fmt"
	"io"
	"os"
)

// github.com/EndlessCheng/codeforces-go
func Sol1230C(reader io.Reader, writer io.Writer) {
	in := bufio.NewReader(reader)
	out := bufio.NewWriter(writer)
	defer out.Flush()

	var n, m int
	Fscan(in, &n, &m)
	edges := make([][]int, n+1)
	shown := map[int]int{}
	for i := 0; i < m; i++ {
		var v, w int
		Fscan(in, &v, &w)
		edges[v] = append(edges[v], w)
		edges[w] = append(edges[w], v)
		shown[v] = 1
		shown[w] = 1
	}
	if len(shown) <= 6 {
		Fprintln(out, m)
		return
	}

	ans := 0
	for v, e := range edges {
		if len(e) == 0 {
			continue
		}
		for w, e2 := range edges {
			if w == v || len(e2) == 0 {
				continue
			}
			delta := 0
			for _, u := range e2 {
				if u == v {
					delta = 1
					break
				}
			}
			mp := map[int]int{}
			for _, u := range append(e, e2...) {
				if u == v {
					u = w
				}
				mp[u] = 1
			}
			delta = len(e) + len(e2) - delta - len(mp)
			if newAns := m - delta; newAns > ans {
				ans = newAns
			}
		}
	}
	Fprintln(out, ans)
}

func main() {
	Sol1230C(os.Stdin, os.Stdout)
}

package main

import (
	"bufio"
	"errors"
	"fmt"
	"io"
	"math"
	"os"
	"strconv"
)

/*********** I/O ***********/

var (
	// ReadString returns a WORD string.
	ReadString func() string
	stdout     *bufio.Writer
)

func init() {
	ReadString = newReadString(os.Stdin)
	stdout = bufio.NewWriter(os.Stdout)
}

func newReadString(ior io.Reader) func() string {
	r := bufio.NewScanner(ior)
	// r.Buffer(make([]byte, 1024), int(1e+11)) // for AtCoder
	r.Buffer(make([]byte, 1024), int(1e+9)) // for Codeforces
	// Split sets the split function for the Scanner. The default split function is ScanLines.
	// Split panics if it is called after scanning has started.
	r.Split(bufio.ScanWords)

	return func() string {
		if !r.Scan() {
			panic("Scan failed")
		}
		return r.Text()
	}
}

// ReadInt returns an integer.
func ReadInt() int {
	return int(readInt64())
}
func ReadInt2() (int, int) {
	return int(readInt64()), int(readInt64())
}
func ReadInt3() (int, int, int) {
	return int(readInt64()), int(readInt64()), int(readInt64())
}
func ReadInt4() (int, int, int, int) {
	return int(readInt64()), int(readInt64()), int(readInt64()), int(readInt64())
}

// ReadInt64 returns as integer as int64.
func ReadInt64() int64 {
	return readInt64()
}
func ReadInt64_2() (int64, int64) {
	return readInt64(), readInt64()
}
func ReadInt64_3() (int64, int64, int64) {
	return readInt64(), readInt64(), readInt64()
}
func ReadInt64_4() (int64, int64, int64, int64) {
	return readInt64(), readInt64(), readInt64(), readInt64()
}

func readInt64() int64 {
	i, err := strconv.ParseInt(ReadString(), 0, 64)
	if err != nil {
		panic(err.Error())
	}
	return i
}

// ReadIntSlice returns an integer slice that has n integers.
func ReadIntSlice(n int) []int {
	b := make([]int, n)
	for i := 0; i < n; i++ {
		b[i] = ReadInt()
	}
	return b
}

// ReadInt64Slice returns as int64 slice that has n integers.
func ReadInt64Slice(n int) []int64 {
	b := make([]int64, n)
	for i := 0; i < n; i++ {
		b[i] = ReadInt64()
	}
	return b
}

// ReadFloat64 returns an float64.
func ReadFloat64() float64 {
	return float64(readFloat64())
}

func readFloat64() float64 {
	f, err := strconv.ParseFloat(ReadString(), 64)
	if err != nil {
		panic(err.Error())
	}
	return f
}

// ReadFloatSlice returns an float64 slice that has n float64.
func ReadFloat64Slice(n int) []float64 {
	b := make([]float64, n)
	for i := 0; i < n; i++ {
		b[i] = ReadFloat64()
	}
	return b
}

// ReadRuneSlice returns a rune slice.
func ReadRuneSlice() []rune {
	return []rune(ReadString())
}

/*********** Debugging ***********/

// ZeroPaddingRuneSlice returns binary expressions of integer n with zero padding.
// For debugging use.
func ZeroPaddingRuneSlice(n, digitsNum int) []rune {
	sn := fmt.Sprintf("%b", n)

	residualLength := digitsNum - len(sn)
	if residualLength <= 0 {
		return []rune(sn)
	}

	zeros := make([]rune, residualLength)
	for i := 0; i < len(zeros); i++ {
		zeros[i] = '0'
	}

	res := []rune{}
	res = append(res, zeros...)
	res = append(res, []rune(sn)...)

	return res
}

/*********** DP sub-functions ***********/

// ChMin accepts a pointer of integer and a target value.
// If target value is SMALLER than the first argument,
//	then the first argument will be updated by the second argument.
func ChMin(updatedValue *int, target int) bool {
	if *updatedValue > target {
		*updatedValue = target
		return true
	}
	return false
}

// ChMax accepts a pointer of integer and a target value.
// If target value is LARGER than the first argument,
//	then the first argument will be updated by the second argument.
func ChMax(updatedValue *int, target int) bool {
	if *updatedValue < target {
		*updatedValue = target
		return true
	}
	return false
}

// NthBit returns nth bit value of an argument.
// n starts from 0.
func NthBit(num, nth int) int {
	return num >> uint(nth) & 1
}

// OnBit returns the integer that has nth ON bit.
// If an argument has nth ON bit, OnBit returns the argument.
func OnBit(num, nth int) int {
	return num | (1 << uint(nth))
}

// OffBit returns the integer that has nth OFF bit.
// If an argument has nth OFF bit, OffBit returns the argument.
func OffBit(num, nth int) int {
	return num & ^(1 << uint(nth))
}

// PopCount returns the number of ON bit of an argument.
func PopCount(num int) int {
	res := 0

	for i := 0; i < 70; i++ {
		if ((num >> uint(i)) & 1) == 1 {
			res++
		}
	}

	return res
}

/*********** Arithmetic ***********/

// Max returns the max integer among input set.
// This function needs at least 1 argument (no argument causes panic).
func Max(integers ...int) int {
	m := integers[0]
	for i, integer := range integers {
		if i == 0 {
			continue
		}
		if m < integer {
			m = integer
		}
	}
	return m
}

// Min returns the min integer among input set.
// This function needs at least 1 argument (no argument causes panic).
func Min(integers ...int) int {
	m := integers[0]
	for i, integer := range integers {
		if i == 0 {
			continue
		}
		if m > integer {
			m = integer
		}
	}
	return m
}

// DigitSum returns digit sum of a decimal number.
// DigitSum only accept a positive integer.
func DigitSum(n int) int {
	if n < 0 {
		return -1
	}

	res := 0

	for n > 0 {
		res += n % 10
		n /= 10
	}

	return res
}

// DigitNumOfDecimal returns digits number of n.
// n is non negative number.
func DigitNumOfDecimal(n int) int {
	res := 0

	for n > 0 {
		n /= 10
		res++
	}

	return res
}

// Sum returns multiple integers sum.
func Sum(integers ...int) int {
	s := 0

	for _, i := range integers {
		s += i
	}

	return s
}

// Kiriage returns Ceil(a/b)
// a >= 0, b > 0
func Kiriage(a, b int) int {
	return (a + (b - 1)) / b
}

// PowInt is integer version of math.Pow
// PowInt calculate a power by Binary Power (二分累乗法(O(log e))).
func PowInt(a, e int) int {
	if a < 0 || e < 0 {
		panic(errors.New("[argument error]: PowInt does not accept negative integers"))
	}

	if e == 0 {
		return 1
	}

	if e%2 == 0 {
		halfE := e / 2
		half := PowInt(a, halfE)
		return half * half
	}

	return a * PowInt(a, e-1)
}

// AbsInt is integer version of math.Abs
func AbsInt(a int) int {
	if a < 0 {
		return -a
	}
	return a
}

// Gcd returns the Greatest Common Divisor of two natural numbers.
// Gcd only accepts two natural numbers (a, b >= 1).
// 0 or negative number causes panic.
// Gcd uses the Euclidean Algorithm.
func Gcd(a, b int) int {
	if a <= 0 || b <= 0 {
		panic(errors.New("[argument error]: Gcd only accepts two NATURAL numbers"))
	}
	if a < b {
		a, b = b, a
	}

	// Euclidean Algorithm
	for b > 0 {
		div := a % b
		a, b = b, div
	}

	return a
}

// Lcm returns the Least Common Multiple of two natural numbers.
// Lcd only accepts two natural numbers (a, b >= 1).
// 0 or negative number causes panic.
// Lcd uses the Euclidean Algorithm indirectly.
func Lcm(a, b int) int {
	if a <= 0 || b <= 0 {
		panic(errors.New("[argument error]: Gcd only accepts two NATURAL numbers"))
	}

	// a = a'*gcd, b = b'*gcd, a*b = a'*b'*gcd^2
	// a' and b' are relatively prime numbers
	// gcd consists of prime numbers, that are included in a and b
	gcd := Gcd(a, b)

	// not (a * b / gcd), because of reducing a probability of overflow
	return (a / gcd) * b
}

// Strtoi is a wrapper of `strconv.Atoi()`.
// If `strconv.Atoi()` returns an error, Strtoi calls panic.
func Strtoi(s string) int {
	if i, err := strconv.Atoi(s); err != nil {
		panic(errors.New("[argument error]: Strtoi only accepts integer string"))
	} else {
		return i
	}
}

// PrintIntsLine returns integers string delimited by a space.
func PrintIntsLine(A ...int) string {
	res := []rune{}

	for i := 0; i < len(A); i++ {
		str := strconv.Itoa(A[i])
		// str := strconv.FormatInt(A[i], 10)  // 64bit int version
		res = append(res, []rune(str)...)

		if i != len(A)-1 {
			res = append(res, ' ')
		}
	}

	return string(res)
}

/********** FAU standard libraries **********/

//fmt.Sprintf("%b\n", 255) 	// binary expression

/********** I/O usage **********/

//str := ReadString()
//i := ReadInt()
//X := ReadIntSlice(n)
//S := ReadRuneSlice()
//a := ReadFloat64()
//A := ReadFloat64Slice(n)

//str := ZeroPaddingRuneSlice(num, 32)
//str := PrintIntsLine(X...)

/*******************************************************************/

const MOD = 1000000000 + 7
const ALPHABET_NUM = 26
const INF_INT64 = math.MaxInt64
const INF_BIT60 = 1 << 60

var n, m int

var edges []Edge

type Edge struct {
	s, t int
}

func main() {
	n, m = ReadInt2()
	for i := 0; i < m; i++ {
		s, t := ReadInt2()
		s--
		t--
		edges = append(edges, Edge{s, t})
	}

	ans := 0
	patterns := DuplicatePatterns([]int{0, 1, 2, 3, 4, 5}, n)
	for _, p := range patterns {
		A := [6][6]int{}
		for i := 0; i < 6; i++ {
			for j := 0; j < 6; j++ {
				A[i][j] = 1
			}
		}

		cnt := 0
		for _, e := range edges {
			l, r := p[e.s], p[e.t]
			if A[l][r] == 1 {
				A[l][r], A[r][l] = 0, 0
				cnt++
			}
		}
		ChMax(&ans, cnt)
	}

	fmt.Println(ans)
}

// DuplicatePatterns returns all patterns of n^k of elems([]int).
func DuplicatePatterns(elems []int, k int) [][]int {
	return dupliRec([]int{}, elems, k)
}

// DFS function for DuplicatePatterns.
func dupliRec(pattern, elems []int, k int) [][]int {
	if len(pattern) == k {
		return [][]int{pattern}
	}

	res := [][]int{}
	for _, e := range elems {
		newPattern := make([]int, len(pattern))
		copy(newPattern, pattern)
		newPattern = append(newPattern, e)

		res = append(res, dupliRec(newPattern, elems, k)...)
	}

	return res
}

// func dfs(v []int) {
// 	if len(v) == n {
// 		A := [6][6]int{}
// 		for i := 0; i < 6; i++ {
// 			for j := 0; j < 6; j++ {
// 				A[i][j] = 1
// 			}
// 		}

// 		cnt := 0
// 		for _, e := range edges {
// 			l, r := v[e.s], v[e.t]
// 			if A[l][r] == 1 {
// 				A[l][r], A[r][l] = 0, 0
// 				cnt++
// 			}
// 		}
// 		ChMax(&ans, cnt)
// 	} else {
// 		for i := 0; i <= 5; i++ {
// 			tmp := CopySlice(v)
// 			tmp = append(tmp, i)
// 			dfs(tmp)
// 		}
// 	}
// }

// func CopySlice(v []int) []int {
// 	res := make([]int, len(v))
// 	for i := 0; i < len(v); i++ {
// 		res[i] = v[i]
// 	}
// 	return res
// }

// MODはとったか？
// 遷移だけじゃなくて最後の最後でちゃんと取れよ？

/*******************************************************************/

package main

import (
	"bufio"
	"errors"
	"fmt"
	"io"
	"math"
	"os"
	"strconv"
)

/*********** I/O ***********/

var (
	// ReadString returns a WORD string.
	ReadString func() string
	stdout     *bufio.Writer
)

func init() {
	ReadString = newReadString(os.Stdin)
	stdout = bufio.NewWriter(os.Stdout)
}

func newReadString(ior io.Reader) func() string {
	r := bufio.NewScanner(ior)
	// r.Buffer(make([]byte, 1024), int(1e+11)) // for AtCoder
	r.Buffer(make([]byte, 1024), int(1e+9)) // for Codeforces
	// Split sets the split function for the Scanner. The default split function is ScanLines.
	// Split panics if it is called after scanning has started.
	r.Split(bufio.ScanWords)

	return func() string {
		if !r.Scan() {
			panic("Scan failed")
		}
		return r.Text()
	}
}

// ReadInt returns an integer.
func ReadInt() int {
	return int(readInt64())
}
func ReadInt2() (int, int) {
	return int(readInt64()), int(readInt64())
}
func ReadInt3() (int, int, int) {
	return int(readInt64()), int(readInt64()), int(readInt64())
}
func ReadInt4() (int, int, int, int) {
	return int(readInt64()), int(readInt64()), int(readInt64()), int(readInt64())
}

// ReadInt64 returns as integer as int64.
func ReadInt64() int64 {
	return readInt64()
}
func ReadInt64_2() (int64, int64) {
	return readInt64(), readInt64()
}
func ReadInt64_3() (int64, int64, int64) {
	return readInt64(), readInt64(), readInt64()
}
func ReadInt64_4() (int64, int64, int64, int64) {
	return readInt64(), readInt64(), readInt64(), readInt64()
}

func readInt64() int64 {
	i, err := strconv.ParseInt(ReadString(), 0, 64)
	if err != nil {
		panic(err.Error())
	}
	return i
}

// ReadIntSlice returns an integer slice that has n integers.
func ReadIntSlice(n int) []int {
	b := make([]int, n)
	for i := 0; i < n; i++ {
		b[i] = ReadInt()
	}
	return b
}

// ReadInt64Slice returns as int64 slice that has n integers.
func ReadInt64Slice(n int) []int64 {
	b := make([]int64, n)
	for i := 0; i < n; i++ {
		b[i] = ReadInt64()
	}
	return b
}

// ReadFloat64 returns an float64.
func ReadFloat64() float64 {
	return float64(readFloat64())
}

func readFloat64() float64 {
	f, err := strconv.ParseFloat(ReadString(), 64)
	if err != nil {
		panic(err.Error())
	}
	return f
}

// ReadFloatSlice returns an float64 slice that has n float64.
func ReadFloat64Slice(n int) []float64 {
	b := make([]float64, n)
	for i := 0; i < n; i++ {
		b[i] = ReadFloat64()
	}
	return b
}

// ReadRuneSlice returns a rune slice.
func ReadRuneSlice() []rune {
	return []rune(ReadString())
}

/*********** Debugging ***********/

// ZeroPaddingRuneSlice returns binary expressions of integer n with zero padding.
// For debugging use.
func ZeroPaddingRuneSlice(n, digitsNum int) []rune {
	sn := fmt.Sprintf("%b", n)

	residualLength := digitsNum - len(sn)
	if residualLength <= 0 {
		return []rune(sn)
	}

	zeros := make([]rune, residualLength)
	for i := 0; i < len(zeros); i++ {
		zeros[i] = '0'
	}

	res := []rune{}
	res = append(res, zeros...)
	res = append(res, []rune(sn)...)

	return res
}

/*********** DP sub-functions ***********/

// ChMin accepts a pointer of integer and a target value.
// If target value is SMALLER than the first argument,
//	then the first argument will be updated by the second argument.
func ChMin(updatedValue *int, target int) bool {
	if *updatedValue > target {
		*updatedValue = target
		return true
	}
	return false
}

// ChMax accepts a pointer of integer and a target value.
// If target value is LARGER than the first argument,
//	then the first argument will be updated by the second argument.
func ChMax(updatedValue *int, target int) bool {
	if *updatedValue < target {
		*updatedValue = target
		return true
	}
	return false
}

// NthBit returns nth bit value of an argument.
// n starts from 0.
func NthBit(num, nth int) int {
	return num >> uint(nth) & 1
}

// OnBit returns the integer that has nth ON bit.
// If an argument has nth ON bit, OnBit returns the argument.
func OnBit(num, nth int) int {
	return num | (1 << uint(nth))
}

// OffBit returns the integer that has nth OFF bit.
// If an argument has nth OFF bit, OffBit returns the argument.
func OffBit(num, nth int) int {
	return num & ^(1 << uint(nth))
}

// PopCount returns the number of ON bit of an argument.
func PopCount(num int) int {
	res := 0

	for i := 0; i < 70; i++ {
		if ((num >> uint(i)) & 1) == 1 {
			res++
		}
	}

	return res
}

/*********** Arithmetic ***********/

// Max returns the max integer among input set.
// This function needs at least 1 argument (no argument causes panic).
func Max(integers ...int) int {
	m := integers[0]
	for i, integer := range integers {
		if i == 0 {
			continue
		}
		if m < integer {
			m = integer
		}
	}
	return m
}

// Min returns the min integer among input set.
// This function needs at least 1 argument (no argument causes panic).
func Min(integers ...int) int {
	m := integers[0]
	for i, integer := range integers {
		if i == 0 {
			continue
		}
		if m > integer {
			m = integer
		}
	}
	return m
}

// DigitSum returns digit sum of a decimal number.
// DigitSum only accept a positive integer.
func DigitSum(n int) int {
	if n < 0 {
		return -1
	}

	res := 0

	for n > 0 {
		res += n % 10
		n /= 10
	}

	return res
}

// DigitNumOfDecimal returns digits number of n.
// n is non negative number.
func DigitNumOfDecimal(n int) int {
	res := 0

	for n > 0 {
		n /= 10
		res++
	}

	return res
}

// Sum returns multiple integers sum.
func Sum(integers ...int) int {
	s := 0

	for _, i := range integers {
		s += i
	}

	return s
}

// Kiriage returns Ceil(a/b)
// a >= 0, b > 0
func Kiriage(a, b int) int {
	return (a + (b - 1)) / b
}

// PowInt is integer version of math.Pow
// PowInt calculate a power by Binary Power (二分累乗法(O(log e))).
func PowInt(a, e int) int {
	if a < 0 || e < 0 {
		panic(errors.New("[argument error]: PowInt does not accept negative integers"))
	}

	if e == 0 {
		return 1
	}

	if e%2 == 0 {
		halfE := e / 2
		half := PowInt(a, halfE)
		return half * half
	}

	return a * PowInt(a, e-1)
}

// AbsInt is integer version of math.Abs
func AbsInt(a int) int {
	if a < 0 {
		return -a
	}
	return a
}

// Gcd returns the Greatest Common Divisor of two natural numbers.
// Gcd only accepts two natural numbers (a, b >= 1).
// 0 or negative number causes panic.
// Gcd uses the Euclidean Algorithm.
func Gcd(a, b int) int {
	if a <= 0 || b <= 0 {
		panic(errors.New("[argument error]: Gcd only accepts two NATURAL numbers"))
	}
	if a < b {
		a, b = b, a
	}

	// Euclidean Algorithm
	for b > 0 {
		div := a % b
		a, b = b, div
	}

	return a
}

// Lcm returns the Least Common Multiple of two natural numbers.
// Lcd only accepts two natural numbers (a, b >= 1).
// 0 or negative number causes panic.
// Lcd uses the Euclidean Algorithm indirectly.
func Lcm(a, b int) int {
	if a <= 0 || b <= 0 {
		panic(errors.New("[argument error]: Gcd only accepts two NATURAL numbers"))
	}

	// a = a'*gcd, b = b'*gcd, a*b = a'*b'*gcd^2
	// a' and b' are relatively prime numbers
	// gcd consists of prime numbers, that are included in a and b
	gcd := Gcd(a, b)

	// not (a * b / gcd), because of reducing a probability of overflow
	return (a / gcd) * b
}

// Strtoi is a wrapper of `strconv.Atoi()`.
// If `strconv.Atoi()` returns an error, Strtoi calls panic.
func Strtoi(s string) int {
	if i, err := strconv.Atoi(s); err != nil {
		panic(errors.New("[argument error]: Strtoi only accepts integer string"))
	} else {
		return i
	}
}

// PrintIntsLine returns integers string delimited by a space.
func PrintIntsLine(A ...int) string {
	res := []rune{}

	for i := 0; i < len(A); i++ {
		str := strconv.Itoa(A[i])
		res = append(res, []rune(str)...)

		if i != len(A)-1 {
			res = append(res, ' ')
		}
	}

	return string(res)
}

/********** I/O usage **********/

//str := ReadString()
//i := ReadInt()
//X := ReadIntSlice(n)
//S := ReadRuneSlice()
//a := ReadFloat64()
//A := ReadFloat64Slice(n)

//str := ZeroPaddingRuneSlice(num, 32)
//str := PrintIntsLine(X...)

/*******************************************************************/

const MOD = 1000000000 + 7
const ALPHABET_NUM = 26
const INF_INT64 = math.MaxInt64
const INF_BIT60 = 1 << 60

var n, m int

var adjMatrix [10][10]int
var dominoMatrix [10][10]int

func main() {
	n, m = ReadInt2()
	for i := 0; i < m; i++ {
		a, b := ReadInt2()
		// 常にaをbより小さくする
		if a > b {
			a, b = b, a
		}
		adjMatrix[a][b] = 1
		adjMatrix[b][a] = 1
	}

	if n <= 6 {
		fmt.Println(m)
	} else {
		fmt.Println(sub())
	}
}

func sub() int {
	res := 0

	// i, jを同じ数字とする
	for i := 1; i <= n; i++ {
		for j := i + 1; j <= n; j++ {
			// ノードにサイコロの目を割り振る
			memo := make(map[int]int)
			dice := 1
			for k := 1; k <= n; k++ {
				if k == j {
					continue
				}
				memo[k] = dice
				dice++
			}
			memo[j] = memo[i]

			tmp := 0
			initialize()
			for l := 1; l <= n; l++ {
				for m := l + 1; m <= n; m++ {
					ll, mm := memo[l], memo[m]
					if adjMatrix[l][m] == 1 && dominoMatrix[ll][mm] == 1 {
						tmp++
						dominoMatrix[ll][mm] = 0
					}
				}
			}

			ChMax(&res, tmp)
		}
	}

	return res
}

func initialize() {
	for i := 1; i <= 6; i++ {
		dominoMatrix[i][i] = 1
		for j := i + 1; j <= 6; j++ {
			dominoMatrix[i][j] = 1
		}
	}
}

// MODはとったか？
// 遷移だけじゃなくて最後の最後でちゃんと取れよ？

/*******************************************************************/

package main

import (
	"bufio"
	"errors"
	"fmt"
	"io"
	"math"
	"os"
	"strconv"
)

/*********** I/O ***********/

var (
	// ReadString returns a WORD string.
	ReadString func() string
	stdout     *bufio.Writer
)

func init() {
	ReadString = newReadString(os.Stdin)
	stdout = bufio.NewWriter(os.Stdout)
}

func newReadString(ior io.Reader) func() string {
	r := bufio.NewScanner(ior)
	// r.Buffer(make([]byte, 1024), int(1e+11)) // for AtCoder
	r.Buffer(make([]byte, 1024), int(1e+9)) // for Codeforces
	// Split sets the split function for the Scanner. The default split function is ScanLines.
	// Split panics if it is called after scanning has started.
	r.Split(bufio.ScanWords)

	return func() string {
		if !r.Scan() {
			panic("Scan failed")
		}
		return r.Text()
	}
}

// ReadInt returns an integer.
func ReadInt() int {
	return int(readInt64())
}
func ReadInt2() (int, int) {
	return int(readInt64()), int(readInt64())
}
func ReadInt3() (int, int, int) {
	return int(readInt64()), int(readInt64()), int(readInt64())
}
func ReadInt4() (int, int, int, int) {
	return int(readInt64()), int(readInt64()), int(readInt64()), int(readInt64())
}

func readInt64() int64 {
	i, err := strconv.ParseInt(ReadString(), 0, 64)
	if err != nil {
		panic(err.Error())
	}
	return i
}

// ReadIntSlice returns an integer slice that has n integers.
func ReadIntSlice(n int) []int {
	b := make([]int, n)
	for i := 0; i < n; i++ {
		b[i] = ReadInt()
	}
	return b
}

// ReadFloat64 returns an float64.
func ReadFloat64() float64 {
	return float64(readFloat64())
}

func readFloat64() float64 {
	f, err := strconv.ParseFloat(ReadString(), 64)
	if err != nil {
		panic(err.Error())
	}
	return f
}

// ReadFloatSlice returns an float64 slice that has n float64.
func ReadFloat64Slice(n int) []float64 {
	b := make([]float64, n)
	for i := 0; i < n; i++ {
		b[i] = ReadFloat64()
	}
	return b
}

// ReadRuneSlice returns a rune slice.
func ReadRuneSlice() []rune {
	return []rune(ReadString())
}

/*********** Debugging ***********/

// ZeroPaddingRuneSlice returns binary expressions of integer n with zero padding.
// For debugging use.
func ZeroPaddingRuneSlice(n, digitsNum int) []rune {
	sn := fmt.Sprintf("%b", n)

	residualLength := digitsNum - len(sn)
	if residualLength <= 0 {
		return []rune(sn)
	}

	zeros := make([]rune, residualLength)
	for i := 0; i < len(zeros); i++ {
		zeros[i] = '0'
	}

	res := []rune{}
	res = append(res, zeros...)
	res = append(res, []rune(sn)...)

	return res
}

/*********** DP sub-functions ***********/

// ChMin accepts a pointer of integer and a target value.
// If target value is SMALLER than the first argument,
//	then the first argument will be updated by the second argument.
func ChMin(updatedValue *int, target int) bool {
	if *updatedValue > target {
		*updatedValue = target
		return true
	}
	return false
}

// ChMax accepts a pointer of integer and a target value.
// If target value is LARGER than the first argument,
//	then the first argument will be updated by the second argument.
func ChMax(updatedValue *int, target int) bool {
	if *updatedValue < target {
		*updatedValue = target
		return true
	}
	return false
}

// NthBit returns nth bit value of an argument.
// n starts from 0.
func NthBit(num, nth int) int {
	return num >> uint(nth) & 1
}

// OnBit returns the integer that has nth ON bit.
// If an argument has nth ON bit, OnBit returns the argument.
func OnBit(num, nth int) int {
	return num | (1 << uint(nth))
}

// OffBit returns the integer that has nth OFF bit.
// If an argument has nth OFF bit, OffBit returns the argument.
func OffBit(num, nth int) int {
	return num & ^(1 << uint(nth))
}

// PopCount returns the number of ON bit of an argument.
func PopCount(num int) int {
	res := 0

	for i := 0; i < 70; i++ {
		if ((num >> uint(i)) & 1) == 1 {
			res++
		}
	}

	return res
}

/*********** Arithmetic ***********/

// Max returns the max integer among input set.
// This function needs at least 1 argument (no argument causes panic).
func Max(integers ...int) int {
	m := integers[0]
	for i, integer := range integers {
		if i == 0 {
			continue
		}
		if m < integer {
			m = integer
		}
	}
	return m
}

// Min returns the min integer among input set.
// This function needs at least 1 argument (no argument causes panic).
func Min(integers ...int) int {
	m := integers[0]
	for i, integer := range integers {
		if i == 0 {
			continue
		}
		if m > integer {
			m = integer
		}
	}
	return m
}

// DigitSum returns digit sum of a decimal number.
// DigitSum only accept a positive integer.
func DigitSum(n int) int {
	if n < 0 {
		return -1
	}

	res := 0

	for n > 0 {
		res += n % 10
		n /= 10
	}

	return res
}

// DigitNumOfDecimal returns digits number of n.
// n is non negative number.
func DigitNumOfDecimal(n int) int {
	res := 0

	for n > 0 {
		n /= 10
		res++
	}

	return res
}

// Sum returns multiple integers sum.
func Sum(integers ...int) int {
	s := 0

	for _, i := range integers {
		s += i
	}

	return s
}

// Kiriage returns Ceil(a/b)
// a >= 0, b > 0
func Kiriage(a, b int) int {
	return (a + (b - 1)) / b
}

// PowInt is integer version of math.Pow
// PowInt calculate a power by Binary Power (二分累乗法(O(log e))).
func PowInt(a, e int) int {
	if a < 0 || e < 0 {
		panic(errors.New("[argument error]: PowInt does not accept negative integers"))
	}

	if e == 0 {
		return 1
	}

	if e%2 == 0 {
		halfE := e / 2
		half := PowInt(a, halfE)
		return half * half
	}

	return a * PowInt(a, e-1)
}

// AbsInt is integer version of math.Abs
func AbsInt(a int) int {
	if a < 0 {
		return -a
	}
	return a
}

// Gcd returns the Greatest Common Divisor of two natural numbers.
// Gcd only accepts two natural numbers (a, b >= 1).
// 0 or negative number causes panic.
// Gcd uses the Euclidean Algorithm.
func Gcd(a, b int) int {
	if a <= 0 || b <= 0 {
		panic(errors.New("[argument error]: Gcd only accepts two NATURAL numbers"))
	}
	if a < b {
		a, b = b, a
	}

	// Euclidean Algorithm
	for b > 0 {
		div := a % b
		a, b = b, div
	}

	return a
}

// Lcm returns the Least Common Multiple of two natural numbers.
// Lcd only accepts two natural numbers (a, b >= 1).
// 0 or negative number causes panic.
// Lcd uses the Euclidean Algorithm indirectly.
func Lcm(a, b int) int {
	if a <= 0 || b <= 0 {
		panic(errors.New("[argument error]: Gcd only accepts two NATURAL numbers"))
	}

	// a = a'*gcd, b = b'*gcd, a*b = a'*b'*gcd^2
	// a' and b' are relatively prime numbers
	// gcd consists of prime numbers, that are included in a and b
	gcd := Gcd(a, b)

	// not (a * b / gcd), because of reducing a probability of overflow
	return (a / gcd) * b
}

// Strtoi is a wrapper of `strconv.Atoi()`.
// If `strconv.Atoi()` returns an error, Strtoi calls panic.
func Strtoi(s string) int {
	if i, err := strconv.Atoi(s); err != nil {
		panic(errors.New("[argument error]: Strtoi only accepts integer string"))
	} else {
		return i
	}
}

// PrintIntsLine returns integers string delimited by a space.
func PrintIntsLine(A ...int) string {
	res := []rune{}

	for i := 0; i < len(A); i++ {
		str := strconv.Itoa(A[i])
		res = append(res, []rune(str)...)

		if i != len(A)-1 {
			res = append(res, ' ')
		}
	}

	return string(res)
}

/********** I/O usage **********/

//str := ReadString()
//i := ReadInt()
//X := ReadIntSlice(n)
//S := ReadRuneSlice()
//a := ReadFloat64()
//A := ReadFloat64Slice(n)

//str := ZeroPaddingRuneSlice(num, 32)
//str := PrintIntsLine(X...)

/*******************************************************************/

const MOD = 1000000000 + 7
const ALPHABET_NUM = 26
const INF_INT64 = math.MaxInt64
const INF_BIT60 = 1 << 60

var n, m int

var adjMatrix [10][10]int
var dominoMatrix [7][7]int

func main() {
	n, m = ReadInt2()
	for i := 0; i < m; i++ {
		a, b := ReadInt2()
		// 常にaをbより小さくする
		if a > b {
			a, b = b, a
		}
		adjMatrix[a][b] = 1
		adjMatrix[b][a] = 1
	}
	// for i := 1; i <= n; i++ {
	// 	fmt.Println(adjMatrix[i])
	// }
	// initialize()
	// for i := 1; i <= 6; i++ {
	// 	fmt.Println(dominoMatrix[i])
	// }

	if n == 7 {
		ans := 0
		for i := 1; i <= n; i++ {
			initialize()
			tmp := sub(i)
			ChMax(&ans, tmp)
		}
		fmt.Println(ans)
	} else {
		fmt.Println(subsub())
	}
}

func subsub() int {
	res := 0
	for i := 1; i <= n; i++ {
		for j := i + 1; j <= n; j++ {
			if adjMatrix[i][j] == 1 {
				res++
			}
		}
	}
	return res
}

// sevenId を 7としたときの置けるドミノの数
func sub(sevenId int) int {
	res := 0

	// memo: ノードIDからドミノの数へのマップ
	memo := make(map[int]int)
	dominoNum := 1
	for i := 1; i <= n; i++ {
		if i == sevenId {
			continue
		}
		memo[i] = dominoNum
		dominoNum++
	}
	memo[sevenId] = dominoNum
	// memoの逆引き
	revMemo := make(map[int]int)
	for k, v := range memo {
		revMemo[v] = k
	}

	// sevenId以外のノードについて、割り当てられたドミノ数に基づいてドミノをおいていく
	for i := 1; i <= n; i++ {
		for j := i + 1; j <= n; j++ {
			// i, jは通常のノード番号
			if i == sevenId || j == sevenId {
				continue
			}

			if adjMatrix[i][j] == 1 {
				res++

				// i, jをドミノ数に変換
				// diのほうを常に小さく
				di := memo[i]
				dj := memo[j]
				if di > dj {
					di, dj = dj, di
				}
				dominoMatrix[di][dj] = 0 // ドミノを消費
			}
		}
	}

	// i: sevenId のドミノ数をiとする
	resres := 0
	for i := 1; i <= 6; i++ {
		di := i
		tmpRes := 0

		// 他方のノードすべてを調べる
		for j := 1; j <= 6; j++ {
			dj := j
			ni, nj := sevenId, revMemo[dj]
			if di > dj {
				di, dj = dj, di
			}

			// ドミノが未使用かつエッジがアレばドミノを設置できる
			if dominoMatrix[di][dj] == 1 && adjMatrix[ni][nj] == 1 {
				tmpRes++
			}
		}

		ChMax(&resres, tmpRes)
	}

	return res + resres
}

func initialize() {
	for i := 1; i <= 6; i++ {
		for j := i; j <= 6; j++ {
			dominoMatrix[i][j] = 1
		}
	}
}

// MODはとったか？
// 遷移だけじゃなくて最後の最後でちゃんと取れよ？

/*******************************************************************/

package main

import (
	"bufio"
	"errors"
	"fmt"
	"io"
	"math"
	"os"
	"strconv"
)

/*********** I/O ***********/

var (
	// ReadString returns a WORD string.
	ReadString func() string
	stdout     *bufio.Writer
)

func init() {
	ReadString = newReadString(os.Stdin)
	stdout = bufio.NewWriter(os.Stdout)
}

func newReadString(ior io.Reader) func() string {
	r := bufio.NewScanner(ior)
	// r.Buffer(make([]byte, 1024), int(1e+11)) // for AtCoder
	r.Buffer(make([]byte, 1024), int(1e+9)) // for Codeforces
	// Split sets the split function for the Scanner. The default split function is ScanLines.
	// Split panics if it is called after scanning has started.
	r.Split(bufio.ScanWords)

	return func() string {
		if !r.Scan() {
			panic("Scan failed")
		}
		return r.Text()
	}
}

// ReadInt returns an integer.
func ReadInt() int {
	return int(readInt64())
}
func ReadInt2() (int, int) {
	return int(readInt64()), int(readInt64())
}
func ReadInt3() (int, int, int) {
	return int(readInt64()), int(readInt64()), int(readInt64())
}
func ReadInt4() (int, int, int, int) {
	return int(readInt64()), int(readInt64()), int(readInt64()), int(readInt64())
}

// ReadInt64 returns as integer as int64.
func ReadInt64() int64 {
	return readInt64()
}
func ReadInt64_2() (int64, int64) {
	return readInt64(), readInt64()
}
func ReadInt64_3() (int64, int64, int64) {
	return readInt64(), readInt64(), readInt64()
}
func ReadInt64_4() (int64, int64, int64, int64) {
	return readInt64(), readInt64(), readInt64(), readInt64()
}

func readInt64() int64 {
	i, err := strconv.ParseInt(ReadString(), 0, 64)
	if err != nil {
		panic(err.Error())
	}
	return i
}

// ReadIntSlice returns an integer slice that has n integers.
func ReadIntSlice(n int) []int {
	b := make([]int, n)
	for i := 0; i < n; i++ {
		b[i] = ReadInt()
	}
	return b
}

// ReadInt64Slice returns as int64 slice that has n integers.
func ReadInt64Slice(n int) []int64 {
	b := make([]int64, n)
	for i := 0; i < n; i++ {
		b[i] = ReadInt64()
	}
	return b
}

// ReadFloat64 returns an float64.
func ReadFloat64() float64 {
	return float64(readFloat64())
}

func readFloat64() float64 {
	f, err := strconv.ParseFloat(ReadString(), 64)
	if err != nil {
		panic(err.Error())
	}
	return f
}

// ReadFloatSlice returns an float64 slice that has n float64.
func ReadFloat64Slice(n int) []float64 {
	b := make([]float64, n)
	for i := 0; i < n; i++ {
		b[i] = ReadFloat64()
	}
	return b
}

// ReadRuneSlice returns a rune slice.
func ReadRuneSlice() []rune {
	return []rune(ReadString())
}

/*********** Debugging ***********/

// ZeroPaddingRuneSlice returns binary expressions of integer n with zero padding.
// For debugging use.
func ZeroPaddingRuneSlice(n, digitsNum int) []rune {
	sn := fmt.Sprintf("%b", n)

	residualLength := digitsNum - len(sn)
	if residualLength <= 0 {
		return []rune(sn)
	}

	zeros := make([]rune, residualLength)
	for i := 0; i < len(zeros); i++ {
		zeros[i] = '0'
	}

	res := []rune{}
	res = append(res, zeros...)
	res = append(res, []rune(sn)...)

	return res
}

/*********** DP sub-functions ***********/

// ChMin accepts a pointer of integer and a target value.
// If target value is SMALLER than the first argument,
//	then the first argument will be updated by the second argument.
func ChMin(updatedValue *int, target int) bool {
	if *updatedValue > target {
		*updatedValue = target
		return true
	}
	return false
}

// ChMax accepts a pointer of integer and a target value.
// If target value is LARGER than the first argument,
//	then the first argument will be updated by the second argument.
func ChMax(updatedValue *int, target int) bool {
	if *updatedValue < target {
		*updatedValue = target
		return true
	}
	return false
}

// NthBit returns nth bit value of an argument.
// n starts from 0.
func NthBit(num, nth int) int {
	return num >> uint(nth) & 1
}

// OnBit returns the integer that has nth ON bit.
// If an argument has nth ON bit, OnBit returns the argument.
func OnBit(num, nth int) int {
	return num | (1 << uint(nth))
}

// OffBit returns the integer that has nth OFF bit.
// If an argument has nth OFF bit, OffBit returns the argument.
func OffBit(num, nth int) int {
	return num & ^(1 << uint(nth))
}

// PopCount returns the number of ON bit of an argument.
func PopCount(num int) int {
	res := 0

	for i := 0; i < 70; i++ {
		if ((num >> uint(i)) & 1) == 1 {
			res++
		}
	}

	return res
}

/*********** Arithmetic ***********/

// Max returns the max integer among input set.
// This function needs at least 1 argument (no argument causes panic).
func Max(integers ...int) int {
	m := integers[0]
	for i, integer := range integers {
		if i == 0 {
			continue
		}
		if m < integer {
			m = integer
		}
	}
	return m
}

// Min returns the min integer among input set.
// This function needs at least 1 argument (no argument causes panic).
func Min(integers ...int) int {
	m := integers[0]
	for i, integer := range integers {
		if i == 0 {
			continue
		}
		if m > integer {
			m = integer
		}
	}
	return m
}

// DigitSum returns digit sum of a decimal number.
// DigitSum only accept a positive integer.
func DigitSum(n int) int {
	if n < 0 {
		return -1
	}

	res := 0

	for n > 0 {
		res += n % 10
		n /= 10
	}

	return res
}

// DigitNumOfDecimal returns digits number of n.
// n is non negative number.
func DigitNumOfDecimal(n int) int {
	res := 0

	for n > 0 {
		n /= 10
		res++
	}

	return res
}

// Sum returns multiple integers sum.
func Sum(integers ...int) int {
	s := 0

	for _, i := range integers {
		s += i
	}

	return s
}

// Kiriage returns Ceil(a/b)
// a >= 0, b > 0
func Kiriage(a, b int) int {
	return (a + (b - 1)) / b
}

// PowInt is integer version of math.Pow
// PowInt calculate a power by Binary Power (二分累乗法(O(log e))).
func PowInt(a, e int) int {
	if a < 0 || e < 0 {
		panic(errors.New("[argument error]: PowInt does not accept negative integers"))
	}

	if e == 0 {
		return 1
	}

	if e%2 == 0 {
		halfE := e / 2
		half := PowInt(a, halfE)
		return half * half
	}

	return a * PowInt(a, e-1)
}

// AbsInt is integer version of math.Abs
func AbsInt(a int) int {
	if a < 0 {
		return -a
	}
	return a
}

// Gcd returns the Greatest Common Divisor of two natural numbers.
// Gcd only accepts two natural numbers (a, b >= 1).
// 0 or negative number causes panic.
// Gcd uses the Euclidean Algorithm.
func Gcd(a, b int) int {
	if a <= 0 || b <= 0 {
		panic(errors.New("[argument error]: Gcd only accepts two NATURAL numbers"))
	}
	if a < b {
		a, b = b, a
	}

	// Euclidean Algorithm
	for b > 0 {
		div := a % b
		a, b = b, div
	}

	return a
}

// Lcm returns the Least Common Multiple of two natural numbers.
// Lcd only accepts two natural numbers (a, b >= 1).
// 0 or negative number causes panic.
// Lcd uses the Euclidean Algorithm indirectly.
func Lcm(a, b int) int {
	if a <= 0 || b <= 0 {
		panic(errors.New("[argument error]: Gcd only accepts two NATURAL numbers"))
	}

	// a = a'*gcd, b = b'*gcd, a*b = a'*b'*gcd^2
	// a' and b' are relatively prime numbers
	// gcd consists of prime numbers, that are included in a and b
	gcd := Gcd(a, b)

	// not (a * b / gcd), because of reducing a probability of overflow
	return (a / gcd) * b
}

// Strtoi is a wrapper of `strconv.Atoi()`.
// If `strconv.Atoi()` returns an error, Strtoi calls panic.
func Strtoi(s string) int {
	if i, err := strconv.Atoi(s); err != nil {
		panic(errors.New("[argument error]: Strtoi only accepts integer string"))
	} else {
		return i
	}
}

// PrintIntsLine returns integers string delimited by a space.
func PrintIntsLine(A ...int) string {
	res := []rune{}

	for i := 0; i < len(A); i++ {
		str := strconv.Itoa(A[i])
		res = append(res, []rune(str)...)

		if i != len(A)-1 {
			res = append(res, ' ')
		}
	}

	return string(res)
}

/********** I/O usage **********/

//str := ReadString()
//i := ReadInt()
//X := ReadIntSlice(n)
//S := ReadRuneSlice()
//a := ReadFloat64()
//A := ReadFloat64Slice(n)

//str := ZeroPaddingRuneSlice(num, 32)
//str := PrintIntsLine(X...)

/*******************************************************************/

const MOD = 1000000000 + 7
const ALPHABET_NUM = 26
const INF_INT64 = math.MaxInt64
const INF_BIT60 = 1 << 60

var n, m int

var adjMatrix [10][10]int
var dominoMatrix [7][7]int

func main() {
	n, m = ReadInt2()
	for i := 0; i < m; i++ {
		a, b := ReadInt2()
		// 常にaをbより小さくする
		if a > b {
			a, b = b, a
		}
		adjMatrix[a][b] = 1
		adjMatrix[b][a] = 1
	}

	if n <= 6 {
		fmt.Println(m)
	} else {
		fmt.Println(sub())
	}
}

func sub() int {
	res := 0

	// i, jを同じ数字とする
	for i := 1; i <= n; i++ {
		for j := i + 1; j <= n; j++ {
			// j は除外して置けるドミノの数をカウントし、最後にi, jに辺があれば一つ加算する
			tmp := 0
			for l := 1; l <= n; l++ {
				for m := l + 1; m <= n; m++ {
					if l == j || m == j {
						continue
					}

					if adjMatrix[l][m] == 1 {
						tmp++
					}
				}
			}
			if adjMatrix[i][j] == 1 {
				tmp++
			}

			ChMax(&res, tmp)
		}
	}

	return res
}

// MODはとったか？
// 遷移だけじゃなくて最後の最後でちゃんと取れよ？

/*******************************************************************/

package main

import (
	"bufio"
	"errors"
	"fmt"
	"io"
	"math"
	"os"
	"strconv"
)

/*********** I/O ***********/

var (
	// ReadString returns a WORD string.
	ReadString func() string
	stdout     *bufio.Writer
)

func init() {
	ReadString = newReadString(os.Stdin)
	stdout = bufio.NewWriter(os.Stdout)
}

func newReadString(ior io.Reader) func() string {
	r := bufio.NewScanner(ior)
	// r.Buffer(make([]byte, 1024), int(1e+11)) // for AtCoder
	r.Buffer(make([]byte, 1024), int(1e+9)) // for Codeforces
	// Split sets the split function for the Scanner. The default split function is ScanLines.
	// Split panics if it is called after scanning has started.
	r.Split(bufio.ScanWords)

	return func() string {
		if !r.Scan() {
			panic("Scan failed")
		}
		return r.Text()
	}
}

// ReadInt returns an integer.
func ReadInt() int {
	return int(readInt64())
}
func ReadInt2() (int, int) {
	return int(readInt64()), int(readInt64())
}
func ReadInt3() (int, int, int) {
	return int(readInt64()), int(readInt64()), int(readInt64())
}
func ReadInt4() (int, int, int, int) {
	return int(readInt64()), int(readInt64()), int(readInt64()), int(readInt64())
}

// ReadInt64 returns as integer as int64.
func ReadInt64() int64 {
	return readInt64()
}
func ReadInt64_2() (int64, int64) {
	return readInt64(), readInt64()
}
func ReadInt64_3() (int64, int64, int64) {
	return readInt64(), readInt64(), readInt64()
}
func ReadInt64_4() (int64, int64, int64, int64) {
	return readInt64(), readInt64(), readInt64(), readInt64()
}

func readInt64() int64 {
	i, err := strconv.ParseInt(ReadString(), 0, 64)
	if err != nil {
		panic(err.Error())
	}
	return i
}

// ReadIntSlice returns an integer slice that has n integers.
func ReadIntSlice(n int) []int {
	b := make([]int, n)
	for i := 0; i < n; i++ {
		b[i] = ReadInt()
	}
	return b
}

// ReadInt64Slice returns as int64 slice that has n integers.
func ReadInt64Slice(n int) []int64 {
	b := make([]int64, n)
	for i := 0; i < n; i++ {
		b[i] = ReadInt64()
	}
	return b
}

// ReadFloat64 returns an float64.
func ReadFloat64() float64 {
	return float64(readFloat64())
}

func readFloat64() float64 {
	f, err := strconv.ParseFloat(ReadString(), 64)
	if err != nil {
		panic(err.Error())
	}
	return f
}

// ReadFloatSlice returns an float64 slice that has n float64.
func ReadFloat64Slice(n int) []float64 {
	b := make([]float64, n)
	for i := 0; i < n; i++ {
		b[i] = ReadFloat64()
	}
	return b
}

// ReadRuneSlice returns a rune slice.
func ReadRuneSlice() []rune {
	return []rune(ReadString())
}

/*********** Debugging ***********/

// ZeroPaddingRuneSlice returns binary expressions of integer n with zero padding.
// For debugging use.
func ZeroPaddingRuneSlice(n, digitsNum int) []rune {
	sn := fmt.Sprintf("%b", n)

	residualLength := digitsNum - len(sn)
	if residualLength <= 0 {
		return []rune(sn)
	}

	zeros := make([]rune, residualLength)
	for i := 0; i < len(zeros); i++ {
		zeros[i] = '0'
	}

	res := []rune{}
	res = append(res, zeros...)
	res = append(res, []rune(sn)...)

	return res
}

/*********** DP sub-functions ***********/

// ChMin accepts a pointer of integer and a target value.
// If target value is SMALLER than the first argument,
//	then the first argument will be updated by the second argument.
func ChMin(updatedValue *int, target int) bool {
	if *updatedValue > target {
		*updatedValue = target
		return true
	}
	return false
}

// ChMax accepts a pointer of integer and a target value.
// If target value is LARGER than the first argument,
//	then the first argument will be updated by the second argument.
func ChMax(updatedValue *int, target int) bool {
	if *updatedValue < target {
		*updatedValue = target
		return true
	}
	return false
}

// NthBit returns nth bit value of an argument.
// n starts from 0.
func NthBit(num, nth int) int {
	return num >> uint(nth) & 1
}

// OnBit returns the integer that has nth ON bit.
// If an argument has nth ON bit, OnBit returns the argument.
func OnBit(num, nth int) int {
	return num | (1 << uint(nth))
}

// OffBit returns the integer that has nth OFF bit.
// If an argument has nth OFF bit, OffBit returns the argument.
func OffBit(num, nth int) int {
	return num & ^(1 << uint(nth))
}

// PopCount returns the number of ON bit of an argument.
func PopCount(num int) int {
	res := 0

	for i := 0; i < 70; i++ {
		if ((num >> uint(i)) & 1) == 1 {
			res++
		}
	}

	return res
}

/*********** Arithmetic ***********/

// Max returns the max integer among input set.
// This function needs at least 1 argument (no argument causes panic).
func Max(integers ...int) int {
	m := integers[0]
	for i, integer := range integers {
		if i == 0 {
			continue
		}
		if m < integer {
			m = integer
		}
	}
	return m
}

// Min returns the min integer among input set.
// This function needs at least 1 argument (no argument causes panic).
func Min(integers ...int) int {
	m := integers[0]
	for i, integer := range integers {
		if i == 0 {
			continue
		}
		if m > integer {
			m = integer
		}
	}
	return m
}

// DigitSum returns digit sum of a decimal number.
// DigitSum only accept a positive integer.
func DigitSum(n int) int {
	if n < 0 {
		return -1
	}

	res := 0

	for n > 0 {
		res += n % 10
		n /= 10
	}

	return res
}

// DigitNumOfDecimal returns digits number of n.
// n is non negative number.
func DigitNumOfDecimal(n int) int {
	res := 0

	for n > 0 {
		n /= 10
		res++
	}

	return res
}

// Sum returns multiple integers sum.
func Sum(integers ...int) int {
	s := 0

	for _, i := range integers {
		s += i
	}

	return s
}

// Kiriage returns Ceil(a/b)
// a >= 0, b > 0
func Kiriage(a, b int) int {
	return (a + (b - 1)) / b
}

// PowInt is integer version of math.Pow
// PowInt calculate a power by Binary Power (二分累乗法(O(log e))).
func PowInt(a, e int) int {
	if a < 0 || e < 0 {
		panic(errors.New("[argument error]: PowInt does not accept negative integers"))
	}

	if e == 0 {
		return 1
	}

	if e%2 == 0 {
		halfE := e / 2
		half := PowInt(a, halfE)
		return half * half
	}

	return a * PowInt(a, e-1)
}

// AbsInt is integer version of math.Abs
func AbsInt(a int) int {
	if a < 0 {
		return -a
	}
	return a
}

// Gcd returns the Greatest Common Divisor of two natural numbers.
// Gcd only accepts two natural numbers (a, b >= 1).
// 0 or negative number causes panic.
// Gcd uses the Euclidean Algorithm.
func Gcd(a, b int) int {
	if a <= 0 || b <= 0 {
		panic(errors.New("[argument error]: Gcd only accepts two NATURAL numbers"))
	}
	if a < b {
		a, b = b, a
	}

	// Euclidean Algorithm
	for b > 0 {
		div := a % b
		a, b = b, div
	}

	return a
}

// Lcm returns the Least Common Multiple of two natural numbers.
// Lcd only accepts two natural numbers (a, b >= 1).
// 0 or negative number causes panic.
// Lcd uses the Euclidean Algorithm indirectly.
func Lcm(a, b int) int {
	if a <= 0 || b <= 0 {
		panic(errors.New("[argument error]: Gcd only accepts two NATURAL numbers"))
	}

	// a = a'*gcd, b = b'*gcd, a*b = a'*b'*gcd^2
	// a' and b' are relatively prime numbers
	// gcd consists of prime numbers, that are included in a and b
	gcd := Gcd(a, b)

	// not (a * b / gcd), because of reducing a probability of overflow
	return (a / gcd) * b
}

// Strtoi is a wrapper of `strconv.Atoi()`.
// If `strconv.Atoi()` returns an error, Strtoi calls panic.
func Strtoi(s string) int {
	if i, err := strconv.Atoi(s); err != nil {
		panic(errors.New("[argument error]: Strtoi only accepts integer string"))
	} else {
		return i
	}
}

// PrintIntsLine returns integers string delimited by a space.
func PrintIntsLine(A ...int) string {
	res := []rune{}

	for i := 0; i < len(A); i++ {
		str := strconv.Itoa(A[i])
		res = append(res, []rune(str)...)

		if i != len(A)-1 {
			res = append(res, ' ')
		}
	}

	return string(res)
}

/********** I/O usage **********/

//str := ReadString()
//i := ReadInt()
//X := ReadIntSlice(n)
//S := ReadRuneSlice()
//a := ReadFloat64()
//A := ReadFloat64Slice(n)

//str := ZeroPaddingRuneSlice(num, 32)
//str := PrintIntsLine(X...)

/*******************************************************************/

const MOD = 1000000000 + 7
const ALPHABET_NUM = 26
const INF_INT64 = math.MaxInt64
const INF_BIT60 = 1 << 60

var n, m int

var adjMatrix [10][10]int
var dominoMatrix [10][10]int

func main() {
	n, m = ReadInt2()
	for i := 0; i < m; i++ {
		a, b := ReadInt2()
		// 常にaをbより小さくする
		if a > b {
			a, b = b, a
		}
		adjMatrix[a][b] = 1
		adjMatrix[b][a] = 1
	}

	if n <= 6 {
		fmt.Println(m)
	} else {
		fmt.Println(sub())
	}
}

func sub() int {
	res := 0

	// i, jを同じ数字とする
	for i := 1; i <= n; i++ {
		for j := i + 1; j <= n; j++ {
			memo := make(map[int]int)
			dice := 1
			for k := 1; k <= n; k++ {
				if k == j {
					continue
				}
				memo[k] = dice
				dice++
			}
			memo[j] = memo[i]

			tmp := 0
			initialize()
			for l := 1; l <= n; l++ {
				for m := l + 1; m <= n; m++ {
					ll, mm := memo[l], memo[m]
					if adjMatrix[l][m] == 1 && dominoMatrix[ll][mm] == 1 {
						tmp++
						dominoMatrix[ll][mm] = 0
					}
				}
			}
			if adjMatrix[i][j] == 1 {
				tmp++
			}

			ChMax(&res, tmp)
		}
	}

	return res
}

func initialize() {
	for i := 1; i <= 6; i++ {
		for j := i + 1; j <= 6; j++ {
			dominoMatrix[i][j] = 1
		}
	}
}

// MODはとったか？
// 遷移だけじゃなくて最後の最後でちゃんと取れよ？

/*******************************************************************/

package main

import (
	"bufio"
	"errors"
	"fmt"
	"io"
	"math"
	"os"
	"strconv"
)

/*********** I/O ***********/

var (
	// ReadString returns a WORD string.
	ReadString func() string
	stdout     *bufio.Writer
)

func init() {
	ReadString = newReadString(os.Stdin)
	stdout = bufio.NewWriter(os.Stdout)
}

func newReadString(ior io.Reader) func() string {
	r := bufio.NewScanner(ior)
	// r.Buffer(make([]byte, 1024), int(1e+11)) // for AtCoder
	r.Buffer(make([]byte, 1024), int(1e+9)) // for Codeforces
	// Split sets the split function for the Scanner. The default split function is ScanLines.
	// Split panics if it is called after scanning has started.
	r.Split(bufio.ScanWords)

	return func() string {
		if !r.Scan() {
			panic("Scan failed")
		}
		return r.Text()
	}
}

// ReadInt returns an integer.
func ReadInt() int {
	return int(readInt64())
}
func ReadInt2() (int, int) {
	return int(readInt64()), int(readInt64())
}
func ReadInt3() (int, int, int) {
	return int(readInt64()), int(readInt64()), int(readInt64())
}
func ReadInt4() (int, int, int, int) {
	return int(readInt64()), int(readInt64()), int(readInt64()), int(readInt64())
}

func readInt64() int64 {
	i, err := strconv.ParseInt(ReadString(), 0, 64)
	if err != nil {
		panic(err.Error())
	}
	return i
}

// ReadIntSlice returns an integer slice that has n integers.
func ReadIntSlice(n int) []int {
	b := make([]int, n)
	for i := 0; i < n; i++ {
		b[i] = ReadInt()
	}
	return b
}

// ReadFloat64 returns an float64.
func ReadFloat64() float64 {
	return float64(readFloat64())
}

func readFloat64() float64 {
	f, err := strconv.ParseFloat(ReadString(), 64)
	if err != nil {
		panic(err.Error())
	}
	return f
}

// ReadFloatSlice returns an float64 slice that has n float64.
func ReadFloat64Slice(n int) []float64 {
	b := make([]float64, n)
	for i := 0; i < n; i++ {
		b[i] = ReadFloat64()
	}
	return b
}

// ReadRuneSlice returns a rune slice.
func ReadRuneSlice() []rune {
	return []rune(ReadString())
}

/*********** Debugging ***********/

// ZeroPaddingRuneSlice returns binary expressions of integer n with zero padding.
// For debugging use.
func ZeroPaddingRuneSlice(n, digitsNum int) []rune {
	sn := fmt.Sprintf("%b", n)

	residualLength := digitsNum - len(sn)
	if residualLength <= 0 {
		return []rune(sn)
	}

	zeros := make([]rune, residualLength)
	for i := 0; i < len(zeros); i++ {
		zeros[i] = '0'
	}

	res := []rune{}
	res = append(res, zeros...)
	res = append(res, []rune(sn)...)

	return res
}

/*********** DP sub-functions ***********/

// ChMin accepts a pointer of integer and a target value.
// If target value is SMALLER than the first argument,
//	then the first argument will be updated by the second argument.
func ChMin(updatedValue *int, target int) bool {
	if *updatedValue > target {
		*updatedValue = target
		return true
	}
	return false
}

// ChMax accepts a pointer of integer and a target value.
// If target value is LARGER than the first argument,
//	then the first argument will be updated by the second argument.
func ChMax(updatedValue *int, target int) bool {
	if *updatedValue < target {
		*updatedValue = target
		return true
	}
	return false
}

// NthBit returns nth bit value of an argument.
// n starts from 0.
func NthBit(num, nth int) int {
	return num >> uint(nth) & 1
}

// OnBit returns the integer that has nth ON bit.
// If an argument has nth ON bit, OnBit returns the argument.
func OnBit(num, nth int) int {
	return num | (1 << uint(nth))
}

// OffBit returns the integer that has nth OFF bit.
// If an argument has nth OFF bit, OffBit returns the argument.
func OffBit(num, nth int) int {
	return num & ^(1 << uint(nth))
}

// PopCount returns the number of ON bit of an argument.
func PopCount(num int) int {
	res := 0

	for i := 0; i < 70; i++ {
		if ((num >> uint(i)) & 1) == 1 {
			res++
		}
	}

	return res
}

/*********** Arithmetic ***********/

// Max returns the max integer among input set.
// This function needs at least 1 argument (no argument causes panic).
func Max(integers ...int) int {
	m := integers[0]
	for i, integer := range integers {
		if i == 0 {
			continue
		}
		if m < integer {
			m = integer
		}
	}
	return m
}

// Min returns the min integer among input set.
// This function needs at least 1 argument (no argument causes panic).
func Min(integers ...int) int {
	m := integers[0]
	for i, integer := range integers {
		if i == 0 {
			continue
		}
		if m > integer {
			m = integer
		}
	}
	return m
}

// DigitSum returns digit sum of a decimal number.
// DigitSum only accept a positive integer.
func DigitSum(n int) int {
	if n < 0 {
		return -1
	}

	res := 0

	for n > 0 {
		res += n % 10
		n /= 10
	}

	return res
}

// DigitNumOfDecimal returns digits number of n.
// n is non negative number.
func DigitNumOfDecimal(n int) int {
	res := 0

	for n > 0 {
		n /= 10
		res++
	}

	return res
}

// Sum returns multiple integers sum.
func Sum(integers ...int) int {
	s := 0

	for _, i := range integers {
		s += i
	}

	return s
}

// Kiriage returns Ceil(a/b)
// a >= 0, b > 0
func Kiriage(a, b int) int {
	return (a + (b - 1)) / b
}

// PowInt is integer version of math.Pow
// PowInt calculate a power by Binary Power (二分累乗法(O(log e))).
func PowInt(a, e int) int {
	if a < 0 || e < 0 {
		panic(errors.New("[argument error]: PowInt does not accept negative integers"))
	}

	if e == 0 {
		return 1
	}

	if e%2 == 0 {
		halfE := e / 2
		half := PowInt(a, halfE)
		return half * half
	}

	return a * PowInt(a, e-1)
}

// AbsInt is integer version of math.Abs
func AbsInt(a int) int {
	if a < 0 {
		return -a
	}
	return a
}

// Gcd returns the Greatest Common Divisor of two natural numbers.
// Gcd only accepts two natural numbers (a, b >= 1).
// 0 or negative number causes panic.
// Gcd uses the Euclidean Algorithm.
func Gcd(a, b int) int {
	if a <= 0 || b <= 0 {
		panic(errors.New("[argument error]: Gcd only accepts two NATURAL numbers"))
	}
	if a < b {
		a, b = b, a
	}

	// Euclidean Algorithm
	for b > 0 {
		div := a % b
		a, b = b, div
	}

	return a
}

// Lcm returns the Least Common Multiple of two natural numbers.
// Lcd only accepts two natural numbers (a, b >= 1).
// 0 or negative number causes panic.
// Lcd uses the Euclidean Algorithm indirectly.
func Lcm(a, b int) int {
	if a <= 0 || b <= 0 {
		panic(errors.New("[argument error]: Gcd only accepts two NATURAL numbers"))
	}

	// a = a'*gcd, b = b'*gcd, a*b = a'*b'*gcd^2
	// a' and b' are relatively prime numbers
	// gcd consists of prime numbers, that are included in a and b
	gcd := Gcd(a, b)

	// not (a * b / gcd), because of reducing a probability of overflow
	return (a / gcd) * b
}

// Strtoi is a wrapper of `strconv.Atoi()`.
// If `strconv.Atoi()` returns an error, Strtoi calls panic.
func Strtoi(s string) int {
	if i, err := strconv.Atoi(s); err != nil {
		panic(errors.New("[argument error]: Strtoi only accepts integer string"))
	} else {
		return i
	}
}

// PrintIntsLine returns integers string delimited by a space.
func PrintIntsLine(A ...int) string {
	res := []rune{}

	for i := 0; i < len(A); i++ {
		str := strconv.Itoa(A[i])
		res = append(res, []rune(str)...)

		if i != len(A)-1 {
			res = append(res, ' ')
		}
	}

	return string(res)
}

/********** I/O usage **********/

//str := ReadString()
//i := ReadInt()
//X := ReadIntSlice(n)
//S := ReadRuneSlice()
//a := ReadFloat64()
//A := ReadFloat64Slice(n)

//str := ZeroPaddingRuneSlice(num, 32)
//str := PrintIntsLine(X...)

/*******************************************************************/

const MOD = 1000000000 + 7
const ALPHABET_NUM = 26
const INF_INT64 = math.MaxInt64
const INF_BIT60 = 1 << 60

var n, m int

var adjMatrix [10][10]int
var dominoMatrix [7][7]int

func main() {
	n, m = ReadInt2()
	for i := 0; i < m; i++ {
		a, b := ReadInt2()
		// 常にaをbより小さくする
		if a > b {
			a, b = b, a
		}
		adjMatrix[a][b] = 1
		adjMatrix[b][a] = 1
	}
	// for i := 1; i <= n; i++ {
	// 	fmt.Println(adjMatrix[i])
	// }
	// initialize()
	// for i := 1; i <= 6; i++ {
	// 	fmt.Println(dominoMatrix[i])
	// }

	ans := 0
	for i := 1; i <= n; i++ {
		initialize()
		tmp := sub(i)
		ChMax(&ans, tmp)
	}

	fmt.Println(ans)
}

// sevenId を 7としたときの置けるドミノの数
func sub(sevenId int) int {
	res := 0

	// memo: ノードIDからドミノの数へのマップ
	memo := make(map[int]int)
	dominoNum := 1
	for i := 1; i <= n; i++ {
		if i == sevenId {
			continue
		}
		memo[i] = dominoNum
		dominoNum++
	}
	memo[sevenId] = dominoNum
	// memoの逆引き
	revMemo := make(map[int]int)
	for k, v := range memo {
		revMemo[v] = k
	}

	// sevenId以外のノードについて、割り当てられたドミノ数に基づいてドミノをおいていく
	for i := 1; i <= n; i++ {
		for j := i + 1; j <= n; j++ {
			// i, jは通常のノード番号
			if i == sevenId || j == sevenId {
				continue
			}

			if adjMatrix[i][j] == 1 {
				res++

				// i, jをドミノ数に変換
				// diのほうを常に小さく
				di := memo[i]
				dj := memo[j]
				if di > dj {
					di, dj = dj, di
				}
				dominoMatrix[di][dj] = 0 // ドミノを消費
			}
		}
	}

	// i: sevenId のドミノ数をiとする
	resres := 0
	for i := 1; i <= 6; i++ {
		di := i
		tmpRes := 0

		// 他方のノードすべてを調べる
		for j := 1; j <= 6; j++ {
			dj := j
			ni, nj := sevenId, revMemo[dj]
			if di > dj {
				di, dj = dj, di
			}

			// ドミノが未使用かつエッジがアレばドミノを設置できる
			if dominoMatrix[di][dj] == 1 && adjMatrix[ni][nj] == 1 {
				tmpRes++
			}
		}

		ChMax(&resres, tmpRes)
	}

	return res + resres
}

func initialize() {
	for i := 1; i <= 6; i++ {
		for j := i; j <= 6; j++ {
			dominoMatrix[i][j] = 1
		}
	}
}

// MODはとったか？
// 遷移だけじゃなくて最後の最後でちゃんと取れよ？

/*******************************************************************/

package main

import (
	"bufio"
	. "fmt"
	"io"
	"os"
)

// github.com/EndlessCheng/codeforces-go
func Sol1230C(reader io.Reader, writer io.Writer) {
	in := bufio.NewReader(reader)
	out := bufio.NewWriter(writer)
	defer out.Flush()

	var n, m int
	Fscan(in, &n, &m)
	edges := make([][]int, n+1)
	shown := map[int]int{}
	for i := 0; i < m; i++ {
		var v, w int
		Fscan(in, &v, &w)
		edges[v] = append(edges[v], w)
		edges[w] = append(edges[w], v)
		shown[v] = 1
		shown[w] = 1
	}
	if len(shown) <= 6 {
		Fprintln(out, m)
		return
	}
	minDeg := 100
	for _, e := range edges {
		if len(e) > 0 && len(e) < minDeg {
			minDeg = len(e)
		}
	}
	ans := m - minDeg + 1
	for v, e := range edges {
		if len(e) != minDeg {
			continue
		}
		for w, e2 := range edges {
			if len(e2) <= minDeg {
				continue
			}
			delta := 0
			for _, ee := range e2 {
				if ee == v {
					delta = 1
					break
				}
			}
			mp := map[int]int{}
			for _, ee := range append(e, e2...) {
				if ee == v {
					ee = w
				}
				mp[ee] = 1
			}
			if newAns := m - (len(e) + len(e2) - delta - len(mp)); newAns > ans {
				ans = newAns
			}
		}
	}
	Fprintln(out, ans)
}

func main() {
	Sol1230C(os.Stdin, os.Stdout)
}

package main

import (
	"bufio"
	. "fmt"
	"io"
	"os"
)

// github.com/EndlessCheng/codeforces-go
func Sol1230C(reader io.Reader, writer io.Writer) {
	in := bufio.NewReader(reader)
	out := bufio.NewWriter(writer)
	defer out.Flush()

	var n, m, v, w int
	Fscan(in, &n, &m)
	edges := make([][]int, n+1)
	shown := map[int]int{}
	for i := 0; i < m; i++ {
		Fscan(in, &v, &w)
		edges[v] = append(edges[v], w)
		edges[w] = append(edges[w], v)
		shown[v] = 1
		shown[w] = 1
	}
	if len(shown) <= 6 {
		Fprintln(out, m)
		return
	}
	minDeg := 100
	//var idx int
	for _, e := range edges {
		if len(e) > 0 && len(e) < minDeg {
			minDeg = len(e)
			//idx = i + 1
		}
	}
	ans := m - minDeg + 1
	for _, e := range edges {
		if len(e) != minDeg {
			continue
		}
		for _, e2 := range edges {
			if len(e2) <= minDeg {
				continue
			}
			mp := map[int]int{}
			for _, ee := range append(e, e2...) {
				mp[ee] = 1
			}
			if newAns := m - (len(e) + len(e2) - len(mp)); newAns > ans {
				ans = newAns
			}
		}
	}
	Fprintln(out, ans)
}

func main() {
	Sol1230C(os.Stdin, os.Stdout)
}

package main

import (
	"bufio"
	. "fmt"
	"io"
	"os"
)

// github.com/EndlessCheng/codeforces-go
func Sol1230C(reader io.Reader, writer io.Writer) {
	in := bufio.NewReader(reader)
	out := bufio.NewWriter(writer)
	defer out.Flush()

	var n, m, v, w int
	Fscan(in, &n, &m)
	edges := make([][]int, n+1)
	shown := map[int]int{}
	for i := 0; i < m; i++ {
		Fscan(in, &v, &w)
		edges[v] = append(edges[v], w)
		edges[w] = append(edges[w], v)
		shown[v] = 1
		shown[w] = 1
	}
	if len(shown) <= 6 {
		Fprintln(out, m)
		return
	}
	minDeg := m
	for _, e := range edges {
		if len(e) > 0 && len(e) < minDeg {
			minDeg = len(e)
		}
	}
	Fprintln(out, m-minDeg+1)
}

func main() {
	Sol1230C(os.Stdin, os.Stdout)
}

package main

import (
	"bufio"
	. "fmt"
	"io"
	"os"
)

// github.com/EndlessCheng/codeforces-go
func Sol1230C(reader io.Reader, writer io.Writer) {
	in := bufio.NewReader(reader)
	out := bufio.NewWriter(writer)
	defer out.Flush()

	var n, m int
	Fscan(in, &n, &m)
	edges := make([][]int, n+1)
	shown := map[int]int{}
	for i := 0; i < m; i++ {
		var v, w int
		Fscan(in, &v, &w)
		edges[v] = append(edges[v], w)
		edges[w] = append(edges[w], v)
		shown[v] = 1
		shown[w] = 1
	}
	if len(shown) <= 6 {
		Fprintln(out, m)
		return
	}

	minDeg := 7
	for _, e := range edges {
		if len(e) > 0 && len(e) < minDeg {
			minDeg = len(e)
		}
	}
	ans := 0
	for v, e := range edges {
		if len(e) != minDeg {
			continue
		}
		for w, e2 := range edges {
			if w == v || len(e2) == 0 {
				continue
			}
			delta := 0
			for _, ee := range e2 {
				if ee == v {
					delta = 1
					break
				}
			}
			mp := map[int]int{}
			for _, ee := range append(e, e2...) {
				if ee == v {
					ee = w
				}
				mp[ee] = 1
			}
			delta = len(e) + len(e2) - delta - len(mp)
			if newAns := m - delta; newAns > ans {
				ans = newAns
			}
		}
	}
	Fprintln(out, ans)
}

func main() {
	Sol1230C(os.Stdin, os.Stdout)
}

package main

import (
	"bufio"
	. "fmt"
	"io"
	"os"
)

// github.com/EndlessCheng/codeforces-go
func Sol1230C(reader io.Reader, writer io.Writer) {
	in := bufio.NewReader(reader)
	out := bufio.NewWriter(writer)
	defer out.Flush()

	var n, m, v, w int
	Fscan(in, &n, &m)
	edges := make([][]int, n+1)
	shown := map[int]int{}
	for i := 0; i < m; i++ {
		Fscan(in, &v, &w)
		edges[v] = append(edges[v], w)
		edges[w] = append(edges[w], v)
		shown[v] = 1
		shown[w] = 1
	}
	if len(shown) <= 6 {
		Fprintln(out, m)
		return
	}
	minDeg := 100
	var idx int
	for i, e := range edges {
		if len(e) > 0 && len(e) < minDeg {
			minDeg = len(e)
			idx = i + 1
		}
	}
	ans := m - minDeg + 1
	for i, e := range edges {
		if i == idx || len(e) != minDeg {
			continue
		}
		for _, e2 := range edges {
			if len(e2) <= minDeg {
				continue
			}
			mp := map[int]int{}
			for _, ee := range append(e, e2...) {
				mp[ee] = 1
			}
			if newAns := m - (len(e) + len(e2) - len(mp)); newAns > ans {
				ans = newAns
			}
		}
	}
	Fprintln(out, ans)
}

func main() {
	Sol1230C(os.Stdin, os.Stdout)
}

// Author: sighduck
// URL: https://codeforces.com/contest/1230/problem/C

package main

import (
	"bufio"
	"fmt"
	"os"
)

type Edge struct {
	A int
	B int
}

func min(x int, y int) int {
	if x < y {
		return x
	}
	return y
}

func max(x int, y int) int {
	if x > y {
		return x
	}
	return y
}

func Solve(n int, m int, edges []Edge) int {
	if n < 7 {
		return m
	}
	degreeCount := make([]int, n)
	for _, edge := range edges {
		degreeCount[edge.A-1] += 1
		degreeCount[edge.B-1] += 1
	}
	maxDominoes := 0
	for _, degree := range degreeCount {
		maxDominoes = max(maxDominoes, m-degree+min(degree, 1))
	}
	return min(maxDominoes, 16)
}

func main() {
	reader := bufio.NewReader(os.Stdin)
	writer := bufio.NewWriter(os.Stdout)
	defer writer.Flush()

	var n, m int
	fmt.Fscanf(reader, "%d %d\n", &n, &m)
	edges := make([]Edge, m)
	for i := 0; i < m; i++ {
		fmt.Fscanf(reader, "%d %d\n", &edges[i].A, &edges[i].B)
	}

	fmt.Fprintf(writer, "%d\n", Solve(n, m, edges))
}


package main

import "fmt"

func main() {
  var p, d, t, f, c float32
  fmt.Scan(&p, &d, &t, &f, &c)
  var k, x, r float32
  k = d - p
  x = p * t
  r = 0
  if k > 0 {
    x += x / k * p
    for x < c {
      r++
      x += p * (x / d + f)
      x += x / k * p
    }
  }
  fmt.Println(r)
}

// 148B
package main

import (
	"fmt"
)

func main() {
	var a, b, c, d, e, s, i float64
	fmt.Scan(&a, &b, &c, &d, &e)
	if a < b {
		s = b * a * c / (b - a)
		for i = 0; s < e; i++ {
			s = b * (s + a*(s/b+d)) / (b - a)
		}
	}
	fmt.Println(i)
}


//371B
package main
import (
	"fmt"
	"math"
)

func main() {
	var a, b, c, d int
	var i, j, k, l, m, n, x float64
	fmt.Scan(&a, &b)
	for a!=0 {
		if a%2==0 {
			a=a/2
			i++
		} else if a%3==0 {
			a=a-(a/3*2)
			j++
		} else if a%5==0 {
			a=a-(a/5*4)
			k++
		} else {
			c=a
			break
		}
	}
	for b!=0 {
		if b%2==0 {
			b=b/2
			l++
		} else if b%3==0 {
			b=b-(b/3*2)
			m++
		} else if b%5==0 {
			b=b-(b/5*4)
			n++
		} else {
			d=b
			break
		}
	}
	if c==d {
		x=math.Abs(i-l)+math.Abs(j-m)+math.Abs(k-n)
		fmt.Println(x)
	} else {
		fmt.Println("-1")
	}
}

package main

import "fmt"

func abs(x int) int {
	if x >= 0 {
		return x
	}
	return -x
}

func div(n, d int) (m, ans int) {
	ans = 0
	m = n
	for m % d == 0 {
		m /= d
		ans += 1
	}
	return
}

func main() {
	var a, b int
	fmt.Scanf("%d %d\n", &a, &b)
	a, a2 := div(a, 2)
	a, a3 := div(a, 3)
	a, a5 := div(a, 5)
	b, b2 := div(b, 2)
	b, b3 := div(b, 3)
	b, b5 := div(b, 5)
	ans := abs(a2 - b2) + abs(a3 - b3) + abs(a5 - b5)
	if a != b {
		ans = -1
	}
	fmt.Println(ans)
}

package main

import "fmt"

func abs(x int) int {
	if x >= 0 {
		return x
	}
	return -x
}

func div(n *int, d int) int {
	ans := 0
	for (*n) % d == 0 {
		(*n) /= d
		ans += 1
	}
	return ans
}

func main() {
	var a, b int
	fmt.Scanf("%d %d\n", &a, &b)
	a2 := div(&a, 2)
	a3 := div(&a, 3)
	a5 := div(&a, 5)
	b2 := div(&b, 2)
	b3 := div(&b, 3)
	b5 := div(&b, 5)
	ans := abs(a2 - b2) + abs(a3 - b3) + abs(a5 - b5)
	if a != b {
		ans = -1
	}
	fmt.Println(ans)
}

package main

import (
	"fmt"
	//"bufio"
	//"os"
	//"strconv"
	//"unicode"
	//"strings"
	//"math"
)

func abs(a int)int {
	if a<0 {
		a*=(-1)
	}
	return a
}
func main() {
    var a,b int
    var na,nb [10]int
    fmt.Scan(&a,&b)

    for ;a%2==0; {
    	a/=2
    	na[0]++
    }
    for ;a%3==0; {
    	a/=3
    	na[1]++
    }
    for ;a%5==0; {
    	a/=5
    	na[2]++
    }
    for ;b%2==0; {
    	b/=2
    	nb[0]++
    }
    for ;b%3==0; {
    	b/=3
    	nb[1]++
    }
    for ;b%5==0; {
    	b/=5
    	nb[2]++
    }
    if a!=b {
    	fmt.Println("-1")
    } else {
        ans:=0
        for i:=0;i<3;i++ {
        	ans+=abs(na[i]-nb[i])
        }
        fmt.Println(ans)
    }
}

package main

import "fmt"

func main() {
    abs := func(a int) int { if a < 0 { return -a } else { return a } }

    var a,b,a2,a3,a5,b2,b3,b5 int
    fmt.Scan(&a,&b)
    for ; a%2 == 0; a/=2 { a2++ }
    for ; a%3 == 0; a/=3 { a3++ }
    for ; a%5 == 0; a/=5 { a5++ }
    for ; b%2 == 0; b/=2 { b2++ }
    for ; b%3 == 0; b/=3 { b3++ }
    for ; b%5 == 0; b/=5 { b5++ }
    if a != b { fmt.Println(-1) } else { fmt.Println(abs(a2-b2)+abs(a3-b3)+abs(a5-b5)) }
}

// 371B
package main

import (
	"fmt"
)

var x, y, k1, k2, ans int

func kol(d int) int {
	k1 = 0
	k2 = 0
	for x%d == 0 {
		x /= d
		k1++
	}
	for y%d == 0 {
		y /= d
		k2++
	}
	if k1 > k2 {
		return k1 - k2
	} else {
		return k2 - k1
	}
}

func main() {
	fmt.Scan(&x, &y)
	ans = kol(2) + kol(3) + kol(5)
	if x == y {
		fmt.Print(ans)
	} else {
		fmt.Print(-1)
	}
}

// 371B-mic
package main

import (
	"fmt"
)

func gcd(x, y int) int {
	for y != 0 {
		x, y = y, x%y
	}
	return x
}

func main() {
	var a, b, k int
	fmt.Scan(&a, &b)
	x := gcd(a, b)
	if x != 1 {
		a /= x
		b /= x
	}
	for {
		if a == b {
			break
		}
		if a < b {
			a, b = b, a
		} else if a > b && a%2 != 0 && a%3 != 0 && a%5 != 0 {
			b, a = a, b
		}
		if a%2 != 0 && a%3 != 0 && a%5 != 0 && b%2 != 0 && b%3 != 0 && b%5 != 0 {
			fmt.Println("-1")
			return
		}
		if a%2 == 0 {
			a /= 2
			k++
		} else if a%3 == 0 {
			a /= 3
			k++
		} else if a%5 == 0 {
			a /= 5
			k++
		}
	}
	fmt.Println(k)
}

// 371B-mic
package main

import (
	"fmt"
)

func main() {
	var a, b, k int
	fmt.Scan(&a, &b)
	for {
		if a == b {
			break
		}
		if a < b {
			a, b = b, a
		} else {
			b, a = a, b
		}
		if a%2 == 0 {
			a /= 2
			k++
		} else if a%3 == 0 {
			a /= 3
			k++
		} else if a%5 == 0 {
			a /= 5
			k++
		}
		if a%2 != 0 && a%3 != 0 && a%5 != 0 && b%2 != 0 && b%3 != 0 && b%5 != 0 {
			break
		}
	}
	fmt.Println(k)
}

// 371B-mic
package main

import (
	"fmt"
)

func main() {
	var a, b, k int
	fmt.Scan(&a, &b)
	for {
		if a == b {
			break
		}
		if a < b {
			a, b = b, a
		} else {
			b, a = a, b
		}
		if a%2 == 0 {
			a /= 2
			k++
		} else if a%3 == 0 {
			a /= 3
			k++
		} else if a%5 == 0 {
			a /= 5
			k++
		}
		if a%2 != 0 && a%3 != 0 && a%5 != 0 && a != b {
			fmt.Println("-1")
			return
		}
	}
	fmt.Println(k)
}

// 371B-mic
package main

import (
	"fmt"
)

func main() {
	var a, b, k int
	fmt.Scan(&a, &b)
	for {
		if a == b {
			break
		}
		if a%2 != 0 && a%3 != 0 && a%5 != 0 && b%2 != 0 && b%3 != 0 && b%5 != 0 {
			fmt.Println("-1")
			return
		}
		if a < b {
			a, b = b, a
		} else {
			b, a = a, b
		}
		if a%2 == 0 {
			a /= 2
			k++
		} else if a%3 == 0 {
			a /= 3
			k++
		} else if a%5 == 0 {
			a /= 5
			k++
		}
	}
	fmt.Println(k)
}

// 371B-mic
package main

import (
	"fmt"
)

func main() {
	var a, b, k int
	fmt.Scan(&a, &b)
	for {
		if a < b {
			a, b = b, a
		} else {
			b, a = a, b
		}
		if a%2 == 0 {
			a /= 2
			k++
		} else if a%3 == 0 {
			a /= 3
			k++
		} else if a%5 == 0 {
			a /= 5
			k++
		}
		if a == b {
			break
		}
		if a%2 != 0 && a%3 != 0 && a%5 != 0 && b%2 != 0 && b%3 != 0 && b%5 != 0 {
			fmt.Println("-1")
			return
		}
	}
	fmt.Println(k)
}


package main

import (
	"bufio"
	"fmt"
	"os"
)

// Node to store in queue
type Node struct {
	value int64
	prev  *Node
}

// NewNode to create node with value is n.
func NewNode(n int64) *Node {
	return &Node{
		value: n,
	}
}

func main() {
	var stdin *bufio.Reader
	// LOCAL
	f, _ := os.Open("input.txt")
	stdin = bufio.NewReader(f)

	// ONLINE JUDGE
	stdin = bufio.NewReader(os.Stdin)

	var a, b int64
	fmt.Fscan(stdin, &a, &b)

	var queue = []*Node{NewNode(a)}
	var seen = make(map[int64]bool)
	for len(queue) > 0 {
		var top = queue[0]
		queue = queue[1:]
		seen[top.value] = true

		if top.value == b {
			// Trace
			fmt.Println("YES")
			var res []int64
			for n := top; n != nil; n = n.prev {
				res = append(res, n.value)
			}
			fmt.Println(len(res))
			for i := len(res) - 1; i >= 0; i-- {
				fmt.Print(res[i], " ")
			}

			return
		}

		if top.value*2 <= b && !seen[top.value*2] {
			var n = NewNode(top.value * 2)
			n.prev = top
			queue = append(queue, n)
		}
		if top.value*10+1 <= b && !seen[top.value*10+1] {
			var n = NewNode(top.value*10 + 1)
			n.prev = top
			queue = append(queue, n)
		}

	}

	fmt.Println("NO")

}

package main

import (
	"bufio"
	"fmt"
	"os"
)

var bufin *bufio.Reader
var bufout *bufio.Writer

var a, b int
var trace map[int]int

func dfs(x int) bool {
	if x == b {
		return true
	}
	if x <= b/2 {
		y := x * 2
		_, found := trace[y]
		if !found {
			trace[y] = x
			if dfs(y) {
				return true
			}
		}
	}
	if x <= (b-1)/10 {
		y := x*10 + 1
		_, found := trace[y]
		if !found {
			trace[y] = x
			if dfs(y) {
				return true
			}
		}
	}
	return false
}

func main() {
	bufin = bufio.NewReader(os.Stdin)
	bufout = bufio.NewWriter(os.Stdout)
	defer bufout.Flush()

	fmt.Fscanf(bufin, "%d %d\n", &a, &b)
	trace = make(map[int]int)

	trace[a] = a
	if dfs(a) {
		fmt.Fprintf(bufout, "YES\n")

		var res []int
		for b != a {
			res = append(res, b)
			b = trace[b]
		}
		res = append(res, a)

		n := len(res)
		fmt.Fprintf(bufout, "%d\n", n)
		for i := n - 1; i >= 0; i-- {
			fmt.Fprintf(bufout, "%d ", res[i])
		}
	} else {
		fmt.Fprintf(bufout, "NO\n")
	}

}

package main

import "fmt"

func main() {
    var a, b, steps int
    t := make([]int, 0)
    fmt.Scanf("%d %d", &a, &b)
    t = append(t, b)
    steps = steps + 1
    for {
        if a == b || b < a {
            break
        } else {
            if b % 2 == 0 {
                b = b / 2
                t = append(t, b)
                steps = steps + 1
            } else if (b - 1) % 10 == 0 {
                b = (b - 1) / 10
                t = append(t, b)
                steps = steps + 1
            } else {
                break
            }
        }
    }
    if a == b {
        fmt.Printf("YES\n")
        fmt.Printf("%d\n", steps)
        for idx := len(t) - 1; idx >= 0; idx--{
            if idx == 0 {
                fmt.Printf("%d\n", t[idx])
            } else {
                fmt.Printf("%d ", t[idx])
            }
        }
    } else {
        fmt.Printf("NO\n")
    }
}

package main

import (
	"fmt"
	"os"
)

type node struct {
	value int
	count int
	prev  *node
}

func newNode(n int) *node {
	return &node{
		value: n,
	}
}

func main() {
	seen := make(map[int]bool)
	var a, b int
	fmt.Fscanf(os.Stdin, "%d %d", &a, &b)
	queue := []*node{newNode(b)}

	for len(queue) > 0 {
		curr := queue[0]
		queue = queue[1:]

		if curr.value == a {
			fmt.Println("YES")
			fmt.Println(curr.count + 1)
			for n := curr; n != nil; n = n.prev {
				fmt.Printf("%d ", n.value)
			}
			fmt.Println()
			return
		}
		if curr.value < a || seen[curr.value] {
			continue
		}
		seen[curr.value] = true

		if curr.value%2 == 0 {
			n := newNode(curr.value >> 1)
			n.count = curr.count + 1
			n.prev = curr
			queue = append(queue, n)
		}
		if curr.value%10 == 1 {
			n := newNode(curr.value / 10)
			n.count = curr.count + 1
			n.prev = curr
			queue = append(queue, n)
		}
	}
	fmt.Println("NO")
}

package main

import (
	"bufio"
	"fmt"
	"os"
)

// Node to store in queue
type Node struct {
	value int64
	prev  *Node
}

// NewNode to create node with value is n.
func NewNode(n int64) *Node {
	return &Node{
		value: n,
	}
}

func main() {
	var stdin *bufio.Reader
	// LOCAL
	f, _ := os.Open("input.txt")
	stdin = bufio.NewReader(f)

	// ONLINE JUDGE
	// stdin = bufio.NewReader(os.Stdin)

	var a, b int64
	fmt.Fscan(stdin, &a, &b)

	var queue = []*Node{NewNode(a)}
	var seen = make(map[int64]bool)
	for len(queue) > 0 {
		var top = queue[0]
		queue = queue[1:]
		seen[top.value] = true

		if top.value == b {
			// Trace
			fmt.Println("YES")
			var res []int64
			for n := top; n != nil; n = n.prev {
				res = append(res, n.value)
			}
			fmt.Println(len(res))
			for i := len(res) - 1; i >= 0; i-- {
				fmt.Print(res[i], " ")
			}

			return
		}

		if top.value*2 <= b && !seen[top.value*2] {
			var n = NewNode(top.value * 2)
			n.prev = top
			queue = append(queue, n)
		}
		if top.value*10+1 <= b && !seen[top.value*10+1] {
			var n = NewNode(top.value*10 + 1)
			n.prev = top
			queue = append(queue, n)
		}

	}

	fmt.Println("NO")

}

package main

import "fmt"

func main() {
    var a, b, steps int
    t := make([]int, 0)
    fmt.Scanf("%d %d", &a, &b)
    fmt.Println(a, b)
    t = append(t, b)
    for {
        if a == b {
            break
        } else {
            if b % 2 == 0 {
                b = b / 2
                t = append(t, b)
                steps = steps + 1
            } else if (b - 1) % 10 == 0 {
                b = (b - 1) / 10
                t = append(t, b)
                steps = steps + 1
            } else {
                break
            }
        }
    }
    if a == b {
        fmt.Printf("YES\n")
        fmt.Printf("%d\n", steps)
        for idx := len(t) - 1; idx >= 0; idx--{
            if idx == 0 {
                fmt.Printf("%d\n", t[idx])
            } else {
                fmt.Printf("%d ", t[idx])
            }
        }
    } else {
        fmt.Printf("No\n")
    }
}

package main

import "fmt"

func main() {
    var a, b int
    fmt.Scanf("%d %d", &a, &b)
    fmt.Println(a, b)
}

package main

import "fmt"

func main() {
    var a, b, steps int
    t := make([]int, 0)
    fmt.Scanf("%d %d", &a, &b)
    t = append(t, b)
    for {
        if a == b {
            break
        } else {
            if b % 2 == 0 {
                b = b / 2
                t = append(t, b)
                steps = steps + 1
            } else if (b - 1) % 10 == 0 {
                b = (b - 1) / 10
                t = append(t, b)
                steps = steps + 1
            } else {
                break
            }
        }
    }
    if a == b {
        fmt.Printf("YES\n")
        fmt.Printf("%d\n", steps)
        for idx := len(t) - 1; idx >= 0; idx--{
            if idx == 0 {
                fmt.Printf("%d\n", t[idx])
            } else {
                fmt.Printf("%d ", t[idx])
            }
        }
    } else {
        fmt.Printf("No\n")
    }
}

package main

import "fmt"

func main() {
    var a, b, steps int
    t := make([]int, 0)
    fmt.Scanf("%d %d", &a, &b)
    t = append(t, b)
    steps = steps + 1
    for {
        if a == b || b < a {
            break
        } else {
            if b % 2 == 0 {
                b = b / 2
                t = append(t, b)
                steps = steps + 1
            } else if (b - 1) % 10 == 0 {
                b = (b - 1) / 10
                t = append(t, b)
                steps = steps + 1
            } else {
                break
            }
        }
    }
    if a == b {
        fmt.Printf("YES\n")
        fmt.Printf("%d\n", steps)
        for idx := len(t) - 1; idx >= 0; idx--{
            if idx == 0 {
                fmt.Printf("%d\n", t[idx])
            } else {
                fmt.Printf("%d ", t[idx])
            }
        }
    } else {
        fmt.Printf("No\n")
    }
}

package main

import "fmt"

func main() {
    var a, b, steps int
    t := make([]int, 0)
    fmt.Scanf("%d %d", &a, &b)
    fmt.Println(a, b)
    t = append(t, b)
    for {
        if a == b {
            break
        } else {
            if b % 2 == 0 {
                b = b / 2
                t = append(t, b)
                steps = steps + 1
            } else if (b - 1) % 10 == 0 {
                b = (b - 1) / 10
                t = append(t, b)
                steps = steps + 1
            } else {
                break
            }
        }
    }
    if a == b {
        fmt.Printf("YES\n")
        fmt.Printf("%d\n", steps)
        for idx, val := range t {
            if idx == len(t) - 1 {
                fmt.Printf("%d\n", val)
            } else {
                fmt.Printf("%d ", val)
            }
        }
    } else {
        fmt.Printf("No\n")
    }
}

package main

import (
	"fmt"
	"os"
)

type node struct {
	value int
	count int
	prev  *node
}

func newNode(n int) *node {
	return &node{
		value: n,
	}
}

func main() {
	seen := make(map[int]bool)
	var a, b int
	fmt.Fscanf(os.Stdin, "%d %d", &a, &b)
	queue := []*node{newNode(b)}

	for len(queue) > 0 {
		curr := queue[0]
		queue = queue[1:]

		if curr.value == a {
			fmt.Println("YES")
			fmt.Println(curr.count + 1)
			for n := curr; n != nil; n = n.prev {
				fmt.Printf("%d ", n.value)
			}
			fmt.Println()
			return
		}
		if curr.value < a || seen[curr.value] {
			continue
		}
		seen[curr.value] = true

		n := newNode(curr.value >> 1)
		n.count = curr.count + 1
		n.prev = curr
		queue = append(queue, n)
		if curr.value%10 == 1 {
			n := newNode(curr.value / 10)
			n.count = curr.count + 1
			n.prev = curr
			queue = append(queue, n)
		}
	}
	fmt.Println("NO")
}