412_E. E-mail Addresses
One of the most important products of the R1 company is a popular @r1.com mail service. The R1 mailboxes receive and send millions of emails every day.

Today, the online news thundered with terrible information. The R1 database crashed and almost no data could be saved except for one big string. The developers assume that the string contains the letters of some users of the R1 mail. Recovering letters is a tedious mostly manual work. So before you start this process, it was decided to estimate the difficulty of recovering. Namely, we need to calculate the number of different substrings of the saved string that form correct e-mail addresses.

We assume that valid addresses are only the e-mail addresses which meet the following criteria:

  * the address should begin with a non-empty sequence of letters, numbers, characters '_', starting with a letter; 
  * then must go character '@'; 
  * then must go a non-empty sequence of letters or numbers; 
  * then must go character '.'; 
  * the address must end with a non-empty sequence of letters. 



You got lucky again and the job was entrusted to you! Please note that the substring is several consecutive characters in a string. Two substrings, one consisting of the characters of the string with numbers l1, l1 + 1, l1 + 2, ..., r1 and the other one consisting of the characters of the string with numbers l2, l2 + 1, l2 + 2, ..., r2, are considered distinct if l1 ≠ l2 or r1 ≠ r2.

Input

The first and the only line contains the sequence of characters s1s2... sn (1 ≤ n ≤ 106) — the saved string. It is guaranteed that the given string contains only small English letters, digits and characters '.', '_', '@'.

Output

Print in a single line the number of substrings that are valid e-mail addresses.

Examples

Input

gerald.agapov1991@gmail.com


Output

18


Input

x@x.x@x.x_e_@r1.com


Output

8


Input

a___@1.r


Output

1


Input

.asd123__..@


Output

0

Note

In the first test case all the substrings that are correct e-mail addresses begin from one of the letters of the word agapov and end in one of the letters of the word com.

In the second test case note that the e-mail x@x.x is considered twice in the answer. Note that in this example the e-mail entries overlap inside the string.
```python
from sys import stdin, stdout, setrecursionlimit
input = stdin.readline
# setrecursionlimit(int(1e6))
inf = float('inf')
from functools import cmp_to_key
from collections import defaultdict as dd
from collections import Counter, deque
from heapq import *
import math
from math import floor, ceil, sqrt
def geti(): return map(int, input().strip().split())
def getl(): return list(map(int, input().strip().split()))
def getis(): return map(str, input().strip().split())
def getls(): return list(map(str, input().strip().split()))
def gets(): return input().strip()
def geta(): return int(input())
def print_s(s): stdout.write(s+'\n')

def solve():
    s = gets()
    before = after = 0
    n = len(s)
    i = 0
    ans = 0
    while i < n:
        while i < n and s[i] != '@':
            if s[i].isalpha():
                before += 1
            if s[i] == '.':
                before = 0
            i += 1
        # print('b', before)
        if i < n and s[i] == '@':
            i += 1
            ok = True
            temp = 0
            good = False
            while i < n and s[i] != '.':
                if s[i] == '_' or s[i] == '@':
                    ok = False
                    break
                if s[i].isalpha():
                    temp += 1
                i += 1
                good = True
            if not ok or not good:
                before = temp
                after = 0
                continue
            if i < n and s[i] == '.':
                i += 1
                while i < n and s[i].isalpha():
                    after += 1
                    i += 1
        # print('a', after)
        ans += before * after
        before = after
        after = 0
    print(ans)


if __name__=='__main__':
    solve()

```