Petya loves lucky numbers. Everybody knows that lucky numbers are positive integers whose decimal representation contains only the lucky digits 4 and 7. For example, numbers 47, 744, 4 are lucky and 5, 17, 467 are not.

Petya has an array consisting of *n* numbers. He wants to perform *m* operations of two types: 
 -  add *l* *r* *d* — add an integer *d* to all elements whose indexes belong to the interval from *l* to *r*, inclusive (1 ≤ *l* ≤ *r* ≤ *n*, 1 ≤ *d* ≤ 10<sup class="upper-index">4</sup>); -  count *l* *r* — find and print on the screen how many lucky numbers there are among elements with indexes that belong to the interval from *l* to *r* inclusive (1 ≤ *l* ≤ *r* ≤ *n*). Each lucky number should be counted as many times as it appears in the interval. 
Petya has a list of all operations. The operations are such that after all additions the array won't have numbers that would exceed 10<sup class="upper-index">4</sup>. Help Petya write a program that would perform these operations.
The first line contains two integers *n* and *m* (1 ≤ *n*, *m* ≤ 10<sup class="upper-index">5</sup>) — the number of numbers in the array and the number of operations correspondingly. The second line contains *n* positive integers, none of which exceeds 10<sup class="upper-index">4</sup> — those are the array numbers. Next *m* lines contain operations, one per line. They correspond to the description given in the statement.

It is guaranteed that after all operations are fulfilled each number in the array will not exceed 10<sup class="upper-index">4</sup>.
from sys import stdin

def checkLucky(num):
	num = str(num)
	return(sum([i in ("4","7") for i in num]) == len(num))

m = int(stdin.readline().split()[1])
arr = [int(i) for i in stdin.readline().split()]

for op in range(m):
	opp = stdin.readline().split()
	pos1 = int(opp[1])-1
	pos2 = int(opp[2])
	if opp[0] == "count":
		print(sum([checkLucky(i) for i in arr[pos1:pos2]]))
	else:
		arr[pos1:pos2] = [i + int(opp[3]) for i in arr[pos1:pos2]]
  							 	     			  				   			