output_description: Print the number of pairs of integers (i,j) (1 ≤ i ≤ j ≤ |S|) that satisfy the
  condition.
  
  * * *
input_description: Input is given from Standard Input in the following format:
  
      
      
      S
attempt: # import math
  # import numpy as np
  # import itertools
  # import heapq
  # =map(int,input().split())
  a = input()
  n = len(a)
  ans = 0
  # for i in range(n-4):
  #     for j in range(i+4,n):
  #         x=a[i:j+1]
  #         v=int(x)
  #         if v%2019==0:
  #             ans+=1
  # print(v)
  x = 200000 // 2019
  for i in range(1, x + 1):
      q = 2019 * i
      w = str(q)
      count = sum([a[k : k + len(w)] == w for k in range(0, n - len(w) + 1)])
      ans += count
  print(ans)
  
problem_description: Statement
  
  Given is a string S consisting of digits from `1` through `9`.
  
  Find the number of pairs of integers (i,j) (1 ≤ i ≤ j ≤ |S|) that satisfy the
  following condition:
  
  Condition: In base ten, the i-th through j-th characters of S form an integer
  that is a multiple of 2019.
samples: [{"input": "1817181712114", "output": "3\n    \n\nThree pairs - (1,5), (5,9), and (9,13) \\- satisfy the condition.\n\n* * *"}, {"input": "14282668646", "output": "2\n    \n\n* * *"}, {"input": "2119", "output": "0\n    \n\nNo pairs satisfy the condition."}]