# Longest Repeating Subsequence

medium

1. You are given a string str. 2. You have to find the length of longest subsequence which is appearing twice in the string. 3. Every ith character in both the subsequences must have different indices in the original string.

## Constraints

1 < length of strings str <= 2000

## Format

### Input

A string str

### Output

A number representing the length of longest repeating subsequence.

## Example

Sample Input

abcdgh

### Sample Output

0

Question Video