------
## 最终结论
```python
def fibfib(n: int):
    if n == 0:
        return 0
    elif n == 1:
        return 0
    elif n == 2:
        return 1

    fibfib_sequence = [0, 0, 1]

    for i in range(3, n + 1):
        next_value = fibfib_sequence[i - 1] + fibfib_sequence[i - 2] + fibfib_sequence[i - 3]
        fibfib_sequence.append(next_value)

    return fibfib_sequence[n]
```