Multiple of 2019


Given is a string SS consisting of digits from 1 through 9.

Find the number of pairs of integers (i,j)(i, j) with 1≤i≤j≤∣S∣1 \le i \le j \le |S| such that the substring from the ii-th character through the jj-th character of SS, interpreted as a base ten integer, is a multiple of 20192019.

Input

The input consists of a single line containing SS.

Output

Print the number of pairs of integers (i,j)(i, j) that satisfy the condition.

Constraints

  • 1≤∣S∣≤2000001 \le |S| \le 200000
  • SS is a string consisting only of digits from 1 through 9

Example 1

Input 1
1817181712114
Output 1
3
Explanation

The valid pairs are (1,5)(1, 5), (5,9)(5, 9), and (9,13)(9, 13).

Example 2

Input 2
14282668646
Output 2
2

Example 3

Input 3
2119
Output 3
0
Explanation

No pairs satisfy the condition.

Comments0


No comments yet

Be the first to comment.

New comment


Log in to join the discussion.